X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2Finit.c;h=e728c9a74e3c9e3a866cbe47c942475dd8591651;hb=HEAD;hp=af364aca8aa914db1210c3ec9d17215fde215962;hpb=2558f6e933a3b70682bd2437c00065842bd3cf2c;p=rocksndiamonds.git diff --git a/src/game_sp/init.c b/src/game_sp/init.c index af364aca..e728c9a7 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -57,28 +57,29 @@ Bitmap *bitmap_db_field_sp; struct EngineSnapshotInfo_SP engine_snapshot_sp; -void sp_open_all() +void sp_open_all(void) { Form_Load(); } -void sp_close_all() +void sp_close_all(void) { + FreeGlobals(); } -void InitPrecedingPlayfieldMemory() +void InitPrecedingPlayfieldMemory(void) { int preceding_buffer_size = 0; int i; for (i = 0; preceding_playfield_memory[i] != NULL; i++) - preceding_buffer_size += 8; /* eight 16-bit integer values */ + preceding_buffer_size += 8; // eight 16-bit integer values game_sp.preceding_buffer = preceding_playfield_memory; game_sp.preceding_buffer_size = preceding_buffer_size; } -void InitGfxBuffers_SP() +void InitGfxBuffers_SP(void) { ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE); } @@ -98,9 +99,9 @@ unsigned int InitEngineRandom_SP(int seed) } -/* ------------------------------------------------------------------------- */ -/* Supaplex game engine snapshot handling functions */ -/* ------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------- +// Supaplex game engine snapshot handling functions +// ---------------------------------------------------------------------------- void SaveEngineSnapshotValues_SP(ListNode **buffers) { @@ -108,7 +109,7 @@ void SaveEngineSnapshotValues_SP(ListNode **buffers) engine_snapshot_sp.game_sp = game_sp; - /* these arrays have playfield-size dependent variable size */ + // these arrays have playfield-size dependent variable size for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++) engine_snapshot_sp.PlayField16[i] = PlayField16[i]; @@ -124,7 +125,7 @@ void SaveEngineSnapshotValues_SP(ListNode **buffers) for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++) engine_snapshot_sp.TerminalState[i] = TerminalState[i]; - /* store special data into engine snapshot buffers */ + // store special data into engine snapshot buffers SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FieldWidth)); SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FieldHeight)); @@ -177,7 +178,7 @@ void SaveEngineSnapshotValues_SP(ListNode **buffers) SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxElementLast)); SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphicLast)); SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphic)); - SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxFrame)); + SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxFrameSP)); SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinX)); SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinY)); @@ -192,15 +193,15 @@ void SaveEngineSnapshotValues_SP(ListNode **buffers) SaveEngineSnapshotValues_SP_Murphy(buffers); } -void LoadEngineSnapshotValues_SP() +void LoadEngineSnapshotValues_SP(void) { int i; - /* stored engine snapshot buffers already restored at this point */ + // stored engine snapshot buffers already restored at this point game_sp = engine_snapshot_sp.game_sp; - /* these arrays have playfield-size dependent variable size */ + // these arrays have playfield-size dependent variable size for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++) PlayField16[i] = engine_snapshot_sp.PlayField16[i];