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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jun 23 17:23:37 CEST 2010


Revision: 50183
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50183&view=rev
Author:   thebluegr
Date:     2010-06-23 15:23:37 +0000 (Wed, 23 Jun 2010)

Log Message:
-----------
Moved the SelectorCache struct inside selector.h, where it belongs, and fixed some header dependencies in the process

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/engine/features.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/selector.cpp
    scummvm/trunk/engines/sci/engine/selector.h
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/engine/vm.h
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/compare.cpp
    scummvm/trunk/engines/sci/graphics/controls.cpp
    scummvm/trunk/engines/sci/graphics/coordadjuster.cpp
    scummvm/trunk/engines/sci/graphics/frameout.cpp
    scummvm/trunk/engines/sci/graphics/maciconbar.cpp
    scummvm/trunk/engines/sci/graphics/menu.cpp
    scummvm/trunk/engines/sci/sound/soundcmd.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/console.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -31,6 +31,7 @@
 #include "sci/event.h"
 #include "sci/resource.h"
 #include "sci/engine/state.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/savegame.h"
 #include "sci/engine/gc.h"

Modified: scummvm/trunk/engines/sci/engine/features.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/features.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/features.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -24,6 +24,7 @@
  */
 
 #include "sci/engine/features.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/script.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/vm.h"

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2010-06-23 15:23:37 UTC (rev 50183)
@@ -31,6 +31,7 @@
 #include "common/rect.h"
 #include "common/str-array.h"
 
+#include "sci/engine/selector.h"
 #include "sci/sci.h"	// for USE_OLD_MUSIC_FUNCTIONS
 #include "sci/engine/vm_types.h"	// for reg_t
 #include "sci/engine/vm.h"
@@ -39,6 +40,7 @@
 
 struct Node;	// from segment.h
 struct List;	// from segment.h
+struct SelectorCache;	// from selector.h
 
 /**
  * @defgroup VocabularyResources	Vocabulary resources in SCI

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -33,6 +33,7 @@
 #include "sci/event.h"
 
 #include "sci/engine/features.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/message.h"
 #include "sci/engine/savegame.h"

Modified: scummvm/trunk/engines/sci/engine/selector.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/selector.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/selector.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -24,6 +24,7 @@
  */
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 

Modified: scummvm/trunk/engines/sci/engine/selector.h
===================================================================
--- scummvm/trunk/engines/sci/engine/selector.h	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/selector.h	2010-06-23 15:23:37 UTC (rev 50183)
@@ -30,10 +30,120 @@
 
 #include "sci/engine/vm_types.h"	// for reg_t
 #include "sci/engine/vm.h"
