[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.35,1.36 saveload.cpp,1.51,1.52 script_v8.cpp,2.135,2.136 scumm.h,1.146,1.147 scummvm.cpp,2.48,2.49

Max Horn fingolfin at users.sourceforge.net
Fri Feb 7 17:28:03 CET 2003


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

Modified Files:
	dialogs.cpp saveload.cpp script_v8.cpp scumm.h scummvm.cpp 
Log Message:
more access cleanup; also reorderd some method/function declarations in class Scumm

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- dialogs.cpp	25 Dec 2002 00:38:52 -0000	1.35
+++ dialogs.cpp	8 Feb 2003 01:27:21 -0000	1.36
@@ -427,19 +427,14 @@
 void SaveLoadDialog::save()
 {
 	// Save the selected item
-	_scumm->_saveLoadSlot = _savegameList->getSelected() + 1;
-	_scumm->_saveLoadCompatible = false;
-	_scumm->_saveLoadFlag = 1;		// 1 for save, I assume (Painelf)
-	strcpy(_scumm->_saveLoadName, _savegameList->getSelectedString().c_str());
+	_scumm->requestSave(_savegameList->getSelected() + 1, _savegameList->getSelectedString().c_str());
 	close();
 }
 
 void SaveLoadDialog::load()
 {
 	// Load the selected item
-	_scumm->_saveLoadSlot = _savegameList->getSelected();
-	_scumm->_saveLoadCompatible = false;
-	_scumm->_saveLoadFlag = 2;		// 2 for load. Magic number anyone?
+	_scumm->requestLoad(_savegameList->getSelected());
 	close();
 }
 

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- saveload.cpp	26 Jan 2003 10:54:34 -0000	1.51
+++ saveload.cpp	8 Feb 2003 01:27:21 -0000	1.52
@@ -40,6 +40,21 @@
 };
 
 
+void Scumm::requestSave(int slot, const char *name)
+{
+	_saveLoadSlot = slot;
+	_saveLoadCompatible = false;
+	_saveLoadFlag = 1;		// 1 for save
+	strcpy(_saveLoadName, name);
+}
+
+void Scumm::requestLoad(int slot)
+{
+	_saveLoadSlot = slot;
+	_saveLoadCompatible = false;
+	_saveLoadFlag = 2;		// 2 for load
+}
+
 bool Scumm::saveState(int slot, bool compat, SaveFileManager *mgr)
 {
 	char filename[256];

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.135
retrieving revision 2.136
diff -u -d -r2.135 -r2.136
--- script_v8.cpp	27 Jan 2003 07:07:55 -0000	2.135
+++ script_v8.cpp	8 Feb 2003 01:27:21 -0000	2.136
@@ -1501,8 +1501,8 @@
 		warning("o8_kernelSetFunctions: saveGameStampScreenshot(%d, %d, %d, %d, %d, %d)", args[1], args[2], args[3], args[4], args[5], args[6]);
 		break;
 	case 29:	// setKeyScript
-		keyScriptKey = args[1];
-		keyScriptNo = args[2];
+		_keyScriptKey = args[1];
+		_keyScriptNo = args[2];
 		break;
 	case 30:	// killAllScriptsButMe
 		warning("o8_kernelSetFunctions: killAllScriptsButMe()");

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- scumm.h	8 Feb 2003 00:38:16 -0000	1.146
+++ scumm.h	8 Feb 2003 01:27:21 -0000	1.147
@@ -242,9 +242,9 @@
 	VerbSlot *_verbs;
 	ObjectData *_objs;
 	ScummDebugger *_debugger;
-	Bundle * _bundle;
-	Timer * _timer;
-	Sound * _sound;
+	Bundle *_bundle;
+	Timer *_timer;
+	Sound *_sound;
 
 	struct {
 		byte mode[rtNumTypes];
@@ -272,39 +272,49 @@
 		int16 x, y;
 	} mouse;
 
-	/* Init functions, etc */
-	byte _fastMode;
-
-	/* Scumm main loop */
-
-	void mainRun();
+	// Constructor / Destructor
+	Scumm(GameDetector *detector, OSystem *syst);
+	virtual ~Scumm();
 
+	// Init functions
 	void scummInit();
-	int scummLoop(int delta);
 	void initScummVars();
+	virtual void setupScummVars();
 
+	// Startup functions
+	void main();
+	void parseCommandLine(int argc, char **argv);
+	void showHelpAndExit();
+	bool detectGame();
 	void launch();
-
-	Scumm(GameDetector *detector, OSystem *syst);
-	virtual ~Scumm();
-
 	void go();
 
+	// Scumm main loop
+	void mainRun();
+	int scummLoop(int delta);
+	
+	// Event handling
 	void waitForTimer(int msec_delay);
+	void processKbd();
+	int checkKeyHit();
+	void convertKeysToClicks();
+	int getKeyInput();
 
+	// Misc utility functions
+	void checkRange(int max, int min, int no, const char *str);
+	const char *getExeName() const { return _exe_name; }
+	const char *getGameDataPath() const { return _gameDataPath; }
+
+	// Cursor/palette
 	void updateCursor();
 	void animateCursor();
 	void updatePalette();
 
 	/* _insane vars */
-
 	int _smushFrameRate;
 	bool _insaneState;
 	bool _videoFinished;
 	
-	const char *getExeName() const { return _exe_name; }
-	const char *getGameDataPath() const { return _gameDataPath; }
-
 	void pauseGame(bool user);
 	void shutDown(int i);
 	void setOptions(void);
@@ -324,18 +334,8 @@
 	void optionsDialog();
 	char displayError(bool showCancel, const char *message, ...);
 
-	// Misc startup/event functions
-	void main();
-	void parseCommandLine(int argc, char **argv);
-	void showHelpAndExit();
-	bool detectGame();
-	void processKbd();
-
-	int checkKeyHit();
-	void convertKeysToClicks();
-
 protected:
-	int keyScriptKey, keyScriptNo;
+	byte _fastMode;
 
 	/* Random number generation */
 	RandomSource _rnd;
@@ -392,12 +392,9 @@
 	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);
 	void startScene(int room, Actor *a, int b);
