X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame_sp%2Finit.c;h=a8e672769bc70bac22bb95f7ade02ee9a71af9de;hb=41def9c1d8c6939b8754fdab43579272e49d4da4;hp=76e690e159383f53e07bf4ed2f47acf9756c9ba5;hpb=f926e522aef77158e0011ae5ad2cf8805509d6d1;p=rocksndiamonds.git diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 76e690e1..a8e67276 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -3,68 +3,53 @@ #include "global.h" -Bitmap *sp_objects; - -Bitmap *screenBitmap; +Bitmap *bitmap_db_field_sp; struct EngineSnapshotInfo_SP engine_snapshot_sp; -static void init_struct_functions() +void sp_open_all() { - Stage.Blt = &DDScrollBuffer_Blt; - Stage.ScrollTo = &DDScrollBuffer_ScrollTo; - Stage.ScrollTowards = &DDScrollBuffer_ScrollTowards; - Stage.SoftScrollTo = &DDScrollBuffer_SoftScrollTo; + Form_Load(); + +#if 0 + printf("::: open 1: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp); + + /* + bitmap_db_field_sp = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); + bitmap_db_field_sp = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, + DEFAULT_DEPTH); + */ + + ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH); - StretchedSprites.BltEx = &DDSpriteBuffer_BltEx; - StretchedSprites.BltImg = &DDSpriteBuffer_BltImg; + printf("::: open 2: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp); +#endif } -static void init_global_values() +void sp_close_all() { - 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() +void InitGfxBuffers_SP() { - init_struct_functions(); - init_global_values(); +#if 1 + printf("::: init 1: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp); - Form_Load(); + /* + ReCreateBitmap(&bitmap_db_field_sp, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, + DEFAULT_DEPTH); + */ - SetBitmaps_SP(&sp_objects); + ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH); -#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); + printf("::: init 2: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp); #endif - - DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16); -} - -void sp_close_all() -{ } unsigned int InitEngineRandom_SP(long seed) { if (seed == NEW_RANDOMIZE) { -#if 0 - printf("::: init.c: InitEngineRandom_SP(): subRandomize()\n"); -#endif - subRandomize(); seed = (long)RandomSeed; @@ -72,10 +57,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; } @@ -84,8 +65,6 @@ unsigned int InitEngineRandom_SP(long seed) /* Supaplex game engine snapshot handling functions */ /* ------------------------------------------------------------------------- */ -static ListNode *engine_snapshot_list_sp = NULL; - void SaveEngineSnapshotValues_SP() { int i; @@ -132,8 +111,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)); @@ -154,8 +131,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));