X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame.c;h=5561d17caaa752f1b63d4cb236696b39ca2dba61;hb=bb2ddcf13df18d69e4472d4697da173981970e9d;hp=7c6cf1599ad4df135e9f140fce33aecc87a025d8;hpb=36357e8399d0a42ac45a1cd096aee24a9008b5f5;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 7c6cf159..5561d17c 100644 --- a/src/game.c +++ b/src/game.c @@ -176,6 +176,9 @@ void GetPlayerConfig() setup.sound_music = FALSE; } + if (!fullscreen_available) + setup.fullscreen = FALSE; + setup.sound_simple = setup.sound; InitJoysticks(); @@ -502,7 +505,7 @@ void InitGame() network_player_action_received = FALSE; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* initial null action */ if (network_playing) SendToServer_MovePlayer(MV_NO_MOVING); @@ -4240,7 +4243,7 @@ void GameActions() #endif */ -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* last chance to get network player actions without main loop delay */ HandleNetworking(); #endif @@ -4277,7 +4280,7 @@ void GameActions() stored_player[i].effective_action = stored_player[i].action; } -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (network_playing) SendToServer_MovePlayer(summarized_player_action); #endif @@ -4560,6 +4563,25 @@ void GameActions() } DrawAllPlayers(); + + if (options.debug) /* calculate frames per second */ + { + static unsigned long fps_counter = 0; + static int fps_frames = 0; + unsigned long fps_delay_ms = Counter() - fps_counter; + + fps_frames++; + + if (fps_delay_ms >= 500) /* calculate fps every 0.5 seconds */ + { + global.frames_per_second = 1000 * (float)fps_frames / fps_delay_ms; + + fps_frames = 0; + fps_counter = Counter(); + } + + redraw_mask |= REDRAW_FPS; + } } static boolean AllPlayersInSight(struct PlayerInfo *player, int x, int y) @@ -6162,7 +6184,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) Request("Do you really want to quit the game ?", REQ_ASK | REQ_STAY_CLOSED)) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_StopPlaying(); else @@ -6179,7 +6201,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) case GAME_CTRL_ID_PAUSE: if (options.network) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (tape.pausing) SendToServer_ContinuePlaying(); else @@ -6193,7 +6215,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) case GAME_CTRL_ID_PLAY: if (tape.pausing) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_ContinuePlaying(); else