-	virtual void setupScummVars();
 	byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable;
 	ObjectIDMap _objectIDMap;
 	byte _numObjectsInRoom;
@@ -408,8 +405,8 @@
 
 	/* GUI class */
 	void drawString(int a);
-	int getKeyInput(int a);
 
+protected:
 	/* Save/Load class - some of this may be GUI */
 	byte _saveLoadFlag, _saveLoadSlot;
 	uint32 _lastSaveTime;
@@ -434,23 +431,25 @@
 	}
 	void saveOrLoad(Serializer *s, uint32 savegameVersion);
 
+public:
 	bool getSavegameName(int slot, char *desc, SaveFileManager *mgr);
 	void makeSavegameName(char *out, int slot, bool compatible);
 	void saveLoadResource(Serializer *ser, int type, int index);
 	void listSavegames(bool *marks, int num, SaveFileManager *mgr);
+	
+	void requestSave(int slot, const char *name);
+	void requestLoad(int slot);
 
+protected:
 	/* Heap and memory management */
 	uint32 _maxHeapThreshold, _minHeapThreshold;
-	void checkRange(int max, int min, int no, const char *str);
 	void lock(int type, int i);
 	void unlock(int type, int i);
 	void heapClear(int mode);
 	void unkHeapProc2(int a, int b);
 
 
-protected:
 	/* Script VM - should be in Script class */
-
 	uint32 _localScriptList[NUM_LOCALSCRIPT];
 	byte *_scriptPointer, *_scriptOrgPointer;
 	byte _opcode, _numNestedScripts, _currentScript;
@@ -458,6 +457,7 @@
 	byte **_lastCodePtr;
 	int _resultVarNumber, _scummStackPos;
 	int _localParamList[16],  _scummStack[150];
+	int _keyScriptKey, _keyScriptNo;
 	
 	virtual void setupOpcodes() = 0;
 	virtual void executeOpcode(int i) = 0;
@@ -634,10 +634,6 @@
 	byte *getOBCDFromObject(int obj);	
 	int getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f);
 
-	/* Should be in Costume class */
-	void cost_decodeData(Actor *a, int frame, uint usemask);
-	int cost_frameToAnim(Actor *a, int frame);
-
 
 protected:
 	/* Should be in Verb class */
@@ -683,20 +679,21 @@
 	SentenceTab _sentence[6];
 	StringTab _string[6];
 	void actorTalk();
-	void stopTalk();	
-
-	/* Akos Class */
+	void stopTalk();
+	
+	// Costume class
+	void cost_decodeData(Actor *a, int frame, uint usemask);
+	int cost_frameToAnim(Actor *a, int frame);
 
+	// Akos Class
 	bool akos_increaseAnims(byte *akos, Actor *a);
 	bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo);
-
 	void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2);
 	bool akos_compare(int a, int b, byte cmd);
 	void akos_decodeData(Actor *a, int frame, uint usemask);
 	int akos_frameToAnim(Actor *a, int frame);
 	bool akos_hasManyDirections(Actor *a);
 
-
 	/* Should be in Graphics class? */
 	uint16 _screenB, _screenH;
 	int _scrHeight, _scrWidth, _realHeight, _realWidth;
@@ -795,6 +792,8 @@
 
 	VirtScreen *findVirtScreen(int y);
 	void setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom);
+
+	byte isMaskActiveAt(int l, int t, int r, int b, byte *mem);
 
 	void drawFlashlight();
 	

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.48
retrieving revision 2.49
diff -u -d -r2.48 -r2.49
--- scummvm.cpp	29 Jan 2003 08:07:10 -0000	2.48
+++ scummvm.cpp	8 Feb 2003 01:27:21 -0000	2.49
@@ -1118,7 +1118,7 @@
 void Scumm::processKbd()
 {
 	int saveloadkey;
-	getKeyInput(0);
+	getKeyInput();
 
 	if (_features & GF_OLD256) /* FIXME: Support ingame screen */
 		saveloadkey = 319;
@@ -1153,8 +1153,8 @@
 	if (!_lastKeyHit)
 		return;
 
-	if (keyScriptNo && (keyScriptKey == _lastKeyHit)) {
-		runScript(keyScriptNo, 0, 0, 0);
+	if (_keyScriptNo && (_keyScriptKey == _lastKeyHit)) {
+		runScript(_keyScriptNo, 0, 0, 0);
 		return;
 	}
 
@@ -1228,13 +1228,12 @@
 	_mouseButStat = _lastKeyHit;
 }
 
-int Scumm::getKeyInput(int a)
+int Scumm::getKeyInput()
 {
 	_mouseButStat = 0;
 
 	_lastKeyHit = checkKeyHit();
-	if (a == 0)
-		convertKeysToClicks();
+	convertKeysToClicks();
 
 	if (mouse.x < 0)
 		mouse.x = 0;





More information about the Scummvm-git-logs mailing list