projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981220-1
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index a2aea40a77eedc5ec521b8d2b21d2d51f3700a88..9897b56d78778dfa99cbe9dea30f99315560e1cf 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-101,6
+101,7
@@
int game_emulation = EMU_NONE;
+
#ifdef DEBUG
#if 0
static unsigned int getStateCheckSum(int counter)
#ifdef DEBUG
#if 0
static unsigned int getStateCheckSum(int counter)
@@
-153,6
+154,7
@@
static unsigned int getStateCheckSum(int counter)
+
void GetPlayerConfig()
{
if (sound_status == SOUND_OFF)
void GetPlayerConfig()
{
if (sound_status == SOUND_OFF)
@@
-238,9
+240,11
@@
void InitGame()
network_player_action_received = FALSE;
network_player_action_received = FALSE;
+#ifndef MSDOS
/* initial null action */
if (network_playing)
SendToServer_MovePlayer(MV_NO_MOVING);
/* initial null action */
if (network_playing)
SendToServer_MovePlayer(MV_NO_MOVING);
+#endif
ZX = ZY = -1;
ZX = ZY = -1;
@@
-2419,8
+2423,8
@@
void AmoebeUmwandeln2(int ax, int ay, int new_element)
void AmoebeWaechst(int x, int y)
{
void AmoebeWaechst(int x, int y)
{
- static long sound_delay = 0;
- static
int
sound_delay_value = 0;
+ static
unsigned
long sound_delay = 0;
+ static
unsigned long
sound_delay_value = 0;
if (!MovDelay[x][y]) /* start new growing cycle */
{
if (!MovDelay[x][y]) /* start new growing cycle */
{
@@
-3109,8
+3113,8
@@
static void PlayerActions(struct PlayerInfo *player, byte player_action)
void GameActions()
{
void GameActions()
{
- static long action_delay = 0;
- long action_delay_value;
+ static
unsigned
long action_delay = 0;
+
unsigned
long action_delay_value;
int sieb_x = 0, sieb_y = 0;
int i, x, y, element;
byte *recorded_player_action;
int sieb_x = 0, sieb_y = 0;
int i, x, y, element;
byte *recorded_player_action;
@@
-3122,8
+3126,40
@@
void GameActions()
action_delay_value =
(tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay);
action_delay_value =
(tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay);
+ /*
+ if (tape.playing && tape.fast_forward)
+ {
+ char buf[100];
+
+ sprintf(buf, "FFWD: %ld ms", action_delay_value);
+ print_debug(buf);
+ }
+ */
+
+
/* main game synchronization point */
/* main game synchronization point */
+
+
+
+
+#if 1
WaitUntilDelayReached(&action_delay, action_delay_value);
WaitUntilDelayReached(&action_delay, action_delay_value);
+#else
+
+ while (!DelayReached(&action_delay, action_delay_value))
+ {
+ char buf[100];
+
+ sprintf(buf, "%ld %ld %ld",
+ Counter(), action_delay, action_delay_value);
+ print_debug(buf);
+ }
+ print_debug("done");
+
+#endif
+
+
+
if (network_playing && !network_player_action_received)
{
if (network_playing && !network_player_action_received)
{
@@
-3133,8
+3169,10
@@
void GameActions()
#endif
*/
#endif
*/
+#ifndef MSDOS
/* last chance to get network player actions without main loop delay */
HandleNetworking();
/* last chance to get network player actions without main loop delay */
HandleNetworking();
+#endif
if (game_status != PLAYING)
return;
if (game_status != PLAYING)
return;
@@
-3176,8
+3214,10
@@
void GameActions()
stored_player[i].effective_action = stored_player[i].action;
}
stored_player[i].effective_action = stored_player[i].action;
}
+#ifndef MSDOS
if (network_playing)
SendToServer_MovePlayer(summarized_player_action);
if (network_playing)
SendToServer_MovePlayer(summarized_player_action);
+#endif
if (!options.network && !setup.team_mode)
local_player->effective_action = summarized_player_action;
if (!options.network && !setup.team_mode)
local_player->effective_action = summarized_player_action;
@@
-3700,7
+3740,7
@@
void ScrollFigure(struct PlayerInfo *player, int mode)
void ScrollScreen(struct PlayerInfo *player, int mode)
{
void ScrollScreen(struct PlayerInfo *player, int mode)
{
- static long screen_frame_counter = 0;
+ static
unsigned
long screen_frame_counter = 0;
if (mode == SCROLL_INIT)
{
if (mode == SCROLL_INIT)
{