[Scummvm-cvs-logs] scummvm master -> 54e3df0140c2d37257132dc8a62520ec8febfc36

Strangerke Strangerke at scummvm.org
Thu Apr 11 12:18:13 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
54e3df0140 HOPKINS: Constify some functions and members


Commit: 54e3df0140c2d37257132dc8a62520ec8febfc36
    https://github.com/scummvm/scummvm/commit/54e3df0140c2d37257132dc8a62520ec8febfc36
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-04-11T03:17:06-07:00

Commit Message:
HOPKINS: Constify some functions and members

Changed paths:
    engines/hopkins/computer.cpp
    engines/hopkins/computer.h
    engines/hopkins/events.cpp
    engines/hopkins/events.h
    engines/hopkins/objects.cpp
    engines/hopkins/objects.h
    engines/hopkins/script.cpp
    engines/hopkins/script.h



diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index 32d5548..f51e1be 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -994,7 +994,7 @@ void ComputerManager::saveScore() {
 /**
  * Display parts of the hiscore line
  */
-void ComputerManager::displayHiscoreLine(byte *objectData, int x, int y, int curChar) {
+void ComputerManager::displayHiscoreLine(const byte *objectData, int x, int y, int curChar) {
 	int idx = 36;
 
 	if (curChar == 100)
diff --git a/engines/hopkins/computer.h b/engines/hopkins/computer.h
index e5c0ae2..cdd653f 100644
--- a/engines/hopkins/computer.h
+++ b/engines/hopkins/computer.h
@@ -85,7 +85,7 @@ private:
 	void displayBricks();
 	void displayGamesSubMenu();
 	int  displayHiscores();
-	void displayHiscoreLine(byte *objectData, int x, int y, int curChar);
+	void displayHiscoreLine(const byte *objectData, int x, int y, int curChar);
 	void displayMessage(int xp, int yp, int textIdx);
 	void displayScore();
 	void displayScoreChar(int charPos, int charDisp);
diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp
index 6c3b8fd..c266f6b 100644
--- a/engines/hopkins/events.cpp
+++ b/engines/hopkins/events.cpp
@@ -183,7 +183,7 @@ void EventsManager::mouseOn() {
 /**
  * Change Mouse Cursor
  */
-void EventsManager::changeMouseCursor(const int id) {
+void EventsManager::changeMouseCursor(int id) {
 	int cursorId = id;
 
 	if (_mouseCursorId == 23)
@@ -282,7 +282,7 @@ void EventsManager::pollEvents() {
 		_keyState[(byte)chr] = false;
 }
 
-void EventsManager::handleKey(Common::Event &event) {
+void EventsManager::handleKey(const Common::Event &event) {
 	_escKeyFl = (event.kbd.keycode == Common::KEYCODE_ESCAPE);
 
 	if (event.kbd.keycode == Common::KEYCODE_i || event.kbd.keycode == Common::KEYCODE_TAB)
diff --git a/engines/hopkins/events.h b/engines/hopkins/events.h
index 1c3b3b1..f4dedce 100644
--- a/engines/hopkins/events.h
+++ b/engines/hopkins/events.h
@@ -48,7 +48,7 @@ private:
 	HopkinsEngine *_vm;
 
 	void pollEvents();
-	void handleKey(Common::Event &event);
+	void handleKey(const Common::Event &event);
 	void checkForNextFrameCounter();
 	void updateCursor();
 
@@ -75,7 +75,7 @@ public:
 	void initMouseData();
 
 	void delay(int totalMilli);
-	void changeMouseCursor(const int id);
+	void changeMouseCursor(int id);
 	void refreshEvents();
 	int waitKeyPress();
 	int getMouseX();
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 4e27cb1..a37295c 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -2784,7 +2784,7 @@ void ObjectsManager::quickDisplayBobSprite(int idx) {
 	_vm->_graphicsMan->fastDisplay(_vm->_talkMan->_characterSprite, xp, yp, spriteIndex);
 }
 
-void ObjectsManager::initVbob(byte *src, int idx, int xp, int yp, int frameIndex) {
+void ObjectsManager::initVbob(const byte *src, int idx, int xp, int yp, int frameIndex) {
 	if (idx > 29)
 		error("MAX_VBOB exceeded");
 
@@ -3558,7 +3558,7 @@ void ObjectsManager::showActionAnimation(const byte *spriteData, const Common::S
 	}
 }
 
-void ObjectsManager::showSpecialActionAnimationWithFlip(byte *spriteData, const Common::String &animationSeq, int speed, bool flipFl) {
+void ObjectsManager::showSpecialActionAnimationWithFlip(const byte *spriteData, const Common::String &animationSeq, int speed, bool flipFl) {
 	Common::String tmpStr = "";
 
 	int realSpeed = speed;
@@ -3600,7 +3600,7 @@ void ObjectsManager::showSpecialActionAnimationWithFlip(byte *spriteData, const
 	} while (spriteIndex != -1);
 }
 
-void ObjectsManager::showSpecialActionAnimation(byte *spriteData, const Common::String &animString, int speed) {
+void ObjectsManager::showSpecialActionAnimation(const byte *spriteData, const Common::String &animString, int speed) {
 	Common::String tmpStr = "";
 	int realSpeed = speed;
 	if (_vm->_globals->_speed == 2)
diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h
index dca7e5c..0562af9 100644
--- a/engines/hopkins/objects.h
+++ b/engines/hopkins/objects.h
@@ -109,7 +109,7 @@ struct LockAnimItem {
 };
 
 struct VBobItem {
-	byte *_spriteData;
+	const byte *_spriteData;
 	int _displayMode;
 	int _xp;
 	int _yp;
@@ -118,7 +118,7 @@ struct VBobItem {
 	int _oldX;
 	int _oldY;
 	int _oldFrameIndex;
-	byte *_oldSpriteData;
+	const byte *_oldSpriteData;
 };
 
 struct ListeItem {
@@ -315,13 +315,13 @@ public:
 	int getObjectWidth()  { return _objectWidth; }
 	int getObjectHeight() { return _objectHeight; }
 
-	void showSpecialActionAnimationWithFlip(byte *spriteData, const Common::String &animationSeq, int speed, bool flipFl);
-	void showSpecialActionAnimation(byte *spriteData, const Common::String &animString, int speed);
+	void showSpecialActionAnimationWithFlip(const byte *spriteData, const Common::String &animationSeq, int speed, bool flipFl);
+	void showSpecialActionAnimation(const byte *spriteData, const Common::String &animString, int speed);
 	void checkEventBobAnim(int idx, int animIdx, int animDataIdx, int a4);
 	void setMultiBobAnim(int idx1, int idx2, int anim1Idx, int anim2Idx);
 	void loadObjectIniFile();
 	void quickDisplayBobSprite(int idx);
-	void initVbob(byte *src, int idx, int xp, int yp, int frameIndex);
+	void initVbob(const byte *src, int idx, int xp, int yp, int frameIndex);
 	void disableVbob(int idx);
 	void setAndPlayAnim(int idx, int animIdx, int destPosi, bool animAction);
 
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index c8dc0eb..ce60377 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -40,7 +40,7 @@ ScriptManager::ScriptManager(HopkinsEngine *vm) {
 	_tempObjectFl = false;
 }
 
-int ScriptManager::handleOpcode(byte *dataP) {
+int ScriptManager::handleOpcode(const byte *dataP) {
 	if (READ_BE_UINT16(dataP) != MKTAG16('F', 'C'))
 		return 0;
 
diff --git a/engines/hopkins/script.h b/engines/hopkins/script.h
index 41da519..2a22e18 100644
--- a/engines/hopkins/script.h
+++ b/engines/hopkins/script.h
@@ -40,7 +40,7 @@ public:
 
 	ScriptManager(HopkinsEngine *vm);
 
-	int handleOpcode(byte *dataP);
+	int handleOpcode(const byte *dataP);
 	int handleIf(const byte *dataP, int offset);
 	int handleGoto(const byte *dataP);
 };






More information about the Scummvm-git-logs mailing list