X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FGlobals.c;h=35bf4d8a9b26385384ec9d95ad628e64e5714300;hb=c60227514289cd7d512539785bb2fe47d30db51a;hp=91a5296e0ce5573739d4a2829fd6a4eef2ef367c;hpb=35b995abd3183999201d9581f7674de1475dc169;p=rocksndiamonds.git diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 91a5296e..35bf4d8a 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -14,10 +14,21 @@ int FieldWidth; // standard size = 60 int FieldHeight; // standard size = 24 int HeaderSize; // standard size = 96 int FieldMax, LevelMax; +#if 0 long FileMax; +#endif + +#if 1 +int *PlayField16; +byte *PlayField8; +// int PlayField16[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE]; +// byte PlayField8[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE]; +byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE]; +#else int *PlayField16; byte *PlayField8; byte *DisPlayField; +#endif int TimerVar; #if 1 @@ -33,6 +44,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; +long 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, @@ -136,6 +168,8 @@ boolean isSnappingSequence(int sequence) void InitGlobals() { + InitPrecedingPlayfieldMemory(); + AutoScrollFlag = True; FreezeZonks = 0; LevelLoaded = False; @@ -146,6 +180,29 @@ 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]; + +#if 0 + /* these defaults will be changed after reading a Supaplex level file */ + PlayField8 = REDIM_1D(sizeof(byte), 0, FieldMax); + DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax); + PlayField16 = REDIM_1D(sizeof(int), 0, FieldMax); + + AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax); + AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax); + TerminalState = REDIM_1D(sizeof(byte), 0, FieldMax); +#endif } int GetSI(int X, int Y) @@ -185,6 +242,7 @@ void PrepareLevel() LevelLoaded = True; } +#if 0 void Trace(char *Source, char *Message) { printf("::: Trace: Source == '%s', Message == '%s'\n", Source, Message); @@ -194,6 +252,7 @@ void ReportError(char *Source, char *Message) { printf("::: ReportError: Source == '%s', Message == '%s'\n", Source, Message); } +#endif int Min(int A, int B) {