[Scummvm-cvs-logs] SF.net SVN: scummvm:[54262] scummvm/trunk/engines/tinsel

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Nov 16 10:53:55 CET 2010


Revision: 54262
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54262&view=rev
Author:   fingolfin
Date:     2010-11-16 09:53:55 +0000 (Tue, 16 Nov 2010)

Log Message:
-----------
TINSEL: Mark all (?) global vars with a FIXME comment

Use of global vars is what prevents RTL from working in Tinsel (and
probably in other engines). More specifically, the fact that many
global vars are not explicitly inited when the engine is (re)launched.

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/actors.cpp
    scummvm/trunk/engines/tinsel/background.cpp
    scummvm/trunk/engines/tinsel/background.h
    scummvm/trunk/engines/tinsel/bg.cpp
    scummvm/trunk/engines/tinsel/bmv.cpp
    scummvm/trunk/engines/tinsel/coroutine.cpp
    scummvm/trunk/engines/tinsel/cursor.cpp
    scummvm/trunk/engines/tinsel/dialogs.cpp
    scummvm/trunk/engines/tinsel/drives.cpp
    scummvm/trunk/engines/tinsel/events.cpp
    scummvm/trunk/engines/tinsel/faders.cpp
    scummvm/trunk/engines/tinsel/font.cpp
    scummvm/trunk/engines/tinsel/handle.cpp
    scummvm/trunk/engines/tinsel/heapmem.cpp
    scummvm/trunk/engines/tinsel/mareels.cpp
    scummvm/trunk/engines/tinsel/move.cpp
    scummvm/trunk/engines/tinsel/music.cpp
    scummvm/trunk/engines/tinsel/object.cpp
    scummvm/trunk/engines/tinsel/palette.cpp
    scummvm/trunk/engines/tinsel/pcode.cpp
    scummvm/trunk/engines/tinsel/pdisplay.cpp
    scummvm/trunk/engines/tinsel/play.cpp
    scummvm/trunk/engines/tinsel/polygons.cpp
    scummvm/trunk/engines/tinsel/rince.cpp
    scummvm/trunk/engines/tinsel/saveload.cpp
    scummvm/trunk/engines/tinsel/savescn.cpp
    scummvm/trunk/engines/tinsel/scene.cpp
    scummvm/trunk/engines/tinsel/sched.cpp
    scummvm/trunk/engines/tinsel/scroll.cpp
    scummvm/trunk/engines/tinsel/strres.cpp
    scummvm/trunk/engines/tinsel/sysvar.cpp
    scummvm/trunk/engines/tinsel/timers.cpp
    scummvm/trunk/engines/tinsel/tinlib.cpp
    scummvm/trunk/engines/tinsel/tinsel.cpp
    scummvm/trunk/engines/tinsel/token.cpp

Modified: scummvm/trunk/engines/tinsel/actors.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/actors.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/actors.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -79,6 +79,8 @@
 
 #define MAX_REELS 6
 
+// FIXME: Avoid non-const global vars
+
 static int LeadActorId = 0;		// The lead actor
 
 static int NumActors = 0;	// The total number of actors in the game

