Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made the game time displayed and refreshed more properly in the menu …

…mode.
  • Loading branch information...
commit 99df3ef15fe458fab1c6d578d15b811479e97bfb 1 parent 9a44841
Yohann Ferreira authored
Showing with 9 additions and 3 deletions.
  1. +9 −2 src/modes/menu/menu.cpp
  2. +0 −1  src/modes/menu/menu_views.cpp
View
11 src/modes/menu/menu.cpp
@@ -43,6 +43,9 @@ namespace hoa_menu
namespace private_menu {
+//! A static variable permitting to update the displayed game time only every 900ms
+static int32 _update_of_time = 0;
+
//! \brief Functions that initialize the numerous option boxes
static void SetupOptionBoxCommonSettings(OptionBox *ob)
{
@@ -72,6 +75,9 @@ AbstractMenuState::AbstractMenuState(const char *state_name, MenuMode *menu_mode
_drunes_text.SetAlignment(VIDEO_X_LEFT, VIDEO_Y_CENTER);
_drunes_text.SetDimensions(200.0f, 30.0f);
_drunes_text.SetPosition(110.0f, 650.0f);
+
+ // Display the game time right away
+ _update_of_time = 0;
}
void AbstractMenuState::Update()
@@ -136,7 +142,9 @@ void AbstractMenuState::Update()
_menu_mode->_current_menu_state->_OnEntry(this);
}
-
+ // When we change the state, update the time immediately to avoid
+ // showing outdated or empty time info
+ _update_of_time = 0;
}
// update the current state
@@ -150,7 +158,6 @@ void AbstractMenuState::Update()
void AbstractMenuState::UpdateTimeAndDrunes()
{
// Only update the time every 900ms
- static int32 _update_of_time = 0;
_update_of_time -= (int32) hoa_system::SystemManager->GetUpdateTime();
if (_update_of_time > 0)
return;
View
1  src/modes/menu/menu_views.cpp
@@ -41,7 +41,6 @@ namespace hoa_menu
namespace private_menu
{
-
////////////////////////////////////////////////////////////////////////////////
// CharacterWindow Class
////////////////////////////////////////////////////////////////////////////////

0 comments on commit 99df3ef

Please sign in to comment.
Something went wrong with that request. Please try again.