diff options
35 files changed, 96 insertions, 29 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 27cb62f2f2..7a1f9fbf55 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -79,6 +79,8 @@ struct T2_ACTOR_STRUC { #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 diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index abfb9692a9..560216aadb 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -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 @@ static bool bEntireRedraw; * @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 diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h index 747e51a8f1..81b490488e 100644 --- a/engines/tinsel/background.h +++ b/engines/tinsel/background.h @@ -77,7 +77,7 @@ struct BACKGND { \*----------------------------------------------------------------------*/ 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); diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index efd4b644cf..68653b16f4 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -48,6 +48,7 @@ namespace Tinsel { #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() diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index fd5088636f..f74f3e34c3 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -1050,7 +1050,8 @@ void BMVPlayer::CopyMovieToScreen() { */ 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) { diff --git a/engines/tinsel/coroutine.cpp b/engines/tinsel/coroutine.cpp index 72f39bb21e..b568cb4a46 100644 --- a/engines/tinsel/coroutine.cpp +++ b/engines/tinsel/coroutine.cpp @@ -29,7 +29,7 @@ namespace Tinsel { -CoroContext nullContext = NULL; +CoroContext nullContext = NULL; // FIXME: Avoid non-const global vars #if COROUTINE_DEBUG diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp index dd5f024815..66dc47df1f 100644 --- a/engines/tinsel/cursor.cpp +++ b/engines/tinsel/cursor.cpp @@ -57,6 +57,8 @@ namespace Tinsel { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static OBJECT *McurObj = NULL; // Main cursor object static OBJECT *AcurObj = NULL; // Auxiliary cursor object diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index 135db71575..0a02924f12 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -2245,7 +2245,7 @@ static int WhichMenuBox(int curX, int curY, bool bSlides) { * 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 @@ enum InvCursorFN {IC_AREA, IC_DROP}; */ 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 @@ static int NearestSlideY(int fity) { * 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 @@ static void SlideSlider(int y, SSFN fn) { * 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 @@ static void SlideCSlider(int y, SSFN fn) { * 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; diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp index efc7a2046d..61da0345a8 100644 --- a/engines/tinsel/drives.cpp +++ b/engines/tinsel/drives.cpp @@ -33,12 +33,17 @@ 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; @@ -94,9 +99,6 @@ int GetCD(int flags) { return cd; } -static uint32 lastTime = 0; -extern LANGUAGE sampleLanguage; - void DoCdChange() { if (bChangingCD && (g_system->getMillis() > (lastTime + 1000))) { lastTime = g_system->getMillis(); diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp index 9c01f15b2a..4e61a6ef29 100644 --- a/engines/tinsel/events.cpp +++ b/engines/tinsel/events.cpp @@ -61,6 +61,8 @@ extern bool bEnableMenu; //----------------- 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 @@ void PlayerEvent(PLR_EVENT pEvent, const Common::Point &coOrds) { "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) diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp index de04e4a33e..2feabb0fb9 100644 --- a/engines/tinsel/faders.cpp +++ b/engines/tinsel/faders.cpp @@ -236,7 +236,7 @@ void FadeInFast(SCNHANDLE noFadeTable[]) { 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); } } diff --git a/engines/tinsel/font.cpp b/engines/tinsel/font.cpp index ae7da65473..b1c8b3cb74 100644 --- a/engines/tinsel/font.cpp +++ b/engines/tinsel/font.cpp @@ -35,6 +35,8 @@ namespace Tinsel { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static char tBuffer[TBUFSZ]; static SCNHANDLE hTagFont = 0, hTalkFont = 0; @@ -117,7 +119,7 @@ void FettleFontPal(SCNHANDLE fontPal) { 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); } diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index fdc4484a7c..9461cf8c1c 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -70,6 +70,8 @@ enum { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + // handle table gets loaded from index file at runtime static MEMHANDLE *handleTable = 0; diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index 83bbf6affa..e8c4ed23ee 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -57,6 +57,9 @@ struct MEM_NODE { // 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]; diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp index 33e96ece58..cf28749e76 100644 --- a/engines/tinsel/mareels.cpp +++ b/engines/tinsel/mareels.cpp @@ -48,6 +48,8 @@ struct SCIdataStruct { SCNHANDLE reels[4]; }; +// FIXME: Avoid non-const global vars + static SCIdataStruct SCIdata[MAX_SCRENTRIES]; static int scrEntries = 0; diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp index f854dba2fd..5b9e650689 100644 --- a/engines/tinsel/move.cpp +++ b/engines/tinsel/move.cpp @@ -77,6 +77,8 @@ HPOLYGON InitExtraBlock(PMOVER ca, PMOVER ta); //----------------- 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 diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index e86c9b4ddf..c20b456711 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -62,6 +62,8 @@ struct SOUND_BUFFER { 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 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) { } // 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 @@ int GetMidiVolume() { 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 diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index b67d20fa93..bf31cdfa25 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -36,6 +36,8 @@ namespace Tinsel { +// FIXME: Avoid non-const global vars + // list of all objects static OBJECT *objectList = 0; diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 528adcd048..b31e867a24 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -51,6 +51,8 @@ struct VIDEO_DAC_Q { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + /** background colour */ static COLORREF bgndColour = BLACK; @@ -619,7 +621,7 @@ int TranslucentColour() { } int HighlightColour() { - static COLORREF cRef; + static COLORREF cRef; // FIXME: Avoid non-const global vars cRef = (COLORREF)SysVar(SYS_HighlightRGB); UpdateDACqueue(talkIndex, 1, &cRef); diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index 98fb078459..ccd86d7ed7 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -106,6 +106,8 @@ bool bNoPause = false; //----------------- 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 diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index d55f8be260..38748b703b 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -72,6 +72,8 @@ enum HotSpotTag { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static bool DispPath = false; static bool bShowString = false; @@ -375,6 +377,7 @@ static bool InHotSpot(int ano, int aniX, int aniY, int *pxtext, int *pytext) { * 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 @@ static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) { * 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 diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp index 103b8f42ad..145634b9dd 100644 --- a/engines/tinsel/play.cpp +++ b/engines/tinsel/play.cpp @@ -63,6 +63,8 @@ struct PPINIT { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static SOUNDREELS soundReels[MAX_SOUNDREELS]; static int soundReelNumbers[MAX_SOUNDREELS]; @@ -432,6 +434,7 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) { 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 @@ static void t2PlayReel(CORO_PARAM, int x, int y, bool bRestore, int speed, SCNHA 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 diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 7fc7fcd218..1620881b01 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -289,6 +289,8 @@ void Poly::nextPoly() { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static int MaxPolys = MAX_POLY; static POLYGON *Polys[MAX_POLY+1]; diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index 17b2bf4ddc..67735ad6cb 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -53,7 +53,7 @@ namespace Tinsel { //----------------- LOCAL GLOBAL DATA -------------------- -static MOVER Movers[MAX_MOVERS]; +static MOVER Movers[MAX_MOVERS]; // FIXME: Avoid non-const global vars //----------------- FUNCTIONS ---------------------------- diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index bb77c962a2..c965666e84 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -120,6 +120,8 @@ struct SFILES { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static int numSfiles = 0; static SFILES savedFiles[MAX_SAVED_FILES]; @@ -287,7 +289,7 @@ static void syncSavedData(Common::Serializer &s, SAVED_DATA &sd) { * 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 diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index 2b5c815d3c..a3fe393b79 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -82,6 +82,8 @@ extern SRSTATE SRstate; //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static bool ASceneIsSaved = false; static int savedSceneCount = 0; diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index 33d4e67d70..8f0f4771e3 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -106,6 +106,8 @@ struct ENTRANCE_STRUC { //----------------- 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 EndScene() { */ 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 @@ void PrimeBackground() { }; // 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 diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index d90312d271..939b5f4245 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -47,6 +47,8 @@ struct PROCESS_STRUC { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static uint32 numSceneProcess; static SCNHANDLE hSceneProcess; diff --git a/engines/tinsel/scroll.cpp b/engines/tinsel/scroll.cpp index 47c61a897e..3da970915f 100644 --- a/engines/tinsel/scroll.cpp +++ b/engines/tinsel/scroll.cpp @@ -49,6 +49,9 @@ namespace Tinsel { //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + + static int LeftScroll = 0, DownScroll = 0; // Number of iterations outstanding static int scrollActor = 0; diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index 2416d6a8fa..7ed9a773bc 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -36,6 +36,8 @@ namespace Tinsel { +// FIXME: Avoid non-const global vars + #ifdef DEBUG // Diagnostic number int newestString; diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp index 1732207659..7003d34feb 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -42,6 +42,8 @@ extern int NewestSavedGame(); //----------------- LOCAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + static int systemVars[SV_TOPVALID] = { INV_1, // Default inventory @@ -104,7 +106,7 @@ static int systemVars[SV_TOPVALID] = { 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; diff --git a/engines/tinsel/timers.cpp b/engines/tinsel/timers.cpp index 9c7f709608..5f15cd9d3b 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -52,7 +52,7 @@ struct TIMER { //----------------- LOCAL GLOBAL DATA -------------------- -static TIMER timers[MAX_TIMERS]; +static TIMER timers[MAX_TIMERS]; // FIXME: Avoid non-const global vars //-------------------------------------------------------- diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 70ea8b8556..55f7446212 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -122,6 +122,8 @@ SCNHANDLE GetSceneHandle(); //----------------- GLOBAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + bool bEnableMenu; static bool bInstantScroll = false; @@ -172,7 +174,7 @@ enum MASTER_LIB_CODES { 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 @@ const MASTER_LIB_CODES DW1DEMO_CODES[] = { 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 @@ const MASTER_LIB_CODES DW1_CODES[] = { 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 @@ const MASTER_LIB_CODES DW2DEMO_CODES[] = { 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 @@ const MASTER_LIB_CODES DW2_CODES[] = { //----------------- 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 diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 9eb4bcbdfe..44035db4ed 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -98,6 +98,8 @@ void SetNewScene(SCNHANDLE scene, int entrance, int transition); //----------------- GLOBAL GLOBAL DATA -------------------- +// FIXME: Avoid non-const global vars + bool bRestart = false; bool bHasRestarted = false; bool loadingFromGMM = false; @@ -634,6 +636,7 @@ void RestoreMasterProcess(INT_CONTEXT *pic) { } // FIXME: CountOut is used by ChangeScene +// FIXME: Avoid non-const global vars static int CountOut = 1; // == 1 for immediate start of first scene /** diff --git a/engines/tinsel/token.cpp b/engines/tinsel/token.cpp index 2acf3c073f..fe152edcaa 100644 --- a/engines/tinsel/token.cpp +++ b/engines/tinsel/token.cpp @@ -37,7 +37,7 @@ struct Token { PROCESS *proc; }; -static Token tokens[NUMTOKENS]; +static Token tokens[NUMTOKENS]; // FIXME: Avoid non-const global vars /** |