Modified: scummvm/trunk/engines/tinsel/background.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/background.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/background.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -34,8 +34,10 @@
 
 namespace Tinsel {
 
+// FIXME: Avoid non-const global vars
+
 // current background
-BACKGND *pCurBgnd = NULL;
+const BACKGND *pCurBgnd = NULL;
 
 // FIXME: Not yet used
 static bool bEntireRedraw;
@@ -45,7 +47,7 @@
  * @param pBgnd			Pointer to data struct for current background
  */
 
-void InitBackground(BACKGND *pBgnd) {
+void InitBackground(const BACKGND *pBgnd) {
 	int i;			// playfield counter
 	PLAYFIELD *pPlayfield;	// pointer to current playfield
 

Modified: scummvm/trunk/engines/tinsel/background.h
===================================================================
--- scummvm/trunk/engines/tinsel/background.h	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/background.h	2010-11-16 09:53:55 UTC (rev 54262)
@@ -77,7 +77,7 @@
 \*----------------------------------------------------------------------*/
 
 void InitBackground(		// called to initialise a background
-	BACKGND *pBgnd);	// pointer to data struct for current background
+	const BACKGND *pBgnd);	// pointer to data struct for current background
 
 void StartupBackground(CORO_PARAM, SCNHANDLE hFilm);
 

Modified: scummvm/trunk/engines/tinsel/bg.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/bg.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/bg.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -48,6 +48,7 @@
 
 #define MAX_BG	10
 
+// FIXME: Avoid non-const global vars
 static SCNHANDLE hBgPal = 0;	// Background's palette
 static POBJECT pBG[MAX_BG];
 static ANIM	thisAnim[MAX_BG];	// used by BGmainProcess()

Modified: scummvm/trunk/engines/tinsel/bmv.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/bmv.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/bmv.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -1050,7 +1050,8 @@
  */
 void BMVPlayer::LookAtBuffers() {
 	// FIXME: What's the point of this function???
-	static int junk;
+	// Maybe to ensure the relevant data is loaded into cache by the CPU?
+	static int junk;	// FIXME: Avoid non-const global vars
 	int i;
 
 	if (bigBuffer) {

Modified: scummvm/trunk/engines/tinsel/coroutine.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/coroutine.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/coroutine.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -29,7 +29,7 @@
 namespace Tinsel {
 
 
-CoroContext nullContext = NULL;
+CoroContext nullContext = NULL;	// FIXME: Avoid non-const global vars
 
 
 #if COROUTINE_DEBUG

Modified: scummvm/trunk/engines/tinsel/cursor.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/cursor.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/cursor.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -57,6 +57,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static OBJECT *McurObj = NULL;		// Main cursor object
 static OBJECT *AcurObj = NULL;		// Auxiliary cursor object
 

Modified: scummvm/trunk/engines/tinsel/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/dialogs.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/dialogs.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -2245,7 +2245,7 @@
  * InvBoxes
  */
 static void InvBoxes(bool InBody, int curX, int curY) {
-	static int rotateIndex = -1;
+	static int rotateIndex = -1;	// FIXME: Avoid non-const global vars
 	int	index;			// Box pointed to on this call
 	const FILM *pfilm;
 
@@ -3409,7 +3409,7 @@
  */
 static void InvCursor(InvCursorFN fn, int CurX, int CurY) {
 	static enum { IC_NORMAL, IC_DR, IC_UR, IC_TB, IC_LR,
-		IC_INV, IC_UP, IC_DN } ICursor = IC_NORMAL;	// FIXME: local static var
+		IC_INV, IC_UP, IC_DN } ICursor = IC_NORMAL;	// FIXME: Avoid non-const global vars
 
 	int	area;		// The part of the window the cursor is over
 	bool	restoreMain = false;
@@ -4278,7 +4278,7 @@
  * y-movement during such a drag.
  */
 static void SlideSlider(int y, SSFN fn) {
-	static int newY = 0, lasti = 0;	// FIXME: local static var
+	static int newY = 0, lasti = 0;	// FIXME: Avoid non-const global vars
 	int gotoY, ati;
 
 	// Only do this if there's a slider
@@ -4332,7 +4332,7 @@
  * y-movement during such a drag.
  */
 static void SlideCSlider(int y, SSFN fn) {
-	static int newY = 0;	// FIXME: local static var
+	static int newY = 0;	// FIXME: Avoid non-const global vars
 	int	gotoY;
 	int	fc;
 
@@ -4399,7 +4399,7 @@
  * and upon x-movement during such a drag.
  */
 static void SlideMSlider(int x, SSFN fn) {
-	static int newX = 0;	// FIXME: local static var
+	static int newX = 0;	// FIXME: Avoid non-const global vars
 	int gotoX;
 	int index, i;
 

Modified: scummvm/trunk/engines/tinsel/drives.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/drives.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/drives.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -33,13 +33,18 @@
 
 namespace Tinsel {
 
+// FIXME: Avoid non-const global vars
+
 char currentCD = '1';
 static uint32 cdFlags[] = { fCd1, fCd2, fCd3, fCd4, fCd5, fCd6, fCd7, fCd8 };
 
 static bool bChangingCD = false;
 static char nextCD = '\0';
 
+static uint32 lastTime = 0;
+extern LANGUAGE sampleLanguage;
 
+
 void CdCD(CORO_PARAM) {
 	CORO_BEGIN_CONTEXT;
 	CORO_END_CONTEXT(_ctx);
@@ -94,9 +99,6 @@
 	return cd;
 }
 
-static uint32 lastTime = 0;
-extern LANGUAGE sampleLanguage;
-
 void DoCdChange() {
 	if (bChangingCD && (g_system->getMillis() > (lastTime + 1000))) {
 		lastTime = g_system->getMillis();

Modified: scummvm/trunk/engines/tinsel/events.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/events.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/events.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -61,6 +61,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static uint32 lastUserEvent = 0;	// Time it hapenned
 static int leftEvents = 0;		// Single or double, left or right. Or escape key.
 static int escEvents = 1;		// Escape key
@@ -393,7 +395,7 @@
 		"PLR_JUMP", "PLR_NOEVENT"};
 	debugC(DEBUG_BASIC, kTinselDebugActions, "%s - (%d,%d)",
 		actionList[pEvent], coOrds.x, coOrds.y);
-	static uint32 lastRealAction = 0;
+	static uint32 lastRealAction = 0;	// FIXME: Avoid non-const global vars
 
 	// This stuff to allow F1 key during startup.
 	if (bEnableMenu && pEvent == PLR_MENU)

Modified: scummvm/trunk/engines/tinsel/faders.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/faders.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/faders.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -236,7 +236,7 @@
 
 void PokeInTagColour() {
 	if (SysVar(SV_TAGCOLOUR)) {
-		static COLORREF c = GetActorRGB(-1);
+		static COLORREF c = GetActorRGB(-1);	// FIXME: Avoid non-const global vars
 		UpdateDACqueue(SysVar(SV_TAGCOLOUR), 1, &c);
 	}
 }

Modified: scummvm/trunk/engines/tinsel/font.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/font.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/font.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -35,6 +35,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static char tBuffer[TBUFSZ];
 
 static SCNHANDLE hTagFont = 0, hTalkFont = 0;
@@ -117,7 +119,7 @@
 		pImg->hImgPal = 0;
 
 	if (TinselV2 && SysVar(SV_TAGCOLOUR)) {
-		static COLORREF c = GetActorRGB(-1);
+		static COLORREF c = GetActorRGB(-1);	// FIXME: Avoid non-const global vars
 		SetTagColorRef(c);
 		UpdateDACqueue(SysVar(SV_TAGCOLOUR), 1, &c);
 	}

Modified: scummvm/trunk/engines/tinsel/handle.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/handle.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/handle.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -70,6 +70,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 // handle table gets loaded from index file at runtime
 static MEMHANDLE *handleTable = 0;
 

Modified: scummvm/trunk/engines/tinsel/heapmem.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/heapmem.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/heapmem.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -57,6 +57,9 @@
 // If the memory is not enough, the engine throws an "Out of memory" error in handle.cpp inside LockMem()
 static const uint32 MemoryPoolSize[3] = {5 * 1024 * 1024, 5 * 1024 * 1024, 10 * 1024 * 1024};
 
+// FIXME: Avoid non-const global vars
+
+
 // list of all memory nodes
 MEM_NODE mnodeList[NUM_MNODES];
 

Modified: scummvm/trunk/engines/tinsel/mareels.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/mareels.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/mareels.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -48,6 +48,8 @@
 	SCNHANDLE reels[4];
 };
 
+// FIXME: Avoid non-const global vars
+
 static SCIdataStruct SCIdata[MAX_SCRENTRIES];
 
 static int scrEntries = 0;

Modified: scummvm/trunk/engines/tinsel/move.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/move.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/move.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -77,6 +77,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 #if SLOW_RINCE_DOWN
 static int Interlude = 0;	// For slowing down walking, for testing
 static int BogusVar = 0;	// For slowing down walking, for testing

Modified: scummvm/trunk/engines/tinsel/music.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/music.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/music.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -62,6 +62,8 @@
 	uint32 size;		// size of the buffer
 };
 
+// FIXME: Avoid non-const global vars
+
 // get set when music driver is installed
 //static MDI_DRIVER *mDriver;
 //static HSEQUENCE mSeqHandle;
@@ -168,7 +170,7 @@
 	}
 
 	// the index and length of the last tune loaded
-	static uint32 dwLastMidiIndex = 0;
+	static uint32 dwLastMidiIndex = 0;	// FIXME: Avoid non-const global vars
 	//static uint32 dwLastSeqLen;
 
 	uint32 dwSeqLen = 0;	// length of the sequence
@@ -308,7 +310,7 @@
 void SetMidiVolume(int vol) {
 	assert(vol >= 0 && vol <= Audio::Mixer::kMaxChannelVolume);
 
-	static int priorVolMusic = 0;
+	static int priorVolMusic = 0;	// FIXME: Avoid non-const global vars
 
 	if (vol == 0 && priorVolMusic == 0)	{
 		// Nothing to do

Modified: scummvm/trunk/engines/tinsel/object.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/object.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/object.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -36,6 +36,8 @@
 
 namespace Tinsel {
 
+// FIXME: Avoid non-const global vars
+
 // list of all objects
 static OBJECT *objectList = 0;
 

Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/palette.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -51,6 +51,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 /** background colour */
 static COLORREF bgndColour = BLACK;
 
@@ -619,7 +621,7 @@
 }
 
 int HighlightColour() {
-	static COLORREF cRef;
+	static COLORREF cRef;	// FIXME: Avoid non-const global vars
 
 	cRef = (COLORREF)SysVar(SYS_HighlightRGB);
 	UpdateDACqueue(talkIndex, 1, &cRef);

Modified: scummvm/trunk/engines/tinsel/pcode.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/pcode.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/pcode.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -106,6 +106,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static int32 *pGlobals = 0;		// global vars
 
 static int numGlobals = 0;		// How many global variables to save/restore

Modified: scummvm/trunk/engines/tinsel/pdisplay.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/pdisplay.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/pdisplay.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -72,6 +72,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static bool DispPath = false;
 static bool bShowString = false;
 
@@ -375,6 +377,7 @@
  * the screen.
  */
 static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) {
+	// FIXME: Avoid non-const global vars
 	static int tagX = 0, tagY = 0;	// Values when tag was displayed
 	int	newX, newY;		// new values, to keep tag in place
 	int	ano;
@@ -486,6 +489,7 @@
  * code contains a printtag() call, its tagState flag gets set to TAG_ON.
  */
 static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
+	// FIXME: Avoid non-const global vars
 	static int	Loffset = 0, Toffset = 0;	// Values when tag was displayed
 	static int curX = 0, curY = 0;
 	int		nLoff, nToff;		// new values, to keep tag in place

Modified: scummvm/trunk/engines/tinsel/play.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/play.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/play.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -63,6 +63,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static SOUNDREELS soundReels[MAX_SOUNDREELS];
 static int soundReelNumbers[MAX_SOUNDREELS];
 
@@ -432,6 +434,7 @@
 		int tmpX, tmpY;
 	CORO_END_CONTEXT(_ctx);
 
+	// FIXME: Avoid non-const global vars
 	static int	firstColZ = 0;	// Z-position of column zero
 	static int32	fColZfactor = 0;	// Z-factor of column zero's actor
 
@@ -818,6 +821,7 @@
 
 		SoundReelWaitCheck();
 	} else {
+		// FIXME: Avoid non-const global vars
 		static int baseZposn;		// Z-position of column zero
 		static uint32 baseZfact;	// Z-factor of column zero's actor
 

Modified: scummvm/trunk/engines/tinsel/polygons.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/polygons.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/polygons.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -289,6 +289,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static int MaxPolys = MAX_POLY;
 
 static POLYGON *Polys[MAX_POLY+1];

Modified: scummvm/trunk/engines/tinsel/rince.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/rince.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/rince.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -53,7 +53,7 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
-static MOVER Movers[MAX_MOVERS];
+static MOVER Movers[MAX_MOVERS];	// FIXME: Avoid non-const global vars
 
 //----------------- FUNCTIONS ----------------------------
 

Modified: scummvm/trunk/engines/tinsel/saveload.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/saveload.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/saveload.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -120,6 +120,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static int	numSfiles = 0;
 static SFILES	savedFiles[MAX_SAVED_FILES];
 
@@ -287,7 +289,7 @@
  * Generates a new, unique, filename.
  */
 static char *NewName() {
-	static char result[FNAMELEN];
+	static char result[FNAMELEN];	// FIXME: Avoid non-const global vars
 	int	i;
 	int	ano = 1;	// Allocated number
 

Modified: scummvm/trunk/engines/tinsel/savescn.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/savescn.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/savescn.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -82,6 +82,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static bool ASceneIsSaved = false;
 
 static int savedSceneCount = 0;

Modified: scummvm/trunk/engines/tinsel/scene.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/scene.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/scene.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -106,6 +106,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 #ifdef DEBUG
 static bool ShowPosition = false;	// Set when showpos() has been called
 #endif
@@ -368,6 +370,10 @@
  */
 void PrimeBackground() {
 	// structure for playfields
+	// FIXME: Avoid non-const global vars
+	// TODO: We should simply merge this function with InitBackground
+	//   in order to avoid the static var and the problems associate
+	//   with it.
 	static PLAYFIELD playfield[] = {
 		{	// FIELD WORLD
 			NULL,		// display list
@@ -390,7 +396,7 @@
 	};
 
 	// structure for background
-	static BACKGND backgnd = {
+	static const BACKGND backgnd = {
 		BLACK,			// sky colour
 		Common::Point(0, 0),	// initial world pos
 		Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),	// scroll limits

Modified: scummvm/trunk/engines/tinsel/sched.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/sched.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/sched.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -47,6 +47,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static uint32 numSceneProcess;
 static SCNHANDLE hSceneProcess;
 

Modified: scummvm/trunk/engines/tinsel/scroll.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/scroll.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/scroll.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -49,6 +49,9 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
+
 static int LeftScroll = 0, DownScroll = 0;	// Number of iterations outstanding
 
 static int scrollActor = 0;

Modified: scummvm/trunk/engines/tinsel/strres.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/strres.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/strres.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -36,6 +36,8 @@
 
 namespace Tinsel {
 
+// FIXME: Avoid non-const global vars
+
 #ifdef DEBUG
 // Diagnostic number
 int newestString;

Modified: scummvm/trunk/engines/tinsel/sysvar.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/sysvar.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/sysvar.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -42,6 +42,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 static int systemVars[SV_TOPVALID] = {
 
 		INV_1,		// Default inventory
@@ -104,7 +106,7 @@
 		0		// ISV_GHOST_COLOUR
 };
 
-static SCNHANDLE systemStrings[SS_MAX_VALID];
+static SCNHANDLE systemStrings[SS_MAX_VALID];	// FIXME: Avoid non-const global vars
 
 //static bool bFlagNoBlocking = false;
 

Modified: scummvm/trunk/engines/tinsel/timers.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/timers.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/timers.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -52,7 +52,7 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
-static TIMER timers[MAX_TIMERS];
+static TIMER timers[MAX_TIMERS];	// FIXME: Avoid non-const global vars
 
 
 //--------------------------------------------------------

Modified: scummvm/trunk/engines/tinsel/tinlib.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinlib.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/tinlib.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -122,6 +122,8 @@
 
 //----------------- GLOBAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 bool bEnableMenu;
 
 static bool bInstantScroll = false;
@@ -172,7 +174,7 @@
 	HIGHEST_LIBCODE
 };
 
-const MASTER_LIB_CODES DW1DEMO_CODES[] = {
+static const MASTER_LIB_CODES DW1DEMO_CODES[] = {
 	ACTORREF, ACTORXPOS, ACTORYPOS, ADDTOPIC, ADDINV1, ADDINV2, AUXSCALE, BACKGROUND,
 	CAMERA, CONTROL, CONVERSATION, CONVTOPIC, HIGHEST_LIBCODE, CURSORXPOS, CURSORYPOS,
 	DECCONVW, DECCURSOR, DECTAGFONT, DECINVW, DECINV1, DECINV2, DECLEAD, DELICON,
@@ -186,7 +188,7 @@
 	WALKTAG, RANDOM, TIMER
 };
 
-const MASTER_LIB_CODES DW1_CODES[] = {
+static const MASTER_LIB_CODES DW1_CODES[] = {
 	ACTORATTR, ACTORDIRECTION, ACTORREF, ACTORSCALE, ACTORXPOS,
 	ACTORYPOS, ADDTOPIC, ADDINV1, ADDINV2, ADDOPENINV, AUXSCALE,
 	BACKGROUND, CAMERA, CLOSEINVENTORY, CONTROL, CONVERSATION,
@@ -213,7 +215,7 @@
 	HIGHEST_LIBCODE
 };
 
-const MASTER_LIB_CODES DW2DEMO_CODES[] = {
+static const MASTER_LIB_CODES DW2DEMO_CODES[] = {
 	ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY, 
 	ACTORREF, ACTORRGB, ACTORSCALE, ACTORXPOS, ACTORYPOS,
 	ADDHIGHLIGHT, ADDINV, ADDINV1, ADDINV2, ADDOPENINV, ADDTOPIC,
@@ -250,7 +252,7 @@
 	HIGHEST_LIBCODE
 };
 
-const MASTER_LIB_CODES DW2_CODES[] = {
+static const MASTER_LIB_CODES DW2_CODES[] = {
 	ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY,
 	ACTORREF, ACTORRGB, ACTORSCALE, ACTORXPOS, ACTORYPOS,
 	ADDHIGHLIGHT, ADDINV, ADDINV1, ADDINV2, ADDOPENINV, ADDTOPIC,
@@ -292,6 +294,8 @@
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 // Saved cursor co-ordinates for control(on) to restore cursor position
 // as it was at control(off).
 // They are global so that MoveCursor(..) has a net effect if it

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -98,6 +98,8 @@
 
 //----------------- GLOBAL GLOBAL DATA --------------------
 
+// FIXME: Avoid non-const global vars
+
 bool bRestart = false;
 bool bHasRestarted = false;
 bool loadingFromGMM = false;
@@ -634,6 +636,7 @@
 }
 
 // FIXME: CountOut is used by ChangeScene
+// FIXME: Avoid non-const global vars
 static int CountOut = 1;	// == 1 for immediate start of first scene
 
 /**

Modified: scummvm/trunk/engines/tinsel/token.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/token.cpp	2010-11-16 09:53:08 UTC (rev 54261)
+++ scummvm/trunk/engines/tinsel/token.cpp	2010-11-16 09:53:55 UTC (rev 54262)
@@ -37,7 +37,7 @@
 	PROCESS		*proc;
 };
 
-static Token tokens[NUMTOKENS];
+static Token tokens[NUMTOKENS];	// FIXME: Avoid non-const global vars
 
 
 /**


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