projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
099e6d8
)
moved initial cave data to level structure for EM engine
author
Holger Schemel
<info@artsoft.org>
Thu, 13 Feb 2020 01:04:22 +0000
(
02:04
+0100)
committer
Holger Schemel
<info@artsoft.org>
Tue, 19 May 2020 16:19:55 +0000
(18:19 +0200)
src/files.c
patch
|
blob
|
history
src/game_em/convert.c
patch
|
blob
|
history
src/game_em/emerald.h
patch
|
blob
|
history
src/game_em/export.h
patch
|
blob
|
history
src/game_em/reademc.c
patch
|
blob
|
history
diff --git
a/src/files.c
b/src/files.c
index b2856c69f4650af16f3307dfbf9312dccb7efe28..04151ff10bbecb90ec2f92ad7e11fddf32dfaf8b 100644
(file)
--- a/
src/files.c
+++ b/
src/files.c
@@
-3575,7
+3575,7
@@
static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level)
// first fill the complete playfield with the default border element
for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++)
for (x = 0; x < EM_MAX_CAVE_WIDTH; x++)
// first fill the complete playfield with the default border element
for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++)
for (x = 0; x < EM_MAX_CAVE_WIDTH; x++)
-
level_em->cave
[x][y] = Zborder;
+
cav->cave_raw
[x][y] = Zborder;
// then copy the real level contents from level file into the playfield
for (y = 0; y < cav->height; y++) for (x = 0; x < cav->width; x++)
// then copy the real level contents from level file into the playfield
for (y = 0; y < cav->height; y++) for (x = 0; x < cav->width; x++)
@@
-3585,7
+3585,7
@@
static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level)
if (level->field[x][y] == EL_AMOEBA_DEAD)
new_element = map_element_RND_to_EM(EL_AMOEBA_WET);
if (level->field[x][y] == EL_AMOEBA_DEAD)
new_element = map_element_RND_to_EM(EL_AMOEBA_WET);
-
level_em->cave
[x][y] = new_element;
+
cav->cave_raw
[x][y] = new_element;
}
for (i = 0; i < MAX_PLAYERS; i++)
}
for (i = 0; i < MAX_PLAYERS; i++)
@@
-3604,7
+3604,7
@@
static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level)
cav->player_x[player_nr] = x;
cav->player_y[player_nr] = y;
cav->player_x[player_nr] = x;
cav->player_y[player_nr] = y;
-
level_em->cave
[x][y] = map_element_RND_to_EM(EL_EMPTY);
+
cav->cave_raw
[x][y] = map_element_RND_to_EM(EL_EMPTY);
}
}
}
}
}
}
@@
-3684,7
+3684,7
@@
static void CopyNativeLevel_EM_to_RND(struct LevelInfo *level)
// convert the playfield (some elements need special treatment)
for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
{
// convert the playfield (some elements need special treatment)
for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
{
- int new_element = map_element_EM_to_RND(
level_em->cave
[x][y]);
+ int new_element = map_element_EM_to_RND(
cav->cave_raw
[x][y]);
if (new_element == EL_AMOEBA_WET && level->amoeba_speed == 0)
new_element = EL_AMOEBA_DEAD;
if (new_element == EL_AMOEBA_WET && level->amoeba_speed == 0)
new_element = EL_AMOEBA_DEAD;
diff --git
a/src/game_em/convert.c
b/src/game_em/convert.c
index 581c93eec2baf21fa797f2269a1afff8e74a29d7..56075c2bff4eb5edf744aee7a3930fa4e276ce73 100644
(file)
--- a/
src/game_em/convert.c
+++ b/
src/game_em/convert.c
@@
-38,7
+38,7
@@
void prepare_em_level(void)
for (x = 0; x < lev.width; x++)
for (y = 0; y < lev.height; y++)
for (x = 0; x < lev.width; x++)
for (y = 0; y < lev.height; y++)
- lev.cave[lev.left + x][lev.top + y] =
native_em_level.cave
[x][y];
+ lev.cave[lev.left + x][lev.top + y] =
lev.cave_raw
[x][y];
for (x = lev.left; x < lev.right; x++)
for (y = lev.top; y < lev.bottom; y++)
for (x = lev.left; x < lev.right; x++)
for (y = lev.top; y < lev.bottom; y++)
@@
-114,7
+114,7
@@
void prepare_em_level(void)
int x = lev.player_x[i];
int y = lev.player_y[i];
int x = lev.player_x[i];
int y = lev.player_y[i];
-
native_em_level.cave
[x][y] = Xblank;
+
lev.cave_raw
[x][y] = Xblank;
lev.cave[lev.left + x][lev.top + y] = Xblank;
lev.next[lev.left + x][lev.top + y] = Xblank;
lev.cave[lev.left + x][lev.top + y] = Xblank;
lev.next[lev.left + x][lev.top + y] = Xblank;
diff --git
a/src/game_em/emerald.h
b/src/game_em/emerald.h
index 7806f3e6a3b7de48b0e1d18d94a74c20a4fb44bc..8e17761d8785402c1b32625cedcbf1b7565837c7 100644
(file)
--- a/
src/game_em/emerald.h
+++ b/
src/game_em/emerald.h
@@
-707,6
+707,8
@@
struct LEVEL
short ball_array[8][8]; /* ball data */
short android_array[TILE_MAX]; /* android clone table */
short ball_array[8][8]; /* ball data */
short android_array[TILE_MAX]; /* android clone table */
+ short cave_raw[CAVE_WIDTH][CAVE_HEIGHT];
+
short cavebuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short nextbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short drawbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short cavebuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short nextbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short drawbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
diff --git
a/src/game_em/export.h
b/src/game_em/export.h
index 7379479f29c5a26f6b5d46c62bd3a9bef08d559c..a1a0d10bd8b921f99ef243efcfacc16a7ccbc500 100644
(file)
--- a/
src/game_em/export.h
+++ b/
src/game_em/export.h
@@
-47,8
+47,6
@@
struct LevelInfo_EM
{
int file_version;
{
int file_version;
- short cave[CAVE_WIDTH][CAVE_HEIGHT];
-
struct LEVEL *cav;
};
struct LEVEL *cav;
};
diff --git
a/src/game_em/reademc.c
b/src/game_em/reademc.c
index f8f101242368bd9056c950732b8ff2aeaa3ae14e..ed86409be6b36cb92cb6dfa944128cd105b2396b 100644
(file)
--- a/
src/game_em/reademc.c
+++ b/
src/game_em/reademc.c
@@
-456,18
+456,18
@@
void convert_em_level(unsigned char *src, int file_version)
/* first fill the complete playfield with the default border element */
for (y = 0; y < CAVE_HEIGHT; y++)
for (x = 0; x < CAVE_WIDTH; x++)
/* first fill the complete playfield with the default border element */
for (y = 0; y < CAVE_HEIGHT; y++)
for (x = 0; x < CAVE_WIDTH; x++)
-
native_em_level.cave
[x][y] = Zborder;
+
lev.cave_raw
[x][y] = Zborder;
/* then copy the real level contents from level file into the playfield */
temp = 0;
for (y = 0; y < lev.height; y++)
for (x = 0; x < lev.width; x++)
/* then copy the real level contents from level file into the playfield */
temp = 0;
for (y = 0; y < lev.height; y++)
for (x = 0; x < lev.width; x++)
-
native_em_level.cave
[x][y] = map_emc[src[temp++]];
+
lev.cave_raw
[x][y] = map_emc[src[temp++]];
/* at last, set the two players at their positions in the playfield */
/* (native EM[C] levels always have exactly two players in a level) */
for (i = 0; i < 2; i++)
/* at last, set the two players at their positions in the playfield */
/* (native EM[C] levels always have exactly two players in a level) */
for (i = 0; i < 2; i++)
-
native_em_level.cave
[lev.player_x[i]][lev.player_y[i]] = Zplayer;
+
lev.cave_raw
[lev.player_x[i]][lev.player_y[i]] = Zplayer;
native_em_level.file_version = file_version;
}
native_em_level.file_version = file_version;
}