rnd-20100418-1-src
[rocksndiamonds.git] / src / game_sp / init.c
index 8ac8804e9bea89880af855ede111cd0e09e5245b..d8e4597dd06a20079cbee3b1749a519e98cbf1aa 100644 (file)
@@ -3,73 +3,28 @@
 #include "global.h"
 
 
-#if 0
-Bitmap *sp_objects;
-
-#endif
-
-Bitmap *screenBitmap;
+Bitmap *bitmap_db_field_sp;
 
 struct EngineSnapshotInfo_SP engine_snapshot_sp;
 
-static void init_struct_functions()
-{
-  Stage.Blt           = &DDScrollBuffer_Blt;
-  Stage.ScrollTo      = &DDScrollBuffer_ScrollTo;
-  Stage.ScrollTowards = &DDScrollBuffer_ScrollTowards;
-  Stage.SoftScrollTo  = &DDScrollBuffer_SoftScrollTo;
-
-  // StretchedSprites.BltEx  = &DDSpriteBuffer_BltEx;
-  StretchedSprites.BltImg = &DDSpriteBuffer_BltImg;
-}
-
-static void init_global_values()
-{
-  menBorder.Checked = False;
-  menPanel.Checked = True;
-  menAutoScroll.Checked = True;
-
-  MainForm.picPane.Width  = picPane.Width  = SCR_FIELDX * TILEX;
-  MainForm.picPane.Height = picPane.Height = SCR_FIELDY * TILEY;
-}
-
 void sp_open_all()
 {
-  init_struct_functions();
-  init_global_values();
-
   Form_Load();
-
-#if 0
-  SetBitmaps_SP(&sp_objects);
-#endif
-
-#if 0
-  /* too small for oversized levels, but too big for graphics performance */
-  /* (the whole playfield is drawn/updated, not only visible/scrolled area) */
-  /* !!! FIX THIS !!! */
-  screenBitmap = CreateBitmap(60 * TILEX, 24 * TILEY,
-                              DEFAULT_DEPTH);
-#else
-  screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
-                              DEFAULT_DEPTH);
-#endif
-
-  DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16);
 }
 
 void sp_close_all()
 {
 }
 
+void InitGfxBuffers_SP()
+{
+  ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH);
+}
+
 unsigned int InitEngineRandom_SP(long seed)
 {
   if (seed == NEW_RANDOMIZE)
   {
-#if 0
-  printf("::: init.c: InitEngineRandom_SP(): subRandomize()\n");
-#endif
-
     subRandomize();
 
     seed = (long)RandomSeed;
@@ -77,10 +32,6 @@ unsigned int InitEngineRandom_SP(long seed)
 
   RandomSeed = (short)seed;
 
-#if 0
-  printf("::: init.c: InitEngineRandom_SP(): RandomSeed == %d\n", RandomSeed);
-#endif
-
   return (unsigned int) seed;
 }
 
@@ -135,8 +86,6 @@ void SaveEngineSnapshotValues_SP()
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMinY));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxX));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxY));
-  SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayWidth));
-  SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayHeight));
 
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(InfotronsNeeded));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(KillMurphyFlag));
@@ -157,8 +106,6 @@ void SaveEngineSnapshotValues_SP()
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScratchGravity));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GravityFlag));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(SnikSnaksElectronsFrozen));
-  SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(UpdateTimeFlag));
-  SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(UpdatedFlag));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YellowDisksExploded));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YawnSleepCounter));