[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.145,1.146 sound.cpp,1.82,1.83

Max Horn fingolfin at users.sourceforge.net
Fri Feb 7 16:39:02 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv21637

Modified Files:
	scumm.h sound.cpp 
Log Message:
more stuff made 'protected'

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- scumm.h	6 Feb 2003 21:32:20 -0000	1.145
+++ scumm.h	8 Feb 2003 00:38:16 -0000	1.146
@@ -230,6 +230,8 @@
 
 class Scumm : public Engine {
 	friend void NORETURN CDECL error(const char *s, ...);	// FIXME - ugly but error() accesses g_scumm...
+	friend class ScummDebugger;
+	friend class ScummRenderer;	// FIXME - this is mostly for the destructor
 public:
 	/* Put often used variables at the top.
 	 * That results in a shorter form of the opcode
@@ -300,6 +302,7 @@
 	bool _insaneState;
 	bool _videoFinished;
 	
+	const char *getExeName() const { return _exe_name; }
 	const char *getGameDataPath() const { return _gameDataPath; }
 
 	void pauseGame(bool user);
@@ -331,24 +334,28 @@
 	int checkKeyHit();
 	void convertKeysToClicks();
 
+protected:
 	int keyScriptKey, keyScriptNo;
 
 	/* Random number generation */
 	RandomSource _rnd;
 
-
+public:
 	/* Core variable definitions */
 	byte _gameId;
 
 	/* Core class/array definitions */
 	Gdi gdi;
 
+protected:
 	Actor *_actors;	// Has NUM_ACTORS elements
 	
 	uint16 *_inventory;
 	byte *_arrays;
 	uint16 *_newNames;
+public:
 	int32 *_vars;
+protected:
 	int16 _varwatch;
 	byte *_bitVars;
 
@@ -356,20 +363,25 @@
 	int _numVariables, _numBitVariables, _numLocalObjects;
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
 	int _numInventory, _numRooms, _numScripts, _numSounds;
-	int _numCharsets, _numCostumes, _numNewNames, _numGlobalScripts;
+	int _numCharsets, _numNewNames, _numGlobalScripts;
 	int NUM_ACTORS;
-
+public:
+	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
+	
 	char *_audioNames;
 	int32 _numAudioNames;
 
+protected:
 	/* Current objects - can go in their respective classes */
 	byte _curActor;
 	int _curVerb;
 	int _curVerbSlot;
 	int _curPalIndex;
+public:
 	byte _currentRoom;
 
-	bool _egoPositioned;
+	bool _egoPositioned;	// Used by Actor::putActor, hence public
+protected:
 	int _keyPressed;
 	uint16 _lastKeyHit;
 	uint16 _mouseButStat;
@@ -380,6 +392,7 @@
 	bool _dumpScripts;
 	uint16 _debugMode, _soundCardType;
 
+public:
 	/* Not sure where this stuff goes */
 	uint16 _language;
 	byte isMaskActiveAt(int l, int t, int r, int b, byte *mem);
@@ -473,7 +486,7 @@
 	void push(int a);
 	int pop();
 public:
-	virtual int readVar(uint var);	// FIXME - should be protected but scumm/dialogs.cpp uses it
+	virtual int readVar(uint var);	// FIXME - should be protected, used in scumm/dialogs.cpp
 protected:
 	virtual void writeVar(uint var, int value);
 	void runHook(int i);
@@ -484,9 +497,7 @@
 	void runAllScripts();
 	void cutscene(int *args);
 	void endCutscene();
-public:
-	void exitCutscene();	// FIXME - should be protected but ScummRenderer destructor uses it
-protected:
+	void exitCutscene();
 	void runExitScript();
 	void runEntryScript();
 
@@ -497,7 +508,7 @@
 	void checkAndRunSentenceScript();
 	void decreaseScriptDelay(int amount);
 public:
-	bool isScriptRunning(int script);	// FIXME - should be protected but Sound::startTalkSound uses this
+	bool isScriptRunning(int script);	// FIXME - should be protected, used by Sound::startTalkSound
 protected:
 	bool isRoomScriptRunning(int script);
 	void copyScriptString(byte *dst);
@@ -505,7 +516,6 @@
 	void doSentence(int c, int b, int a);
 	void setStringVars(int i);
 
-public:
 	/* Script VM or Object class? */
 	void stopObjectCode();
 	void stopObjectScript(int script);
@@ -528,6 +538,8 @@
 	void readRoomsOffsets();
 	void askForDisk(const char *filename, int disknum);
 	bool openResourceFile(const char *filename);
+
+public:
 	void loadPtrToResource(int type, int i, byte *ptr);
 	void readResTypeList(int id, uint32 tag, const char *name);
 	char *resTypeFromId(int id);
@@ -627,6 +639,7 @@
 	int cost_frameToAnim(Actor *a, int frame);
 
 
+protected:
 	/* Should be in Verb class */
 	uint16 _verbMouseOver;
 	int _inventoryOffset;	
@@ -644,6 +657,7 @@
 	void runVerbCode(int script, int entry, int a, int b, int *vars);
 	void setVerbObject(uint room, uint object, uint verb);
 
+public:
 	/* Should be in Actor class */
 	Actor *derefActor(int id);
 	Actor *derefActorSafe(int id, const char *errmsg);

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- sound.cpp	3 Feb 2003 12:59:54 -0000	1.82
+++ sound.cpp	8 Feb 2003 00:38:17 -0000	1.83
@@ -853,7 +853,7 @@
 	offset_table = NULL;
 
 #ifdef USE_MAD
-	sprintf(buf, "%s.so3", _scumm->_exe_name);
+	sprintf(buf, "%s.so3", _scumm->getExeName());
 	if (!file->open(buf, _scumm->getGameDataPath())) {
 		file->open("monster.so3", _scumm->getGameDataPath());
 	}
@@ -863,7 +863,7 @@
 
 #ifdef USE_VORBIS
 	if (!file->isOpen()) {
-		sprintf(buf, "%s.sog", _scumm->_exe_name);
+		sprintf(buf, "%s.sog", _scumm->getExeName());
 		if (!file->open(buf, _scumm->getGameDataPath()))
 			file->open("monster.sog", _scumm->getGameDataPath());
 		if (file->isOpen())
@@ -905,7 +905,7 @@
 		return file;
 	}
 
-	sprintf(buf, "%s.sou", _scumm->_exe_name);
+	sprintf(buf, "%s.sou", _scumm->getExeName());
 	if (!file->open(buf, _scumm->getGameDataPath())) {
 		file->open("monster.sou", _scumm->getGameDataPath());
 	}





More information about the Scummvm-git-logs mailing list