projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8d8ab8e
)
cleanup of EM engine cave size definition names
author
Holger Schemel
<info@artsoft.org>
Wed, 29 Jan 2020 14:33:51 +0000
(15:33 +0100)
committer
Holger Schemel
<info@artsoft.org>
Tue, 19 May 2020 16:12:57 +0000
(18:12 +0200)
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/graphics.c
patch
|
blob
|
history
src/game_em/input.c
patch
|
blob
|
history
src/game_em/logic.c
patch
|
blob
|
history
src/game_em/main_em.h
patch
|
blob
|
history
diff --git
a/src/game_em/convert.c
b/src/game_em/convert.c
index 04f46309041a592357ea277fd2a44070f4f319a4..dd2209009446fb5c04e021c40edc83a453cb4325 100644
(file)
--- a/
src/game_em/convert.c
+++ b/
src/game_em/convert.c
@@
-911,8
+911,8
@@
void convert_em_level(unsigned char *src, int file_version)
}
/* first fill the complete playfield with the default border element */
}
/* first fill the complete playfield with the default border element */
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
native_em_level.cave[x][y] = Zborder;
/* then copy the real level contents from level file into the playfield */
native_em_level.cave[x][y] = Zborder;
/* then copy the real level contents from level file into the playfield */
@@
-938,16
+938,16
@@
void prepare_em_level(void)
/* reset all runtime variables to their initial values */
/* reset all runtime variables to their initial values */
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.cave[x][y] = native_em_level.cave[x][y];
lev.cave[x][y] = native_em_level.cave[x][y];
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.next[x][y] = lev.cave[x][y];
lev.next[x][y] = lev.cave[x][y];
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.draw[x][y] = lev.cave[x][y];
lev.time_initial = lev.time_seconds;
lev.draw[x][y] = lev.cave[x][y];
lev.time_initial = lev.time_seconds;
diff --git
a/src/game_em/emerald.h
b/src/game_em/emerald.h
index fe90d7937deefb3a236d8baa81a9e4f900b6940b..1cf3deffc07d50d5ab76af5f8b7f31234ed88c89 100644
(file)
--- a/
src/game_em/emerald.h
+++ b/
src/game_em/emerald.h
@@
-52,8
+52,8
@@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
/* one border for Zborder elements, one border for steelwall, if needed */
#define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
/* one border for Zborder elements, one border for steelwall, if needed */
-#define
EM_MAX_CAVE_WIDTH
(MAX_PLAYFIELD_WIDTH + 2 + 2)
-#define
EM_MAX_CAVE_HEIGHT
(MAX_PLAYFIELD_HEIGHT + 2 + 2)
+#define
CAVE_WIDTH
(MAX_PLAYFIELD_WIDTH + 2 + 2)
+#define
CAVE_HEIGHT
(MAX_PLAYFIELD_HEIGHT + 2 + 2)
/*
-----------------------------------------------------------------------------
/*
-----------------------------------------------------------------------------
@@
-701,15
+701,15
@@
struct LEVEL
int exit_x, exit_y; /* kludge for playing player exit sound */
int exit_x, exit_y; /* kludge for playing player exit sound */
- short cavebuf[
EM_MAX_CAVE_WIDTH][EM_MAX_
CAVE_HEIGHT];
- short nextbuf[
EM_MAX_CAVE_WIDTH][EM_MAX_
CAVE_HEIGHT];
- short drawbuf[
EM_MAX_CAVE_WIDTH][EM_MAX_
CAVE_HEIGHT];
- short boombuf[
EM_MAX_CAVE_WIDTH][EM_MAX_
CAVE_HEIGHT];
+ short cavebuf[
CAVE_WIDTH][
CAVE_HEIGHT];
+ short nextbuf[
CAVE_WIDTH][
CAVE_HEIGHT];
+ short drawbuf[
CAVE_WIDTH][
CAVE_HEIGHT];
+ short boombuf[
CAVE_WIDTH][
CAVE_HEIGHT];
- short *cavecol[
EM_MAX_
CAVE_WIDTH];
- short *nextcol[
EM_MAX_
CAVE_WIDTH];
- short *drawcol[
EM_MAX_
CAVE_WIDTH];
- short *boomcol[
EM_MAX_
CAVE_WIDTH];
+ short *cavecol[CAVE_WIDTH];
+ short *nextcol[CAVE_WIDTH];
+ short *drawcol[CAVE_WIDTH];
+ short *boomcol[CAVE_WIDTH];
short **cave;
short **next;
short **cave;
short **next;
diff --git
a/src/game_em/export.h
b/src/game_em/export.h
index 7601a909a31885a5aff60c0458e055a876b72880..9c0ff052e828810d0a782c9453610ec00ac4dcdb 100644
(file)
--- a/
src/game_em/export.h
+++ b/
src/game_em/export.h
@@
-8,6
+8,14
@@
#include "emerald.h"
#include "emerald.h"
+// ----------------------------------------------------------------------------
+// constant definitions
+// ----------------------------------------------------------------------------
+
+#define EM_MAX_CAVE_WIDTH CAVE_WIDTH
+#define EM_MAX_CAVE_HEIGHT CAVE_HEIGHT
+
+
// ----------------------------------------------------------------------------
// exported structures
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// exported structures
// ----------------------------------------------------------------------------
@@
-36,7
+44,7
@@
struct LevelInfo_EM
{
int file_version;
{
int file_version;
- short cave[
EM_MAX_CAVE_WIDTH][EM_MAX_
CAVE_HEIGHT];
+ short cave[
CAVE_WIDTH][
CAVE_HEIGHT];
struct LEVEL *lev;
struct PLAYER *ply[MAX_PLAYERS];
struct LEVEL *lev;
struct PLAYER *ply[MAX_PLAYERS];
diff --git
a/src/game_em/graphics.c
b/src/game_em/graphics.c
index 0f763382d5b333d2ae273c300e920df477a863f4..c6c1d5428496dbe0b89699251ca694dfbe2a7e96 100644
(file)
--- a/
src/game_em/graphics.c
+++ b/
src/game_em/graphics.c
@@
-300,8
+300,8
@@
static void animscreen(void)
};
if (!game.use_native_emc_graphics_engine)
};
if (!game.use_native_emc_graphics_engine)
- for (y = 2; y <
EM_MAX_
CAVE_HEIGHT - 2; y++)
- for (x = 2; x <
EM_MAX_
CAVE_WIDTH - 2; x++)
+ for (y = 2; y < CAVE_HEIGHT - 2; y++)
+ for (x = 2; x < CAVE_WIDTH - 2; x++)
SetGfxAnimation_EM(&graphic_info_em_object[lev.draw[x][y]][frame],
lev.draw[x][y], 7 - frame, x - 2, y - 2);
SetGfxAnimation_EM(&graphic_info_em_object[lev.draw[x][y]][frame],
lev.draw[x][y], 7 - frame, x - 2, y - 2);
@@
-326,8
+326,8
@@
static void animscreen(void)
int yy = y + xy[i][1];
int tile_next;
int yy = y + xy[i][1];
int tile_next;
- if (xx < 0 || xx >=
EM_MAX_
CAVE_WIDTH ||
- yy < 0 || yy >=
EM_MAX_
CAVE_HEIGHT)
+ if (xx < 0 || xx >= CAVE_WIDTH ||
+ yy < 0 || yy >= CAVE_HEIGHT)
continue;
tile_next = lev.draw[xx][yy];
continue;
tile_next = lev.draw[xx][yy];
diff --git
a/src/game_em/input.c
b/src/game_em/input.c
index 9514b1f5d670cd6ac6537dad4ef7391bbaad2502..3883bbda97a3bf0fadaf3ecda9eb4f75dd1c6d9d 100644
(file)
--- a/
src/game_em/input.c
+++ b/
src/game_em/input.c
@@
-22,26
+22,26
@@
void game_init_vars(void)
RandomEM = 1684108901;
RandomEM = 1684108901;
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.cavebuf[x][y] = Zborder;
lev.cavebuf[x][y] = Zborder;
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.nextbuf[x][y] = Zborder;
lev.nextbuf[x][y] = Zborder;
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.drawbuf[x][y] = Zborder;
lev.drawbuf[x][y] = Zborder;
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.boombuf[x][y] = Xblank;
lev.boombuf[x][y] = Xblank;
- for (x = 0; x < WIDTH; x++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.cavecol[x] = lev.cavebuf[x];
lev.cavecol[x] = lev.cavebuf[x];
- for (x = 0; x < WIDTH; x++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.nextcol[x] = lev.nextbuf[x];
lev.nextcol[x] = lev.nextbuf[x];
- for (x = 0; x < WIDTH; x++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.drawcol[x] = lev.drawbuf[x];
lev.drawcol[x] = lev.drawbuf[x];
- for (x = 0; x < WIDTH; x++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
lev.boomcol[x] = lev.boombuf[x];
lev.cave = lev.cavecol;
lev.boomcol[x] = lev.boombuf[x];
lev.cave = lev.cavecol;
diff --git
a/src/game_em/logic.c
b/src/game_em/logic.c
index bcaf88c82f72b3bfcc7ea52ca4e3110dfddd459a..da397d56e98a1c38c23f508f26ea32b917b7c242 100644
(file)
--- a/
src/game_em/logic.c
+++ b/
src/game_em/logic.c
@@
-1228,7
+1228,7
@@
static void check_player(struct PLAYER *ply)
static void set_nearest_player_xy(int x, int y, int *dx, int *dy)
{
static void set_nearest_player_xy(int x, int y, int *dx, int *dy)
{
- int distance, distance_shortest =
EM_MAX_CAVE_WIDTH + EM_MAX_
CAVE_HEIGHT;
+ int distance, distance_shortest =
CAVE_WIDTH +
CAVE_HEIGHT;
int i;
/* default values if no players are alive anymore */
int i;
/* default values if no players are alive anymore */
@@
-6273,8
+6273,8
@@
void logic_2(void)
seed = RandomEM;
score = 0;
seed = RandomEM;
score = 0;
- for (y = 1; y < HEIGHT - 1; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 1; y <
CAVE_
HEIGHT - 1; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
handle_tile(x, y);
if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive)
handle_tile(x, y);
if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive)
@@
-6334,8
+6334,8
@@
void logic_3(void)
for (count = lev.amoeba_time; count--;)
{
for (count = lev.amoeba_time; count--;)
{
- x = (random >> 10) % (WIDTH - 2);
- y = (random >> 20) % (HEIGHT - 2);
+ x = (random >> 10) % (
CAVE_
WIDTH - 2);
+ y = (random >> 20) % (
CAVE_
HEIGHT - 2);
Lamoeba(x, y);
Lamoeba(x, y);
@@
-6346,13
+6346,13
@@
void logic_3(void)
/* handle explosions */
/* handle explosions */
- for (y = 1; y < HEIGHT - 1; y++)
- for (x = 1; x < WIDTH - 1; x++)
+ for (y = 1; y <
CAVE_
HEIGHT - 1; y++)
+ for (x = 1; x <
CAVE_
WIDTH - 1; x++)
Lexplode(x, y);
/* triple buffering */
Lexplode(x, y);
/* triple buffering */
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_
WIDTH; x++)
next[x][y] = cave[x][y];
}
next[x][y] = cave[x][y];
}
diff --git
a/src/game_em/main_em.h
b/src/game_em/main_em.h
index 171b8668aa94d829cda554697a3ea5605db09113..ac00b4237c3cefe0e19f48525ed827df9ec05fff 100644
(file)
--- a/
src/game_em/main_em.h
+++ b/
src/game_em/main_em.h
@@
-37,11
+37,6
@@
#define FILE_VERSION_EM_ACTUAL FILE_VERSION_EM_V6
#define FILE_VERSION_EM_ACTUAL FILE_VERSION_EM_V6
-/* level sizes and positions for EM engine */
-
-#define WIDTH EM_MAX_CAVE_WIDTH
-#define HEIGHT EM_MAX_CAVE_HEIGHT
-
/* screen sizes and positions for EM engine */
#define TILESIZE 32
/* screen sizes and positions for EM engine */
#define TILESIZE 32