X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FGlobals.c;h=d3813f00c186bb4669e3423bfcafb6e33b48934f;hp=91a5296e0ce5573739d4a2829fd6a4eef2ef367c;hb=115ce6f2da1914d68b0fe0e5f9082973190dacdd;hpb=35b995abd3183999201d9581f7674de1475dc169 diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 91a5296e..d3813f00 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -14,17 +14,13 @@ int FieldWidth; // standard size = 60 int FieldHeight; // standard size = 24 int HeaderSize; // standard size = 96 int FieldMax, LevelMax; -long FileMax; + int *PlayField16; byte *PlayField8; -byte *DisPlayField; +byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE]; int TimerVar; -#if 1 short RandomSeed; -#else -int RandomSeed; -#endif int FreezeZonks; @@ -33,6 +29,27 @@ LevelInfoType LInfo; int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY; int ScrollX, ScrollY; +int MurphyPosIndex, MurphyXPos, MurphyYPos; +int MurphyScreenXPos, MurphyScreenYPos; +int MurphyExplodePos, SplitMoveFlag, RedDiskReleaseMurphyPos; +int KillMurphyFlag, MurphyMoveCounter; +int YawnSleepCounter; +int MurphyVarFaceLeft; +int ScratchGravity, GravityFlag; +int RedDiskReleaseFlag, MovingPictureSequencePhase; + +int YellowDisksExploded; +int AllowRedDiskCheat, AllowEatRightRedDiskBug; + +int GameBusyFlag; +int InfotronsNeeded, TotalInfotronsNeeded; +int RedDiskCount; +int SnikSnaksElectronsFrozen; + +int DemoKeyCode; + +int RedDiskReleasePhase; + int fiGraphic[] = { aniSpace, @@ -134,8 +151,10 @@ boolean isSnappingSequence(int sequence) } } -void InitGlobals() +void InitGlobals(void) { + InitPrecedingPlayfieldMemory(); + AutoScrollFlag = True; FreezeZonks = 0; LevelLoaded = False; @@ -146,6 +165,18 @@ void InitGlobals() LevelMax = (FieldWidth * FieldHeight) - 1; bPlaying = False; menBorder = False; + + /* add preceding playfield buffer (as large as preceding memory area) */ + PlayField16 = checked_calloc((game_sp.preceding_buffer_size + + SP_MAX_PLAYFIELD_SIZE + + SP_HEADER_SIZE) * sizeof(int)); + PlayField16 = &PlayField16[game_sp.preceding_buffer_size]; + + /* add preceding playfield buffer (as large as one playfield row) */ + PlayField8 = checked_calloc((SP_MAX_PLAYFIELD_WIDTH + + SP_MAX_PLAYFIELD_SIZE + + SP_HEADER_SIZE) * sizeof(byte)); + PlayField8 = &PlayField8[SP_MAX_PLAYFIELD_WIDTH]; } int GetSI(int X, int Y) @@ -173,28 +204,16 @@ int GetStretchY(int si) return StretchWidth * (si / FieldWidth); } -void PrepareLevel() +void PrepareLevel(void) { copyInternalEngineVars_SP(); -#if 1 SetDisplayRegion(); SetScrollEdges(); -#endif LevelLoaded = True; } -void Trace(char *Source, char *Message) -{ - printf("::: Trace: Source == '%s', Message == '%s'\n", Source, Message); -} - -void ReportError(char *Source, char *Message) -{ - printf("::: ReportError: Source == '%s', Message == '%s'\n", Source, Message); -} - int Min(int A, int B) { return (A < B ? A : B);