[Scummvm-cvs-logs] SF.net SVN: scummvm:[46635] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Dec 27 13:54:03 CET 2009


Revision: 46635
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46635&view=rev
Author:   thebluegr
Date:     2009-12-27 12:54:03 +0000 (Sun, 27 Dec 2009)

Log Message:
-----------
Renamed gameName -> gameId, to keep the same vocabulary everywhere

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmovement.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/engine/vm.h
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
    scummvm/trunk/engines/sci/gui/gui_windowmgr.h
    scummvm/trunk/engines/sci/gui32/gui32.cpp

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/detection.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -314,9 +314,9 @@
 		return 0;
 	}
 	reg_t game_obj = segMan->lookupScriptExport(0, 0);
-	const char *gameName = segMan->getObjectName(game_obj);
-	debug(2, "Detected ID: \"%s\" at %04x:%04x", gameName, PRINT_REG(game_obj));
-	s_fallbackDesc.gameid = convertSierraGameId(gameName, &s_fallbackDesc.flags);
+	const char *gameId = segMan->getObjectName(game_obj);
+	debug(2, "Detected ID: \"%s\" at %04x:%04x", gameId, PRINT_REG(game_obj));
+	s_fallbackDesc.gameid = convertSierraGameId(gameId, &s_fallbackDesc.flags);
 	delete segMan;
 
 	// Try to determine the game language

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -95,9 +95,9 @@
 	{ "", "", false, "" }
 };
 
-const char *convertSierraGameId(const char *gameName, uint32 *gameFlags) {
+const char *convertSierraGameId(const char *gameId, uint32 *gameFlags) {
 	// Convert the id to lower case, so that we match all upper/lower case variants.
-	Common::String sierraId = gameName;
+	Common::String sierraId = gameId;
 	sierraId.toLowercase();
 
 	// TODO: SCI32 IDs
@@ -412,9 +412,9 @@
 	// The first entry in the export table of script 0 points to the game object
 	s->_gameObj = s->_segMan->lookupScriptExport(0, 0);
 	uint32 gameFlags = 0;	// unused
-	s->_gameName = convertSierraGameId(s->_segMan->getObjectName(s->_gameObj), &gameFlags);
+	s->_gameId = convertSierraGameId(s->_segMan->getObjectName(s->_gameObj), &gameFlags);
 
-	debug(2, " \"%s\" at %04x:%04x", s->_gameName.c_str(), PRINT_REG(s->_gameObj));
+	debug(2, " \"%s\" at %04x:%04x", s->_gameId.c_str(), PRINT_REG(s->_gameObj));
 
 #ifdef INCLUDE_OLDGFX
 	s->_menubar = new Menubar(); // Create menu bar

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -378,11 +378,11 @@
 	{NULL, NULL, NULL} // Terminator
 };
 
-Kernel::Kernel(ResourceManager *resMan, Common::String gameName) : _resMan(resMan) {
+Kernel::Kernel(ResourceManager *resMan, Common::String gameId) : _resMan(resMan) {
 	loadSelectorNames();
 	mapSelectors();      // Map a few special selectors for later use
 
-	loadKernelNames(gameName);
+	loadKernelNames(gameId);
 	mapFunctions();      // Map the kernel functions
 }
 
@@ -714,7 +714,7 @@
 	}
 }
 
-void Kernel::setDefaultKernelNames(Common::String gameName) {
+void Kernel::setDefaultKernelNames(Common::String gameId) {
 	_kernelNames = Common::StringList(sci_default_knames, SCI_KNAMES_DEFAULT_ENTRIES_NR);
 
 	// Some (later) SCI versions replaced CanBeHere by CantBeHere
@@ -748,7 +748,7 @@
 	case SCI_VERSION_1_1:
 		// In SCI1.1, this kernel function is empty, apart from KQ6CD,
 		// where it has been replaced with kPortrait
-		if (gameName == "kq6")
+		if (gameId == "kq6")
 			_kernelNames[0x26] = "Portrait";
 		else
 			_kernelNames[0x26] = "Dummy";
@@ -762,7 +762,7 @@
 	}
 }
 
