X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2Finit.c;h=8c77d306dfeef8b2401d3baf505bcd45b19d6d40;hb=fe43dcf8ac7fb16e80d60a0c187bcbd65f40b5f2;hp=76e690e159383f53e07bf4ed2f47acf9756c9ba5;hpb=f926e522aef77158e0011ae5ad2cf8805509d6d1;p=rocksndiamonds.git diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 76e690e1..8c77d306 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -3,68 +3,90 @@ #include "global.h" -Bitmap *sp_objects; - -Bitmap *screenBitmap; +char *preceding_playfield_memory[] = +{ + "95 89 95 89 95 89 3b 8a 3b 8a 3b 8a 3b 8a 3b 8a", // |......;.;.;.;.;.| + "3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a e8 8a e8 8a", // |;.;.;.è.è.è.è.è.| + "e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b b1 8b b1 8b", // |è.è.è.±.±.±.±.±.| + "b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c 85 8c 85 8c", // |±.±.±...........| + "85 8c 85 8c 85 8c 5b 8d 5b 8d 5b 8d 5b 8d 5b 8d", // |......[.[.[.[.[.| + "5b 8d 5b 8d 5b 8d 06 8e 06 8e 06 8e 06 8e 06 8e", // |[.[.[...........| + "06 8e 06 8e 06 8e ac 8e ac 8e ac 8e ac 8e ac 8e", // |......¬.¬.¬.¬.¬.| + "ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f 59 8f 59 8f", // |¬.¬.¬.Y.Y.Y.Y.Y.| + "59 8f 59 8f 59 8f 00 00 70 13 00 00 00 00 e8 17", // |Y.Y.Y...p.....è.| + "00 00 00 00 00 00 69 38 00 00 00 00 00 00 00 00", // |......i8........| + "00 00 00 00 00 00 00 00 d0 86 00 00 b2 34 00 00", // |........Ð...²4..| + "00 00 00 00 00 00 8f 8b 1d 34 00 00 00 00 00 00", // |.........4......| + "00 00 00 00 23 39 09 09 00 0c 00 08 00 58 00 00", // |....#9.......X..| + "00 00 00 25 77 06 7f 00 00 00 01 00 00 00 00 00", // |...%w...........| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 ec 06 26 05 00 00 00", // |.........ì.&....| + "00 00 00 01 00 00 00 00 31 32 33 34 35 36 37 38", // |........12345678| + "39 30 2d 00 08 00 51 57 45 52 54 59 55 49 4f 50", // |90-...QWERTYUIOP| + "00 00 0a 00 41 53 44 46 47 48 4a 4b 4c 00 00 00", // |....ASDFGHJKL...| + "00 00 5a 58 43 56 42 4e 4d 00 00 00 00 00 00 20", // |..ZXCVBNM...... | + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 2e 00 1e 00 31 00 14 00 39 00", // |..........1...9.| + "1f 00 14 00 18 00 ff ff 01 00 01 4c 45 56 45 4c", // |......ÿÿ...LEVEL| + "53 2e 44 41 54 00 00 00 00 00 00 00 00 00 00 00", // |S.DAT...........| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + + NULL +}; + + +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; - - StretchedSprites.BltEx = &DDSpriteBuffer_BltEx; - StretchedSprites.BltImg = &DDSpriteBuffer_BltImg; + Form_Load(); } -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 InitPrecedingPlayfieldMemory() { - init_struct_functions(); - init_global_values(); - - Form_Load(); - - SetBitmaps_SP(&sp_objects); + int preceding_buffer_size = 0; + int i; -#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 + for (i = 0; preceding_playfield_memory[i] != NULL; i++) + preceding_buffer_size += 8; /* eight 16-bit integer values */ - DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16); + game_sp.preceding_buffer = preceding_playfield_memory; + game_sp.preceding_buffer_size = preceding_buffer_size; } -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; @@ -72,10 +94,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 +102,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 +148,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 +168,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));