[Scummvm-cvs-logs] CVS: scummvm/bs2 console.cpp,1.11,1.12 controls.cpp,1.19,1.20 debug.cpp,1.10,1.11 events.cpp,1.6,1.7 function.cpp,1.18,1.19 logic.cpp,1.15,1.16 logic.h,1.3,1.4 save_rest.cpp,1.19,1.20 speech.cpp,1.23,1.24 sword2.cpp,1.42,1.43

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Mon Sep 29 23:42:01 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv14249

Modified Files:
	console.cpp controls.cpp debug.cpp events.cpp function.cpp 
	logic.cpp logic.h save_rest.cpp speech.cpp sword2.cpp 
Log Message:
Changed the "logic" object to use ScummVM naming conventions.


Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- console.cpp	27 Sep 2003 11:02:56 -0000	1.11
+++ console.cpp	30 Sep 2003 06:40:01 -0000	1.12
@@ -499,7 +499,7 @@
 					Print_current_info();
 					return 0;
 				case 15:	// RUNLIST
-					LLogic.Examine_run_list();
+					LLogic.examineRunList();
 					return 0;
 				case 16:	// KILL
 					res_man.Kill_res(&input[1][0]);

Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- controls.cpp	27 Sep 2003 16:05:40 -0000	1.19
+++ controls.cpp	30 Sep 2003 06:40:01 -0000	1.20
@@ -1305,7 +1305,7 @@
 				// FN_register_mouse and FN_register_frame)
 				Reset_mouse_list();
 
-				if (LLogic.Process_session())
+				if (LLogic.processSession())
 					Con_fatal_error("restore 1st cycle failed??");
 			}
 		}
@@ -1399,11 +1399,11 @@
 
 	this_screen.scroll_flag = 2;
 
-	if (LLogic.Process_session())
+	if (LLogic.processSession())
 		Con_fatal_error("restart 1st cycle failed??");
 
-	// (JEL08oct97) so palette not restored immediately after control
-	// panel - we want to fade up instead!
+	// So palette not restored immediately after control panel - we want
+	// to fade up instead!
  	this_screen.new_palette = 99;
 }
 

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/debug.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- debug.cpp	27 Sep 2003 11:02:56 -0000	1.10
+++ debug.cpp	30 Sep 2003 06:40:01 -0000	1.11
@@ -415,7 +415,7 @@
 		Print_to_console(" %d normal layers",
 			this_screen.number_of_layers);
 
