projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed variable
[rocksndiamonds.git]
/
src
/
game_em
/
input.c
diff --git
a/src/game_em/input.c
b/src/game_em/input.c
index 9514b1f5d670cd6ac6537dad4ef7391bbaad2502..6eadbbdf0d2ca4aec9d50b6442e9270659aab066 100644
(file)
--- a/
src/game_em/input.c
+++ b/
src/game_em/input.c
@@
-6,42
+6,41
@@
#include "main_em.h"
#include "main_em.h"
-unsigned int RandomEM;
-
-struct LEVEL lev;
+struct CAVE cav;
+struct LOGIC lev;
struct PLAYER ply[MAX_PLAYERS];
struct PLAYER ply[MAX_PLAYERS];
-extern int screen_x;
-extern int screen_y;
-
struct EngineSnapshotInfo_EM engine_snapshot_em;
struct EngineSnapshotInfo_EM engine_snapshot_em;
-void game_init_
vars
(void)
+void game_init_
random
(void)
{
{
- int x, y;
+ game_em.random = 1684108901;
+}
- RandomEM = 1684108901;
+void game_init_cave_buffers(void)
+{
+ int x, y;
- for (y = 0; y < HEIGHT; y++)
- for (x = 0; x < WIDTH; x++)
+ for (y = 0; y <
CAVE_BUFFER_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_BUFFER_
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_BUFFER_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_BUFFER_
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_BUFFER_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_BUFFER_
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_BUFFER_
HEIGHT; y++)
+ for (x = 0; x <
CAVE_BUFFER_
WIDTH; x++)
lev.boombuf[x][y] = Xblank;
lev.boombuf[x][y] = Xblank;
- for (x = 0; x < WIDTH; x++)
+ for (x = 0; x <
CAVE_BUFFER_
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_BUFFER_
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_BUFFER_
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_BUFFER_
WIDTH; x++)
lev.boomcol[x] = lev.boombuf[x];
lev.cave = lev.cavecol;
lev.boomcol[x] = lev.boombuf[x];
lev.cave = lev.cavecol;
@@
-68,7
+67,7
@@
void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode)
int i;
boolean any_player_dropping = FALSE;
int i;
boolean any_player_dropping = FALSE;
-
RandomEM = RandomEM
* 129 + 1;
+
game_em.random = game_em.random
* 129 + 1;
frame = (frame - 1) & 7;
frame = (frame - 1) & 7;
@@
-79,13
+78,13
@@
void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode)
if (frame == 7)
{
if (frame == 7)
{
- logic_
1
();
- logic_
2
();
+ logic_
players
();
+ logic_
objects
();
}
if (frame == 6)
{
}
if (frame == 6)
{
- logic_
3
();
+ logic_
globals
();
UpdateGameDoorValues_EM();
}
UpdateGameDoorValues_EM();
}
@@
-165,9
+164,7
@@
void SaveEngineSnapshotValues_EM(void)
engine_snapshot_em.game_em = game_em;
engine_snapshot_em.lev = lev;
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.frame = frame;
-
engine_snapshot_em.screen_x = screen_x;
engine_snapshot_em.screen_y = screen_y;
engine_snapshot_em.screen_x = screen_x;
engine_snapshot_em.screen_y = screen_y;
@@
-182,9
+179,7
@@
void LoadEngineSnapshotValues_EM(void)
game_em = engine_snapshot_em.game_em;
lev = engine_snapshot_em.lev;
game_em = engine_snapshot_em.game_em;
lev = engine_snapshot_em.lev;
- RandomEM = engine_snapshot_em.RandomEM;
frame = engine_snapshot_em.frame;
frame = engine_snapshot_em.frame;
-
screen_x = engine_snapshot_em.screen_x;
screen_y = engine_snapshot_em.screen_y;
screen_x = engine_snapshot_em.screen_x;
screen_y = engine_snapshot_em.screen_y;