Tidy up for EVENT_IDLE case in game_handler, hopefully fixing obscure 'optimise threads' bug

This commit is contained in:
kreatordxx 2010-08-14 02:26:18 +00:00
parent 4f0d1c4cfb
commit b55a717112
2 changed files with 6 additions and 22 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog
20100814
--------
main/game.c: Tidy up for EVENT_IDLE case in game_handler, hopefully fixing obscure 'optimise threads' bug
20100811
--------
main/laser.c: The inital vector scaling to compensate previous frame-skipped tracking was not aligned to FrameTime. Removed that code and just divided homer_turn_base values to compensate this offset properly. Thanks to zif for hinting me to that; Added comment about the how and why of the homing missile scaling issue

View file

@ -1205,26 +1205,8 @@ int game_handler(window *wind, d_event *event, void *data)
case EVENT_MOUSE_BUTTON_UP:
case EVENT_MOUSE_BUTTON_DOWN:
case EVENT_KEY_COMMAND:
case EVENT_IDLE: // EVENT_IDLE will be removed once all input events are in place
return ReadControls(event);
break;
case EVENT_IDLE:
// GAME LOOP!
Config_menu_flag = 0;
ReadControls(event); // will be removed from here once all input events are in place
if (window_get_front() != wind)
break;
if (Config_menu_flag) {
do_options_menu();
}
if (!Game_wind)
break;
return 0;
break;
case EVENT_WINDOW_DRAW:
if (!time_paused)
@ -1264,7 +1246,6 @@ int game_handler(window *wind, d_event *event, void *data)
show_menus();
Game_wind = NULL;
mouse_toggle_cursor(1);
return 0; // continue closing
break;
case EVENT_WINDOW_CLOSED:
@ -1272,11 +1253,10 @@ int game_handler(window *wind, d_event *event, void *data)
break;
default:
return 0;
break;
}
return 1;
return 0;
}
// Initialise game, actually runs in main event loop