rnd-20100623-2-src
[rocksndiamonds.git] / src / game_sp / Globals.c
index e34d19624341f42236c2ee46c5c67343ca8d900b..91c715172ee6c8c5981e8b4d5b5149b36ca07031 100644 (file)
@@ -17,7 +17,8 @@ int FieldMax, LevelMax;
 long FileMax;
 
 #if 1
-int PlayField16[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
+int *PlayField16;
+// 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
@@ -164,6 +165,8 @@ boolean isSnappingSequence(int sequence)
 
 void InitGlobals()
 {
+  InitPrecedingPlayfieldMemory();
+
   AutoScrollFlag = True;
   FreezeZonks = 0;
   LevelLoaded = False;
@@ -175,6 +178,11 @@ void InitGlobals()
   bPlaying = False;
   menBorder = False;
 
+  PlayField16 = checked_calloc((game_sp.preceding_buffer_size +
+                               SP_MAX_PLAYFIELD_SIZE +
+                               SP_HEADER_SIZE) * sizeof(int));
+  PlayField16 = &PlayField16[game_sp.preceding_buffer_size];
+
 #if 0
   /* these defaults will be changed after reading a Supaplex level file */
   PlayField8 = REDIM_1D(sizeof(byte), 0, FieldMax);