projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20131210-1-src
[rocksndiamonds.git]
/
src
/
game_sp
/
file.c
diff --git
a/src/game_sp/file.c
b/src/game_sp/file.c
index cb5413b0c90df20028478a91f10de596fa8d1ef9..53eb22ff658d87fc08198add11aa7bc24d74f57b 100644
(file)
--- 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;
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;
/* (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);
#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
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++)
{
count = 0;
for (i = 0; game_sp.preceding_buffer[i] != NULL; i++)
{
@@
-288,7
+298,8
@@
static void LoadNativeLevelFromFileStream_SP(FILE *file, int width, int height,
}
}
}
}
-boolean LoadNativeLevel_SP(char *filename, int level_pos)
+boolean LoadNativeLevel_SP(char *filename, int level_pos,
+ boolean level_info_only)
{
FILE *file;
int i, l, x, y;
{
FILE *file;
int i, l, x, y;
@@
-314,7
+325,8
@@
boolean LoadNativeLevel_SP(char *filename, int level_pos)
if (!(file = fopen(filename, MODE_READ)))
{
if (!(file = fopen(filename, MODE_READ)))
{
- Error(ERR_WARN, "cannot open file '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot open file '%s' -- using empty level", filename);
return FALSE;
}
return FALSE;
}