-bool Kernel::loadKernelNames(Common::String gameName) {
+bool Kernel::loadKernelNames(Common::String gameId) {
 	_kernelNames.clear();
 	
 #ifdef ENABLE_SCI32
@@ -772,7 +772,7 @@
 		setKernelNamesSci2();
 	else
 #endif
-		setDefaultKernelNames(gameName);
+		setDefaultKernelNames(gameId);
 	return true;
 }
 

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-12-27 12:54:03 UTC (rev 46635)
@@ -61,7 +61,7 @@
 	/**
 	 * Initializes the SCI kernel
 	 */
-	Kernel(ResourceManager *resMan, Common::String gameName);
+	Kernel(ResourceManager *resMan, Common::String gameId);
 	~Kernel();
 
 	uint getSelectorNamesSize() const;
@@ -95,12 +95,12 @@
 	 * name table of the resource (the format changed between version 0 and 1).
 	 * @return true on success, false on failure
 	 */
-	bool loadKernelNames(Common::String gameName);
+	bool loadKernelNames(Common::String gameId);
 
 	/**
 	 * Sets the default kernel function names, based on the SCI version used
 	 */
-	void setDefaultKernelNames(Common::String gameName);
+	void setDefaultKernelNames(Common::String gameId);
 	
 #ifdef ENABLE_SCI32
 	/**

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -507,7 +507,7 @@
 
 	// WORKAROUND for a problem in LSL1VGA. This allows the casino door to be opened,
 	// till the actual problem is found
-	if (s->_gameName == "lsl1sci" && s->currentRoomNumber() == 300) {
+	if (s->_gameId == "lsl1sci" && s->currentRoomNumber() == 300) {
 		int top = GET_SEL32V(s->_segMan, object, brTop);
 		PUT_SEL32V(s->_segMan, object, brTop, top + 2);
 	}

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -332,7 +332,7 @@
 	}
 
 	// FIXME: find out why iceman needs this and we ask for version > SCI01
-	if ((getSciVersion() > SCI_VERSION_01) || (s->_gameName == "iceman"))
+	if ((getSciVersion() > SCI_VERSION_01) || (s->_gameId == "iceman"))
 		if (completed)
 			invoke_selector(INV_SEL(mover, moveDone, kStopOnInvalidSelector), 0);
 

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -1297,7 +1297,7 @@
 
 	// WORKAROUND: broken polygon in lsl1sci, room 350, after opening elevator
 	// Polygon has 17 points but size is set to 19
-	if ((size == 19) && (s->_gameName == "lsl1sci")) {
+	if ((size == 19) && (s->_gameId == "lsl1sci")) {
 		if ((s->currentRoomNumber() == 350)
 		&& (read_point(segMan, points, 18) == Common::Point(108, 137))) {
 			debug(1, "Applying fix for broken polygon in lsl1sci, room 350");
@@ -1307,21 +1307,21 @@
 
 #ifdef OLD_PATHFINDING
 	// WORKAROUND: self-intersecting polygons in ECO, rooms 221, 280 and 300
-	if ((size == 11) && (s->_gameName == "ecoquest")) {
+	if ((size == 11) && (s->_gameId == "ecoquest")) {
 		if ((s->currentRoomNumber() == 300)
 		&& (read_point(segMan, points, 10) == Common::Point(221, 0))) {
 			debug(1, "Applying fix for self-intersecting polygon in ECO, room 300");
 			size = 10;
 		}
 	}
-	if ((size == 12) && (s->_gameName == "ecoquest")) {
+	if ((size == 12) && (s->_gameId == "ecoquest")) {
 		if ((s->currentRoomNumber() == 280)
 		&& (read_point(segMan, points, 11) == Common::Point(238, 189))) {
 			debug(1, "Applying fix for self-intersecting polygon in ECO, room 280");
 			size = 10;
 		}
 	}
-	if ((size == 16) && (s->_gameName == "ecoquest")) {
+	if ((size == 16) && (s->_gameId == "ecoquest")) {
 		if ((s->currentRoomNumber() == 221)
 		&& (read_point(segMan, points, 1) == Common::Point(419, 175))) {
 			debug(1, "Applying fix for self-intersecting polygon in ECO, room 221");
@@ -1335,7 +1335,7 @@
 
 	for (i = skip; i < size; i++) {
 #ifdef OLD_PATHFINDING
-		if (size == 35 && (i == 20 || i == 21) && s->_gameName == "sq1sci" &&
+		if (size == 35 && (i == 20 || i == 21) && s->_gameId == "sq1sci" &&
 			s->currentRoomNumber() == 66) {
 			if (i == 20 && read_point(segMan, points, 20) == Common::Point(0, 104)) {
 				debug(1, "Applying fix for self-intersecting polygon in SQ1, room 66");
@@ -1527,14 +1527,14 @@
 
 		// WORKAROUND LSL5 room 660. Priority glitch due to us choosing a different path
 		// than SSCI. Happens when Patti walks to the control room.
-		if ((s->_gameName == "lsl5") && (s->currentRoomNumber() == 660) && (Common::Point(67, 131) == *new_start) && (Common::Point(229, 101) == *new_end)) {
+		if ((s->_gameId == "lsl5") && (s->currentRoomNumber() == 660) && (Common::Point(67, 131) == *new_start) && (Common::Point(229, 101) == *new_end)) {
 			debug(1, "[avoidpath] Applying fix for priority problem in LSL5, room 660");
 			pf_s->_prependPoint = new_start;
 			new_start = new Common::Point(77, 107);
 		}
 
 #ifdef OLD_PATHFINDING
-		if (s->_gameName == "longbow" && s->currentRoomNumber() == 210)
+		if (s->_gameId == "longbow" && s->currentRoomNumber() == 210)
 				fixLongbowRoom210(pf_s, *new_start, *new_end);
 #endif
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -944,7 +944,7 @@
 #ifdef INCLUDE_OLDGFX
 	retval->pic_priority_table = (int *)(retval->gfx_state->pic) ? retval->gfx_state->pic->priorityTable : NULL;
 #endif
-	retval->_gameName = s->_gameName;
+	retval->_gameId = s->_gameId;
 
 #ifdef USE_OLD_MUSIC_FUNCTIONS
 	retval->_sound._it = NULL;

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/state.h	2009-12-27 12:54:03 UTC (rev 46635)
@@ -140,7 +140,7 @@
 	Kernel *_kernel;
 	Vocabulary *_voc;
 
-	Common::String _gameName; /**< Designation of the primary object (which inherits from Game) */
+	Common::String _gameId; /**< Designation of the primary object (which inherits from Game) */
 
 	/* Non-VM information */
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -1843,7 +1843,7 @@
 int game_run(EngineState **_s) {
 	EngineState *s = *_s;
 
-	debugC(2, kDebugLevelVM, "Calling %s::play()\n", s->_gameName.c_str());
+	debugC(2, kDebugLevelVM, "Calling %s::play()\n", s->_gameId.c_str());
 	_init_stack_base_with_selector(s, s->_kernel->_selectorCache.play); // Call the play selector
 
 	// Now: Register the first element on the execution stack-

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/engine/vm.h	2009-12-27 12:54:03 UTC (rev 46635)
@@ -461,11 +461,11 @@
 
 /**
  * Converts the builtin Sierra game IDs to the ones we use in ScummVM
- * @param[in] gameName		The internal game name
+ * @param[in] gameId		The internal game ID
  * @param[in] gameFlags     The game's flags, which are adjusted accordingly for demos
  * @return					The equivalent ScummVM game id
  */
-const char *convertSierraGameId(const char *gameName, uint32 *gameFlags);
+const char *convertSierraGameId(const char *gameId, uint32 *gameFlags);
 
 /**
  * Initializes an SCI game

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -89,7 +89,7 @@
 	_usesOldGfxFunctions = usesOldGfxFunctions;
 
 	_gfx->init(_text);
-	_windowMgr->init(_s->_gameName);
+	_windowMgr->init(_s->_gameId);
 	_menu->init(_s->gfx_state);
 	initPriorityBands();
 }

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -52,7 +52,7 @@
 	// TODO: Clear _windowList and delete all stuff in it?
 }
 
-void SciGuiWindowMgr::init(Common::String gameName) {
+void SciGuiWindowMgr::init(Common::String gameId) {
 	int16 offTop = 10;
 
 	_wmgrPort = new GuiPort(0);
@@ -61,7 +61,7 @@
 
 	// Jones sierra sci was called with parameter -Nw 0 0 200 320
 	//  this actually meant not skipping the first 10 pixellines in windowMgrPort
-	if (gameName == "jones")
+	if (gameId == "jones")
 		offTop = 0;
 
 	_gfx->OpenPort(_wmgrPort);

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.h	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.h	2009-12-27 12:54:03 UTC (rev 46635)
@@ -36,7 +36,7 @@
 	SciGuiWindowMgr(SciGui *gui, SciGuiScreen *screen, SciGuiGfx *gfx, SciGuiText *text);
 	~SciGuiWindowMgr();
 
-	void init(Common::String gameName);
+	void init(Common::String gameId);
 
 	int16 isFrontWindow(GuiWindow *wnd);
 	void BeginUpdate(GuiWindow *wnd);

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-12-27 12:46:03 UTC (rev 46634)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-12-27 12:54:03 UTC (rev 46635)
@@ -450,7 +450,7 @@
 	// LSL6 calls kSetPort to extend the screen to draw the Gui. If we free all resources
 	// here, the background picture is freed too, and this makes everything a big mess.
 	// FIXME/TODO: This code really needs to be rewritten to conform to the original behavior
-	if (_s->_gameName != "lsl6") {
+	if (_s->_gameId != "lsl6") {
 		_s->gfx_state->pic_port_bounds = gfx_rect(picLeft, picTop, rect.right, rect.bottom);
 
 		// FIXME: Should really only invalidate all loaded pic resources here;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list