X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2Finit.c;h=e728c9a74e3c9e3a866cbe47c942475dd8591651;hb=HEAD;hp=eb14398cc89fc797a5cb78076a5d3d384a6232e0;hpb=115ce6f2da1914d68b0fe0e5f9082973190dacdd;p=rocksndiamonds.git diff --git a/src/game_sp/init.c b/src/game_sp/init.c index eb14398c..e728c9a7 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -64,6 +64,7 @@ void sp_open_all(void) void sp_close_all(void) { + FreeGlobals(); } void InitPrecedingPlayfieldMemory(void) @@ -72,7 +73,7 @@ void InitPrecedingPlayfieldMemory(void) 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; @@ -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)); @@ -196,11 +197,11 @@ 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];