-#include "sci/engine/kernel.h"		// for Kernel::_selectorCache
 
 namespace Sci {
 
+/** Contains selector IDs for a few selected selectors */
+struct SelectorCache {
+	SelectorCache() {
+		memset(this, 0, sizeof(*this));
+	}
+
+	// Statically defined selectors, (almost the) same in all SCI versions
+	Selector y;
+	Selector x;
+	Selector view, loop, cel; ///< Description of a specific image
+	Selector underBits; ///< Used by the graphics subroutines to store backupped BG pic data
+	Selector nsTop, nsLeft, nsBottom, nsRight; ///< View boundaries ('now seen')
+	Selector lsTop, lsLeft, lsBottom, lsRight; ///< Used by Animate() subfunctions and scroll list controls
+	Selector signal; ///< Used by Animate() to control a view's behaviour
+	Selector illegalBits; ///< Used by CanBeHere
+	Selector brTop, brLeft, brBottom, brRight; ///< Bounding Rectangle
+	// name, key, time
+	Selector text; ///< Used by controls
+	Selector elements; ///< Used by SetSynonyms()
+	// color, back
+	Selector mode; ///< Used by text controls (-> DrawControl())
+	// style
+	Selector state, font, type;///< Used by controls
+	// window
+	Selector cursor, max; ///< Used by EditControl
+	// mark, who
+	Selector message; ///< Used by GetEvent
+	// edit
+	Selector play; ///< Play function (first function to be called)
+	Selector number;
+	Selector handle;	///< Replaced by nodePtr in SCI1+
+	Selector nodePtr;	///< Replaces handle in SCI1+
+	Selector client; ///< The object that wants to be moved
+	Selector dx, dy; ///< Deltas
+	Selector b_movCnt, b_i1, b_i2, b_di, b_xAxis, b_incr; ///< Various Bresenham vars
+	Selector xStep, yStep; ///< BR adjustments
+	Selector moveSpeed; ///< Used for DoBresen
+	Selector canBeHere; ///< Funcselector: Checks for movement validity in SCI0
+	Selector heading, mover; ///< Used in DoAvoider
+	Selector doit; ///< Called (!) by the Animate() system call
+	Selector isBlocked, looper;	///< Used in DoAvoider
+	Selector priority;
+	Selector modifiers; ///< Used by GetEvent
+	Selector replay; ///< Replay function
+	// setPri, at, next, done, width
+	Selector wordFail, syntaxFail; ///< Used by Parse()
+	// semanticFail, pragmaFail
+	// said
+	Selector claimed; ///< Used generally by the event mechanism
+	// value, save, restore, title, button, icon, draw
+	Selector delete_; ///< Called by Animate() to dispose a view object
+	Selector z;
+
+	// SCI1+ static selectors
+	Selector parseLang;
+	Selector printLang; ///< Used for i18n
+	Selector subtitleLang;
+	Selector size;
+	Selector points; ///< Used by AvoidPath()
+	Selector palette;
+	Selector dataInc;
+	// handle (in SCI1)
+	Selector min; ///< SMPTE time format
+	Selector sec;
+	Selector frame;
+	Selector vol;
+	Selector pri;
+	// perform
+	Selector moveDone;	///< used for DoBresen
+
+	// SCI1 selectors which have been moved a bit in SCI1.1, but otherwise static
+	Selector cantBeHere; ///< Checks for movement avoidance in SCI1+. Replaces canBeHere
+	Selector topString; ///< SCI1 scroll lists use this instead of lsTop
+	Selector flags;
+
+	// SCI1+ audio sync related selectors, not static. They're used for lip syncing in
+	// CD talkie games
+	Selector syncCue; ///< Used by DoSync()
+	Selector syncTime;
+
+	// SCI1.1 specific selectors
+	Selector scaleSignal; //< Used by kAnimate() for cel scaling (SCI1.1+)
+	Selector scaleX, scaleY;	///< SCI1.1 view scaling
+	Selector maxScale;		///< SCI1.1 view scaling, limit for cel, when using global scaling
+	Selector vanishingX;	///< SCI1.1 view scaling, used by global scaling
+	Selector vanishingY;	///< SCI1.1 view scaling, used by global scaling
+
+	// Used for auto detection purposes
+	Selector overlay;	///< Used to determine if a game is using old gfx functions or not
+
+	// SCI1.1 Mac icon bar selectors
+	Selector iconIndex; ///< Used to index icon bar objects
+
+#ifdef ENABLE_SCI32
+	Selector data; // Used by Array()/String()
+	Selector picture; // Used to hold the picture ID for SCI32 pictures
+
+	Selector plane;
+	Selector top;
+	Selector left;
+	Selector bottom;
+	Selector right;
+	Selector resX;
+	Selector resY;
+
+	Selector fore;
+	Selector back;
+	Selector dimmed;
+#endif
+};
+
 /**
  * Map a selector name to a selector id. Shortcut for accessing the selector cache.
  */

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -29,6 +29,7 @@
 #include "sci/debug.h"	// for g_debug_sleeptime_factor
 #include "sci/event.h"
 
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/vm.h"

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/engine/vm.h	2010-06-23 15:23:37 UTC (rev 50183)
@@ -71,117 +71,6 @@
 
 #define RAW_IS_OBJECT(datablock) (READ_SCI11ENDIAN_UINT16(((byte *) datablock) + SCRIPT_OBJECT_MAGIC_OFFSET) == SCRIPT_OBJECT_MAGIC_NUMBER)
 
-/** Contains selector IDs for a few selected selectors */
-struct SelectorCache {
-	SelectorCache() {
-		memset(this, 0, sizeof(*this));
-	}
-
-	// Statically defined selectors, (almost the) same in all SCI versions
-	Selector y;
-	Selector x;
-	Selector view, loop, cel; ///< Description of a specific image
-	Selector underBits; ///< Used by the graphics subroutines to store backupped BG pic data
-	Selector nsTop, nsLeft, nsBottom, nsRight; ///< View boundaries ('now seen')
-	Selector lsTop, lsLeft, lsBottom, lsRight; ///< Used by Animate() subfunctions and scroll list controls
-	Selector signal; ///< Used by Animate() to control a view's behaviour
-	Selector illegalBits; ///< Used by CanBeHere
-	Selector brTop, brLeft, brBottom, brRight; ///< Bounding Rectangle
-	// name, key, time
-	Selector text; ///< Used by controls
-	Selector elements; ///< Used by SetSynonyms()
-	// color, back
-	Selector mode; ///< Used by text controls (-> DrawControl())
-	// style
-	Selector state, font, type;///< Used by controls
-	// window
-	Selector cursor, max; ///< Used by EditControl
-	// mark, who
-	Selector message; ///< Used by GetEvent
-	// edit
-	Selector play; ///< Play function (first function to be called)
-	Selector number;
-	Selector handle;	///< Replaced by nodePtr in SCI1+
-	Selector nodePtr;	///< Replaces handle in SCI1+
-	Selector client; ///< The object that wants to be moved
-	Selector dx, dy; ///< Deltas
-	Selector b_movCnt, b_i1, b_i2, b_di, b_xAxis, b_incr; ///< Various Bresenham vars
-	Selector xStep, yStep; ///< BR adjustments
-	Selector moveSpeed; ///< Used for DoBresen
-	Selector canBeHere; ///< Funcselector: Checks for movement validity in SCI0
-	Selector heading, mover; ///< Used in DoAvoider
-	Selector doit; ///< Called (!) by the Animate() system call
-	Selector isBlocked, looper;	///< Used in DoAvoider
-	Selector priority;
-	Selector modifiers; ///< Used by GetEvent
-	Selector replay; ///< Replay function
-	// setPri, at, next, done, width
-	Selector wordFail, syntaxFail; ///< Used by Parse()
-	// semanticFail, pragmaFail
-	// said
-	Selector claimed; ///< Used generally by the event mechanism
-	// value, save, restore, title, button, icon, draw
-	Selector delete_; ///< Called by Animate() to dispose a view object
-	Selector z;
-
-	// SCI1+ static selectors
-	Selector parseLang;
-	Selector printLang; ///< Used for i18n
-	Selector subtitleLang;
-	Selector size;
-	Selector points; ///< Used by AvoidPath()
-	Selector palette;
-	Selector dataInc;
-	// handle (in SCI1)
-	Selector min; ///< SMPTE time format
-	Selector sec;
-	Selector frame;
-	Selector vol;
-	Selector pri;
-	// perform
-	Selector moveDone;	///< used for DoBresen
-
-	// SCI1 selectors which have been moved a bit in SCI1.1, but otherwise static
-	Selector cantBeHere; ///< Checks for movement avoidance in SCI1+. Replaces canBeHere
-	Selector topString; ///< SCI1 scroll lists use this instead of lsTop
-	Selector flags;
-
-	// SCI1+ audio sync related selectors, not static. They're used for lip syncing in
-	// CD talkie games
-	Selector syncCue; ///< Used by DoSync()
-	Selector syncTime;
-
-	// SCI1.1 specific selectors
-	Selector scaleSignal; //< Used by kAnimate() for cel scaling (SCI1.1+)
-	Selector scaleX, scaleY;	///< SCI1.1 view scaling
-	Selector maxScale;		///< SCI1.1 view scaling, limit for cel, when using global scaling
-	Selector vanishingX;	///< SCI1.1 view scaling, used by global scaling
-	Selector vanishingY;	///< SCI1.1 view scaling, used by global scaling
-
-	// Used for auto detection purposes
-	Selector overlay;	///< Used to determine if a game is using old gfx functions or not
-
-	// SCI1.1 Mac icon bar selectors
-	Selector iconIndex; ///< Used to index icon bar objects
-
-#ifdef ENABLE_SCI32
-	Selector data; // Used by Array()/String()
-	Selector picture; // Used to hold the picture ID for SCI32 pictures
-
-	Selector plane;
-	Selector top;
-	Selector left;
-	Selector bottom;
-	Selector right;
-	Selector resX;
-	Selector resY;
-
-	Selector fore;
-	Selector back;
-	Selector dimmed;
-#endif
-};
-
 // A reference to an object's variable.
 // The object is stored as a reg_t, the variable as an index into _variables
 struct ObjVarRef {

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -28,6 +28,7 @@
 #include "graphics/primitives.h"
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/vm.h"

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -28,6 +28,7 @@
 #include "graphics/primitives.h"
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/graphics/compare.h"

Modified: scummvm/trunk/engines/sci/graphics/controls.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/controls.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/controls.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -30,6 +30,7 @@
 
 #include "sci/sci.h"
 #include "sci/event.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/graphics/ports.h"

Modified: scummvm/trunk/engines/sci/graphics/coordadjuster.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/coordadjuster.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/coordadjuster.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -26,6 +26,7 @@
 #include "common/util.h"
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/graphics/coordadjuster.h"

Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -28,6 +28,7 @@
 #include "graphics/primitives.h"
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/vm.h"
@@ -86,7 +87,6 @@
 
 int16 GfxFrameout::kernelGetHighPlanePri() {
 	sortPlanes();
-	reg_t object = _planes.back();
 	return readSelectorValue(g_sci->getEngineState()->_segMan, _planes.back(), SELECTOR(priority));
 }
 

Modified: scummvm/trunk/engines/sci/graphics/maciconbar.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/maciconbar.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/maciconbar.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -24,6 +24,7 @@
  */
 
 #include "sci/sci.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/selector.h"
 #include "sci/engine/state.h"
 #include "sci/graphics/maciconbar.h"

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -29,6 +29,7 @@
 
 #include "sci/sci.h"
 #include "sci/event.h"
+#include "sci/engine/kernel.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/graphics/ports.h"

Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-06-23 15:08:23 UTC (rev 50182)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-06-23 15:23:37 UTC (rev 50183)
@@ -34,6 +34,7 @@
 #include "sci/sound/music.h"
 #include "sci/sound/soundcmd.h"
 
+#include "sci/engine/kernel.h"
 #include "sci/engine/selector.h"
 
 namespace Sci {


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