Change variable name elapsed_seconds to elapsed_ticks
This new name makes more sense, as later commits will introduce config.h variables that can change tick length.
This commit is contained in:
parent
79c0562abc
commit
003b56f6a0
12
wmud/game.c
12
wmud/game.c
@ -39,12 +39,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* elapsed_seconds:
|
* elapsed_ticks:
|
||||||
*
|
*
|
||||||
* the number of seconds elapsed since game boot. May be inaccurate, as it
|
* the number of seconds elapsed since game boot. May be inaccurate, as it
|
||||||
* simply gets updated by a timeout function which should run every second
|
* simply gets updated by a timeout function which should run every second
|
||||||
*/
|
*/
|
||||||
guint32 elapsed_seconds = 0;
|
guint32 elapsed_ticks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* elapsed_cycle:
|
* elapsed_cycle:
|
||||||
@ -65,13 +65,13 @@ guint32 elapsed_cycle = 0;
|
|||||||
gboolean
|
gboolean
|
||||||
rl_sec_elapsed(gpointer user_data)
|
rl_sec_elapsed(gpointer user_data)
|
||||||
{
|
{
|
||||||
elapsed_seconds++;
|
elapsed_ticks++;
|
||||||
if (elapsed_seconds == G_MAXUINT32) {
|
if (elapsed_ticks == G_MAXUINT32) {
|
||||||
elapsed_seconds = 0;
|
elapsed_ticks = 0;
|
||||||
elapsed_cycle++;
|
elapsed_cycle++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elapsed_seconds % 30 == 0) {
|
if (elapsed_ticks % 30 == 0) {
|
||||||
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Heartbeat");
|
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Heartbeat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user