struct GameInfo_EM
{
+ unsigned int random;
+
boolean level_solved;
boolean game_over;
struct EngineSnapshotInfo_EM
{
struct GameInfo_EM game_em;
- unsigned int RandomEM;
struct LOGIC lev;
struct PLAYER ply[MAX_PLAYERS];
+
+ int frame;
int screen_x;
int screen_y;
- int frame;
};
#include "main_em.h"
+
+/* global variables */
+
extern int frame;
+extern int screen_x, screen_y;
+
-/* all global function prototypes */
+/* global function prototypes */
void readjoy(byte, struct PLAYER *);
int simple_rnd = GetSimpleRandom(1000);
int i;
- for (i = 0; i < simple_rnd || RandomEM == NEW_RANDOMIZE; i++)
- RandomEM = RandomEM * 129 + 1;
+ for (i = 0; i < simple_rnd || game_em.random == NEW_RANDOMIZE; i++)
+ game_em.random = game_em.random * 129 + 1;
- seed = RandomEM;
+ seed = game_em.random;
}
- RandomEM = seed;
+ game_em.random = seed;
- return (unsigned int) seed;
+ return (unsigned int)seed;
}
#include "main_em.h"
-unsigned int RandomEM;
-
struct CAVE cav;
struct LOGIC lev;
struct PLAYER ply[MAX_PLAYERS];
-extern int screen_x;
-extern int screen_y;
-
struct EngineSnapshotInfo_EM engine_snapshot_em;
void game_init_random(void)
{
- RandomEM = 1684108901;
+ game_em.random = 1684108901;
}
void game_init_cave_buffers(void)
int i;
boolean any_player_dropping = FALSE;
- RandomEM = RandomEM * 129 + 1;
+ game_em.random = game_em.random * 129 + 1;
frame = (frame - 1) & 7;
engine_snapshot_em.game_em = game_em;
engine_snapshot_em.lev = lev;
- engine_snapshot_em.RandomEM = RandomEM;
engine_snapshot_em.frame = frame;
-
engine_snapshot_em.screen_x = screen_x;
engine_snapshot_em.screen_y = screen_y;
game_em = engine_snapshot_em.game_em;
lev = engine_snapshot_em.lev;
- RandomEM = engine_snapshot_em.RandomEM;
frame = engine_snapshot_em.frame;
-
screen_x = engine_snapshot_em.screen_x;
screen_y = engine_snapshot_em.screen_y;
ply->dynamite_cnt = 0;
}
- RandomEM += 7; /* be a bit more random if the player doesn't move */
+ /* be a bit more random if the player doesn't move */
+ game_em.random += 7;
return;
}
ply[i].anim = PLY_still;
}
- start_check_nr = (RandomEM & 128 ? 0 : 1) * 2 + (RandomEM & 256 ? 0 : 1);
+ start_check_nr = ((game_em.random & 128 ? 0 : 1) * 2 +
+ (game_em.random & 256 ? 0 : 1));
for (i = 0; i < MAX_PLAYERS; i++)
{
next = lev.next;
boom = lev.boom;
- seed = RandomEM;
+ seed = game_em.random;
score = 0;
for (y = lev.top; y < lev.bottom; y++)
else
game_em.game_over = TRUE;
- RandomEM = seed;
+ game_em.random = seed;
/* triple buffering */
void *temp = lev.cave;
/* grow amoeba */
- random = RandomEM;
+ random = game_em.random;
for (count = lev.amoeba_time; count--;)
{
random = random * 129 + 1;
}
- RandomEM = random;
+ game_em.random = random;
/* handle explosions */
// exported variables
// ----------------------------------------------------------------------------
-extern unsigned int RandomEM;
-
extern struct CAVE cav;
extern struct LOGIC lev;
extern struct PLAYER ply[MAX_PLAYERS];