Minor code changes

* Fixed GThread init call
* Added elapsed second count

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2012-03-12 16:42:13 +01:00
parent 144eb97159
commit 4ed9f6bcea

View File

@ -15,11 +15,19 @@ struct {
} debug_context_loc = {NULL, 0}; } debug_context_loc = {NULL, 0};
GMainContext *game_context; GMainContext *game_context;
guint32 elapsed_seconds = 0;
guint32 elapsed_cycle = 0;
gboolean gboolean
rl_sec_elapsed(gpointer user_data) rl_sec_elapsed(gpointer user_data)
{ {
g_print("RL sec elapsed.\n"); elapsed_seconds++;
if (elapsed_seconds == G_MAXUINT32)
{
elapsed_seconds = 0;
elapsed_cycle++;
}
g_print("%ld RL sec elapsed.\n", elapsed_seconds);
return TRUE; return TRUE;
} }
@ -47,7 +55,7 @@ main(int argc, char **argv)
guint timeout_id; guint timeout_id;
GSocketListener *game_listener; GSocketListener *game_listener;
g_thread_init(); g_thread_init(NULL);
g_type_init(); g_type_init();
g_print("Starting up...\n"); g_print("Starting up...\n");