projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed printing game tile information to console and log file
[rocksndiamonds.git]
/
src
/
game_em
/
game.c
diff --git
a/src/game_em/game.c
b/src/game_em/game.c
index 38016ef7b16fe1c15681bec3dbba179fb3fbbe71..3115fb5adf25ea10e3653cd7aca82f2e936e8a9a 100644
(file)
--- a/
src/game_em/game.c
+++ b/
src/game_em/game.c
@@
-16,29
+16,33
@@
struct EngineSnapshotInfo_EM engine_snapshot_em;
static void readjoy(byte action, struct PLAYER *ply)
{
static void readjoy(byte action, struct PLAYER *ply)
{
- int north = 0, east = 0, south = 0, west = 0;
- int snap = 0, drop = 0;
+ boolean north = FALSE;
+ boolean east = FALSE;
+ boolean south = FALSE;
+ boolean west = FALSE;
+ boolean snap = FALSE;
+ boolean drop = FALSE;
if (game_em.use_single_button && action & (JOY_BUTTON_1 | JOY_BUTTON_2))
action |= JOY_BUTTON_1 | JOY_BUTTON_2;
if (action & JOY_LEFT)
if (game_em.use_single_button && action & (JOY_BUTTON_1 | JOY_BUTTON_2))
action |= JOY_BUTTON_1 | JOY_BUTTON_2;
if (action & JOY_LEFT)
- west =
1
;
+ west =
TRUE
;
if (action & JOY_RIGHT)
if (action & JOY_RIGHT)
- east =
1
;
+ east =
TRUE
;
if (action & JOY_UP)
if (action & JOY_UP)
- north =
1
;
+ north =
TRUE
;
if (action & JOY_DOWN)
if (action & JOY_DOWN)
- south =
1
;
+ south =
TRUE
;
if (action & JOY_BUTTON_1)
if (action & JOY_BUTTON_1)
- snap =
1
;
+ snap =
TRUE
;
if (action & JOY_BUTTON_2)
if (action & JOY_BUTTON_2)
- drop =
1
;
+ drop =
TRUE
;
/* always update drop action */
ply->joy_drop = drop;
/* always update drop action */
ply->joy_drop = drop;
@@
-71,6
+75,8
@@
void InitGameEngine_EM(void)
{
prepare_em_level();
{
prepare_em_level();
+ logic_init();
+
game_initscreen();
RedrawPlayfield_EM(FALSE);
game_initscreen();
RedrawPlayfield_EM(FALSE);
@@
-83,23
+89,17
@@
void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode)
game_em.random = game_em.random * 129 + 1;
game_em.random = game_em.random * 129 + 1;
- frame = (frame
- 1) & 7
;
+ frame = (frame
+ 1) % 8
;
for (i = 0; i < MAX_PLAYERS; i++)
readjoy(action[i], &ply[i]);
for (i = 0; i < MAX_PLAYERS; i++)
readjoy(action[i], &ply[i]);
- UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y);
-
- if (frame == 7)
- {
- logic_players();
- logic_objects();
- }
+ UpdateEngineValues(CAVE_POS_X(screen_x / TILEX),
+ CAVE_POS_Y(screen_y / TILEY),
+ CAVE_POS_X(ply[0].x),
+ CAVE_POS_Y(ply[0].y));
- if (frame == 6)
- {
- logic_globals();
- }
+ logic();
for (i = 0; i < MAX_PLAYERS; i++)
if (ply[i].joy_drop &&
for (i = 0; i < MAX_PLAYERS; i++)
if (ply[i].joy_drop &&