projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed graphical bugs when using background graphics on menu screens
[rocksndiamonds.git]
/
src
/
game_em
/
reademc.c
diff --git
a/src/game_em/reademc.c
b/src/game_em/reademc.c
index f93310309df3fa452c6f2b943ee6b78e3ad9eb40..48eb9121c9dfabff3a301a53cdc7fc335d3513f5 100644
(file)
--- a/
src/game_em/reademc.c
+++ b/
src/game_em/reademc.c
@@
-299,8
+299,6
@@
void convert_em_level(unsigned char *src, int file_version)
cav.time_seconds = MIN(GET_BE16(src[2110]), 9999);
cav.gems_needed = src[2095];
cav.time_seconds = MIN(GET_BE16(src[2110]), 9999);
cav.gems_needed = src[2095];
- cav.infinite = game_em.use_wrap_around;
- cav.testmode = FALSE;
cav.teamwork = (src[2150] & 128) != 0;
/* scores */
cav.teamwork = (src[2150] & 128) != 0;
/* scores */
@@
-314,7
+312,7
@@
void convert_em_level(unsigned char *src, int file_version)
cav.nut_score = src[2090];
cav.dynamite_score = src[2091];
cav.key_score = src[2092];
cav.nut_score = src[2090];
cav.dynamite_score = src[2091];
cav.key_score = src[2092];
- cav.exit_score = src[2093]
* 8 / 5
;
+ cav.exit_score = src[2093];
cav.lenses_score = src[2151];
cav.magnify_score = src[2152];
cav.lenses_score = src[2151];
cav.magnify_score = src[2152];
@@
-393,6
+391,9
@@
void convert_em_level(unsigned char *src, int file_version)
for (x = 0; x < 9; x++)
cav.eater_array[i][x] = map_emc[src[eater_offset[i] + x]];
for (x = 0; x < 9; x++)
cav.eater_array[i][x] = map_emc[src[eater_offset[i] + x]];
+ if (file_version < FILE_VERSION_EM_V6)
+ cav.num_eater_arrays = 4;
+
/* ball */
temp = map_emc[src[2159]];
/* ball */
temp = map_emc[src[2159]];
@@
-555,12
+556,12
@@
static const unsigned char map_v4[256] =
240,241,153,153, 153,153,153,153, 153,153,153,153, 153,153,153,153 // 240
};
240,241,153,153, 153,153,153,153, 153,153,153,153, 153,153,153,153 // 240
};
-static const unsigned char map_v4_eater[
32
] =
+static const unsigned char map_v4_eater[
28
] =
{
/* filter for v4 eater */
128,18,2,0, 4,8,16,20, 28,37,41,45, 189,180,179,252, // 0
{
/* filter for v4 eater */
128,18,2,0, 4,8,16,20, 28,37,41,45, 189,180,179,252, // 0
- 133,134,135,136, 146,147,175,65, 66,64,2,18
, 128,128,128,128
// 16
+ 133,134,135,136, 146,147,175,65, 66,64,2,18
// 16
};
static boolean filename_has_v1_format(char *filename)
};
static boolean filename_has_v1_format(char *filename)
@@
-673,7
+674,7
@@
int cleanup_em_level(unsigned char *src, int length, char *filename)
for (i = 0; i < 2048; i++) /* cave */
src[i] = map_v4[src[i]];
for (i = 2048; i < 2084; i++) /* eaters */
for (i = 0; i < 2048; i++) /* cave */
src[i] = map_v4[src[i]];
for (i = 2048; i < 2084; i++) /* eaters */
- src[i] = map_v4_eater[src[i]
% 32
];
+ src[i] = map_v4_eater[src[i]
< 28 ? src[i] : 0
];
for (i = 2112; i < 2148; i++) /* eaters */
src[i] = src[i - 64];
for (i = 2112; i < 2148; i++) /* eaters */
src[i] = src[i - 64];
@@
-690,8
+691,7
@@
int cleanup_em_level(unsigned char *src, int length, char *filename)
/* if file has length of old-style level file, print (wrong) magic byte */
if (length < 2110)
/* if file has length of old-style level file, print (wrong) magic byte */
if (length < 2110)
- Error(ERR_WARN, "unknown magic byte 0x%02x at position 0x%04x",
- src[1983], 1983);
+ Warn("unknown magic byte 0x%02x at position 0x%04x", src[1983], 1983);
return FILE_VERSION_EM_UNKNOWN;
}
return FILE_VERSION_EM_UNKNOWN;
}
@@
-784,8
+784,7
@@
int cleanup_em_level(unsigned char *src, int length, char *filename)
/* size of v6 cave */
length = 2172;
/* size of v6 cave */
length = 2172;
- if (options.debug)
- Error(ERR_DEBUG, "EM level file version: %d", file_version);
+ Debug("level:native:EM", "EM level file version: %d", file_version);
return file_version;
}
return file_version;
}
@@
-802,7
+801,7
@@
if(len >= 2110 && (buf[2106] == 255 && buf[2107] == 53 && buf[2108] == 48 && buf
if(len >= 2106 && (buf[1983] == 116 || buf[2047] == 116)) // v4
if(len >= 2106 && (buf[1983] == 27 || buf[2047] == 219)) // v3
if(len >= 2106 && (buf[1983] == 116 || buf[2047] == 116)) // v4
if(len >= 2106 && (buf[1983] == 27 || buf[2047] == 219)) // v3
-buf[0]
=241;buf[1]=248;for(i=0,j=101;i<2106;i++,j+=7)buf[i]=(buf[i]^j)-
17; // decrypt
+buf[0]
= 241; buf[1] = 248; for(i = 0, j = 101; i < 2106; i++, j += 7) buf[i] = (buf[i] ^ j) -
17; // decrypt
number of movements (calls to logic) = time * 50 / 8
number of movements (calls to logic) = time * 50 / 8