X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2Ffile.c;h=27cb452a08136c6e8a8a0934a4bac64efb35f19c;hp=cb5413b0c90df20028478a91f10de596fa8d1ef9;hb=c60227514289cd7d512539785bb2fe47d30db51a;hpb=1e422c29292f0583391b0ce9e9c872b38f035ac0 diff --git a/src/game_sp/file.c b/src/game_sp/file.c index cb5413b0..27cb452a 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -72,8 +72,10 @@ void copyInternalEngineVars_SP() FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1; LevelMax = (FieldWidth * FieldHeight) - 1; +#if 0 /* (add one byte for the level number stored as first byte of demo data) */ FileMax = FieldMax + native_sp_level.demo.length + 1; +#endif #if 0 PlayField8 = REDIM_1D(sizeof(byte), 0, FileMax); @@ -81,6 +83,14 @@ void copyInternalEngineVars_SP() PlayField16 = REDIM_1D(sizeof(int), -game_sp.preceding_buffer_size, FieldMax); #endif + /* initialize preceding playfield buffer */ + for (i = -game_sp.preceding_buffer_size; i < 0; i++) + PlayField16[i] = 0; + + /* initialize preceding playfield buffer */ + for (i = -SP_MAX_PLAYFIELD_WIDTH; i < 0; i++) + PlayField8[i] = 0; + count = 0; for (i = 0; game_sp.preceding_buffer[i] != NULL; i++) {