-		LLogic.Examine_run_list();
+		LLogic.examineRunList();
 	} else
 		Print_to_console(" no screen");
 

Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/events.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- events.cpp	27 Sep 2003 11:02:56 -0000	1.6
+++ events.cpp	30 Sep 2003 06:40:01 -0000	1.7
@@ -214,7 +214,7 @@
 		if (event_list[j].id == ID) {
 			// start the event
 			// run 3rd script of target object on level 1
-			LLogic.Logic_one(event_list[j].interact_id);
+			LLogic.logicOne(event_list[j].interact_id);
 			// clear the event slot
 			event_list[j].id = 0;
 			return IR_TERMINATE;
@@ -245,7 +245,7 @@
 
 			// start the event
 			// run 3rd script of target object on level 1
-			LLogic.Logic_one(event_list[j].interact_id);
+			LLogic.logicOne(event_list[j].interact_id);
 
 			// clear the event slot
 			event_list[j].id = 0;
@@ -311,7 +311,7 @@
 	for (int j = 0; j < MAX_events; j++) {
 		if (event_list[j].id == ID) {
 			// run 3rd script of target object on level 1
-			LLogic.Logic_one( event_list[j].interact_id);
+			LLogic.logicOne(event_list[j].interact_id);
 
 			//clear the slot
 			event_list[j].id = 0;
@@ -327,7 +327,7 @@
 	for (int j = 0; j < MAX_events; j++)
 		if (event_list[j].id == ID) {
 			// run 3rd script of target object on level 1
-			LLogic.Logic_one(event_list[j].interact_id);
+			LLogic.logicOne(event_list[j].interact_id);
 
 			// clear the slot
 			event_list[j].id = 0;

Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/function.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- function.cpp	29 Sep 2003 06:48:48 -0000	1.18
+++ function.cpp	30 Sep 2003 06:40:01 -0000	1.19
@@ -54,7 +54,7 @@
 	// hurray, script subroutines
 	// param	0 id of script
 
-	LLogic.Logic_up(params[0]);
+	LLogic.logicUp(params[0]);
 
 	// logic goes up - pc is saved for current level
 	return IR_GOSUB;
@@ -70,7 +70,7 @@
 	// must clear this
 	PLAYER_ACTION = 0;
 
-	LLogic.Logic_replace(params[0]);
+	LLogic.logicReplace(params[0]);
 
 	//drop out no pc save - and around again
 	return IR_TERMINATE;
@@ -88,7 +88,7 @@
 	PLAYER_ACTION = 0;
 
 	// 3rd script of clicked on id
-	LLogic.Logic_up((params[0] * 65536) + 2);
+	LLogic.logicUp((params[0] * 65536) + 2);
 
 	// out, up and around again - pc is saved for current level to be
 	// returned to

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/logic.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- logic.cpp	27 Sep 2003 11:02:56 -0000	1.15
+++ logic.cpp	30 Sep 2003 06:40:01 -0000	1.16
@@ -23,13 +23,13 @@
 #include "debug.h"
 #include "interpreter.h"
 #include "logic.h"
-#include "router.h"	// for ClearWalkGridList()
+#include "router.h"		// for ClearWalkGridList()
 #include "sound.h"
 #include "sync.h"
 
 logic LLogic;
 
-#define LEVEL			(cur_object_hub->logic_level)
+#define LEVEL (_curObjectHub->logic_level)
 
 // this must allow for the largest number of objects in a screen
 #define OBJECT_KILL_LIST_SIZE	50
@@ -39,7 +39,7 @@
 // keeps note of no. of objects in the kill list
 uint32 kills = 0;
 
-int logic::Process_session(void) {
+int logic::processSession(void) {
 	// do one cycle of the current session
 
 	uint32 run_list;
@@ -53,15 +53,15 @@
 	uint32 id;
 
 	// might change during the session, so take a copy here
-	run_list = current_run_list;
+	run_list = _currentRunList;
 
 	// point to first object in list
-	pc = 0;
+	_pc = 0;
 
 	// by minusing the pc we can cause an immediate cessation of logic
 	// processing on the current list
 
-	while (pc != 0xffffffff) {
+	while (_pc != 0xffffffff) {
 		head = (_standardHeader*) res_man.Res_open(run_list);
 
 		if (head->fileType != RUN_LIST)
@@ -70,7 +70,7 @@
 		game_object_list = (uint32 *) (head + 1);
 
 		// read the next id
-		ID = game_object_list[pc++];
+		ID = game_object_list[_pc++];
 		id = ID;
 
 		// release the list again so it can float in memory - at this
@@ -91,12 +91,12 @@
 		if (head->fileType != GAME_OBJECT)
 			Con_fatal_error("Logic_engine %d not an object", ID);
 
-		cur_object_hub = (_object_hub *) (head + 1);
+		_curObjectHub = (_object_hub *) (head + 1);
 
 		debug(5, " %d id(%d) pc(%d)",
-			cur_object_hub->logic_level,
-			cur_object_hub->script_id[cur_object_hub->logic_level],
-			cur_object_hub->script_pc[cur_object_hub->logic_level]);
+			LEVEL,
+			_curObjectHub->script_id[LEVEL],
+			_curObjectHub->script_pc[LEVEL]);
 
 		// do the logic for this object
 		// we keep going until a function says to stop - remember,
@@ -106,7 +106,7 @@
 			// get the script id as we may be running a script
 			// from another object...
 
-			script = cur_object_hub->script_id[LEVEL];
+			script = _curObjectHub->script_id[LEVEL];
 
 			// there is a distinction between running one of our
 			// own scripts and that of another object
@@ -115,15 +115,15 @@
 
 				debug(5, "run script %d pc%d",
 					script / SIZE,
-					cur_object_hub->script_pc[LEVEL]);
+					_curObjectHub->script_pc[LEVEL]);
 
 				// this is the script data
-				// raw_script_ad = (char *) (cur_object_hub + 1);
+				// raw_script_ad = (char *) (_curObjectHub + 1);
 
 				raw_script_ad = (char*) head;
 
 				// script and data object are us/same
-				ret = RunScript(raw_script_ad, raw_script_ad, &cur_object_hub->script_pc[LEVEL]);
+				ret = RunScript(raw_script_ad, raw_script_ad, &_curObjectHub->script_pc[LEVEL]);
 			} else {
 				// we're running the script of another game
 				// object - get our data object address
@@ -140,11 +140,11 @@
 				// raw_script_ad = (char*) (head + 1) + sizeof(_standardHeader);
 
 				// get our objects data address
-				// raw_data_ad = (char*) (cur_object_hub + 1);
+				// raw_data_ad = (char*) (_curObjectHub + 1);
 
 				raw_script_ad = (char*) far_head;
 
-				ret = RunScript(raw_script_ad, raw_data_ad, &cur_object_hub->script_pc[LEVEL]);
+				ret = RunScript(raw_script_ad, raw_data_ad, &_curObjectHub->script_pc[LEVEL]);
 
 				// close foreign object again
 				res_man.Res_close(script / SIZE);
@@ -157,8 +157,8 @@
 
 			if (ret == 1) {
 				// check that it's not already on level 0 !
-				if (cur_object_hub->logic_level)
-					cur_object_hub->logic_level--;
+				if (LEVEL)
+					LEVEL--;
 				else {
 					// Hmmm, level 0 terminated :-| Let's
 					// be different this time and simply
@@ -167,13 +167,13 @@
 					debug(5, "**WARNING object %d script 0 terminated!", id);
 
 					// reset to rerun
-					cur_object_hub->script_pc[LEVEL] = cur_object_hub->script_id[LEVEL] & 0xffff;
+					_curObjectHub->script_pc[LEVEL] = _curObjectHub->script_id[LEVEL] & 0xffff;
 
 					// cause us to drop out for a cycle
 					ret = 0;
 				}
 			} else if (ret > 2) {
-				Con_fatal_error("Process_session: illegal script return type %d", ret);
+				Con_fatal_error("processSession: illegal script return type %d", ret);
 			}
 
 			// if ret == 2 then we simply go around again - a new
@@ -189,7 +189,7 @@
 
 		Clear_syncs(ID);
 
-		if (pc != 0xffffffff) {
+		if (_pc != 0xffffffff) {
 			// the session is still valid so run the service script
 			null_pc = 0;
 
@@ -207,7 +207,7 @@
 	}
 
 	// leaving a room so remove all ids that must reboot correctly
-	Process_kill_list();
+	processKillList();
 
 	debug(5, "RESTART the loop");
 
@@ -215,15 +215,15 @@
 	return 1;
 }
 
-void logic::Express_change_session(uint32 sesh_id) {
+void logic::expressChangeSession(uint32 sesh_id) {
 	// a game-object can bring an immediate halt to the session and cause
 	// a new one to start without a screen update
 
 	//set to new
-	current_run_list = sesh_id;
+	_currentRunList = sesh_id;
 
 	//causes session to quit
-	pc = 0xffffffff;
+	_pc = 0xffffffff;
 
 	// reset now in case we double-clicked an exit prior to changing screen
 	EXIT_FADING = 0;
@@ -244,29 +244,25 @@
 	FreeAllRouteMem();
 }
 
-void logic::Natural_change_session(uint32 sesh_id) {
-	// a new session will begin next game cycle.
-	// the current cycle will conclude and build the screen and flip
-	// into view as normal
+void logic::naturalChangeSession(uint32 sesh_id) {
+	// FIXME: This function doesn't seem to be used anywhere
 
-	//set to new
-	current_run_list = sesh_id;
-}
+	// A new session will begin next game cycle. The current cycle will
+	// conclude and build the screen and flip into view as normal
 
-uint32 logic::Return_run_list(void) {
-	// pass back the private cur_object_list variable - not sure we need
-	// this
+	_currentRunList = sesh_id;
+}
 
-	//return the id
-	return current_run_list;
+uint32 logic::getRunList(void) {
+	// pass back the private _currentRunList variable
+	return _currentRunList;
 }
 
 int32 FN_set_session(int32 *params) {
 	// used by player invoked start scripts
 	// param	0 id of new run list
 
-	//now!
-	LLogic.Express_change_session(*params);
+	LLogic.expressChangeSession(params[0]);
 	return IR_CONT;
 }
 
@@ -278,63 +274,63 @@
 	// param	0 id of new run-list
 
 	// terminate current and change to next run-list
-	LLogic.Express_change_session(*params);
+	LLogic.expressChangeSession(params[0]);
 
 	// stop the script - logic engine will now go around and the new
 	// screen will begin
 	return IR_STOP;
 }
 
-void logic::Logic_up(uint32 new_script)	{
+void logic::logicUp(uint32 new_script) {
 	// move the current object up a level
 	// called by FN_gosub command - remember, only the logic object has
-	// access to cur_object_hub
+	// access to _curObjectHub
 
 	// going up a level - and we'll keeping going this cycle
-	cur_object_hub->logic_level++;
+	LEVEL++;
 
 	// can be 0, 1, 2
-	if (cur_object_hub->logic_level == 3)
-		Con_fatal_error("Logic_up id %d has run off script tree! :-O", ID);
+	if (LEVEL == 3)
+		Con_fatal_error("logicUp id %d has run off script tree! :-O", ID);
 
 	// setup new script on next level (not the current level)
 
 	debug(5, "new pc = %d", new_script & 0xffff);
 
-	cur_object_hub->script_id[cur_object_hub->logic_level] = new_script;
-	cur_object_hub->script_pc[cur_object_hub->logic_level] = new_script & 0xffff;
+	_curObjectHub->script_id[LEVEL] = new_script;
+	_curObjectHub->script_pc[LEVEL] = new_script & 0xffff;
 }
 
-void logic::Logic_one(uint32 new_script) {
+void logic::logicOne(uint32 new_script) {
 	// force to level one
 
-	cur_object_hub->logic_level = 1;
+	LEVEL = 1;
 
 	// setup new script on level 1
-	cur_object_hub->script_id[1] = new_script;
-	cur_object_hub->script_pc[1] = new_script & 0xffff;
+	_curObjectHub->script_id[1] = new_script;
+	_curObjectHub->script_pc[1] = new_script & 0xffff;
 }
 
-void logic::Logic_replace(uint32 new_script) {
+void logic::logicReplace(uint32 new_script) {
 	// change current logic - script must quit with a TERMINATE directive
 	// - which does not write to &pc
 
 	// setup new script on this level
-	cur_object_hub->script_id[cur_object_hub->logic_level] = new_script;
-	cur_object_hub->script_pc[cur_object_hub->logic_level] = new_script & 0xffff;
+	_curObjectHub->script_id[LEVEL] = new_script;
+	_curObjectHub->script_pc[LEVEL] = new_script & 0xffff;
 }
 
-uint32 logic::Examine_run_list(void) {
+uint32 logic::examineRunList(void) {
 	uint32 *game_object_list;
 	_standardHeader *file_header;
 	int scrolls = 0;
 	_keyboardEvent ke;
 
-	if (current_run_list) {
+	if (_currentRunList) {
 		// open and lock in place
-		game_object_list = (uint32 *) (res_man.Res_open(current_run_list) + sizeof(_standardHeader));
+		game_object_list = (uint32 *) (res_man.Res_open(_currentRunList) + sizeof(_standardHeader));
 
-		Print_to_console("runlist number %d", current_run_list);
+		Print_to_console("runlist number %d", _currentRunList);
 
 		while(*(game_object_list)) {
 			file_header = (_standardHeader*) res_man.Res_open(*(game_object_list));
@@ -365,7 +361,7 @@
 			}
 		}
 
-		res_man.Res_close(current_run_list);
+		res_man.Res_close(_currentRunList);
 	} else
 		Print_to_console("no run list set");
 
@@ -373,21 +369,21 @@
 	return 1;
 }
 
-void logic::Total_restart(void) {
+void logic::totalRestart(void) {
 	// reset the object restart script 1 on level 0
 
-	cur_object_hub->logic_level = 0;
-	// cur_object_hub->script_id[0] = 1;
+	LEVEL = 0;
+	// _curObjectHub->script_id[0] = 1;
 
 	// reset to rerun
-	cur_object_hub->script_pc[0] = 1;
+	_curObjectHub->script_pc[0] = 1;
 }
 
 int32 FN_total_restart(int32 *params) {
 	// mega runs this to restart its base logic again - like being cached
 	// in again
 
-	LLogic.Total_restart();
+	LLogic.totalRestart();
 
 	// drop out without saving pc and go around again
 	return IR_TERMINATE;
@@ -409,14 +405,13 @@
 	// DON'T EVER KILL GEORGE!
 	if (ID != 8) {
 		// first, scan list to see if this object is already included
-		// (05mar97 James)
 
 		entry = 0;
 		while (entry < kills && object_kill_list[entry] != ID)
 			entry++;
 
 		// if this ID isn't already in the list, then add it,
-		// (otherwise finish) (05mar97 James)
+		// (otherwise finish)
 
 		if (entry == kills) {
 #ifdef _SWORD2_DEBUG
@@ -443,13 +438,13 @@
 	return IR_CONT;
 }
 
-void logic::Process_kill_list(void) {
+void logic::processKillList(void) {
 	for (uint32 j = 0; j < kills; j++)
 		res_man.Remove_res(object_kill_list[j]);
 
 	kills = 0;
 }
 
-void logic::Reset_kill_list(void) {
+void logic::resetKillList(void) {
 	kills = 0;
 }

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/logic.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- logic.h	26 Sep 2003 10:07:18 -0000	1.3
+++ logic.h	30 Sep 2003 06:40:01 -0000	1.4
@@ -30,37 +30,37 @@
 class logic {
 public:
 	//do one cycle of the current session
-	int Process_session(void);
+	int processSession(void);
 
 	// cause the logic loop to terminate and drop out
-	void Express_change_session(uint32 sesh_id);
+	void expressChangeSession(uint32 sesh_id);
 
 	// new logic begins next cycle
-	void Natural_change_session(uint32 sesh_id);
+	void naturalChangeSession(uint32 sesh_id);
 
-	uint32 Return_run_list(void);
+	uint32 getRunList(void);
 
-	// setup script_id and script_pc in cur_object_hub - called by
+	// setup script_id and script_pc in _curObjectHub - called by
 	// FN_gosub()
-	void Logic_up(uint32 new_script);
+	void logicUp(uint32 new_script);
 
-	void Logic_replace(uint32 new_script);
-	void Logic_one(uint32 new_script);
-	void Total_restart(void);
-	uint32 Examine_run_list(void);
-	void Reset_kill_list(void);
+	void logicReplace(uint32 new_script);
+	void logicOne(uint32 new_script);
+	void totalRestart(void);
+	uint32 examineRunList(void);
+	void resetKillList(void);
 
 private:
 	// denotes the res id of the game-object-list in current use
-  	uint32 current_run_list;
+	uint32 _currentRunList;
 
-	void Process_kill_list(void);
+	void processKillList(void);
 
 	//pc during logic loop
-	uint32 pc;
+	uint32 _pc;
 
 	// each object has one of these tacked onto the beginning
-	_object_hub *cur_object_hub;
+	_object_hub *_curObjectHub;
 };
 
 extern logic LLogic;

Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/save_rest.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- save_rest.cpp	27 Sep 2003 11:02:57 -0000	1.19
+++ save_rest.cpp	30 Sep 2003 06:40:01 -0000	1.20
@@ -183,7 +183,7 @@
 	g_header.screenId = this_screen.background_layer_id;
 
 	// resource id of current run-list
-	g_header.runListId = LLogic.Return_run_list();
+	g_header.runListId = LLogic.getRunList();
 
 	// those scroll position control things
 	g_header.feet_x = this_screen.feet_x;
@@ -382,7 +382,7 @@
 	res_man.Kill_all_res(0);
 
 	// clean out the system kill list (no more objects to kill)
-	LLogic.Reset_kill_list();
+	LLogic.resetKillList();
 	
 	// get player character data from savegame buffer
 
@@ -432,9 +432,8 @@
 	this_screen.feet_y = g_header.feet_y;
 
 	// start the new run list
-	LLogic.Express_change_session(g_header.runListId);
+	LLogic.expressChangeSession(g_header.runListId);
 
-	// (James01aug97)
 	// Force in the new scroll position, so unsightly scroll-catch-up does
 	// not occur when screen first draws after returning from restore panel
 

Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/speech.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- speech.cpp	27 Sep 2003 11:02:57 -0000	1.23
+++ speech.cpp	30 Sep 2003 06:40:01 -0000	1.24
@@ -346,10 +346,10 @@
 		debug(5, "   holding");
 	}
 
-	TALK_FLAG = 0;	//in-case DC forgets
+	TALK_FLAG = 0;	// in-case DC forgets
 
 	// restart george's base script
-	//	LLogic.Total_restart();
+	// LLogic.totalRestart();
 
 	//drop out without saving pc and go around again
 	return IR_CONT;

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- sword2.cpp	28 Sep 2003 14:13:57 -0000	1.42
+++ sword2.cpp	30 Sep 2003 06:40:01 -0000	1.43
@@ -213,7 +213,7 @@
 	// do one game cycle
 
 	//got a screen to run?
-	if (LLogic.Return_run_list()) {
+	if (LLogic.getRunList()) {
 		//run the logic session UNTIL a full loop has been performed
 		do {
 			// reset the graphic 'buildit' list before a new
@@ -226,7 +226,7 @@
 
 			// keep going as long as new lists keep getting put in
 			// - i.e. screen changes
-		} while (LLogic.Process_session());
+		} while (LLogic.processSession());
 	} else {
 		// start the console and print the start options perhaps?
 		StartConsole();





More information about the Scummvm-git-logs mailing list