Rework EmuLoop to save one level of indentation.
This commit is contained in:
parent
3b7a0e79b5
commit
c89f3a86bd
|
@ -1287,11 +1287,17 @@ gboolean EmuLoop(gpointer data)
|
|||
unsigned int i;
|
||||
gchar *Title;
|
||||
|
||||
if(desmume_running()) { /* If desmume is currently running */
|
||||
if (!desmume_running()) {
|
||||
regMainLoop = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* If desmume is currently running */
|
||||
static int limiter_frame_counter = 0;
|
||||
fps_FrameCount += Frameskip + 1;
|
||||
if(!fps_SecStart) fps_SecStart = SDL_GetTicks();
|
||||
if(SDL_GetTicks() - fps_SecStart >= 1000) {
|
||||
if (!fps_SecStart)
|
||||
fps_SecStart = SDL_GetTicks();
|
||||
if (SDL_GetTicks() - fps_SecStart >= 1000) {
|
||||
fps_SecStart = SDL_GetTicks();
|
||||
fps = fps_FrameCount;
|
||||
fps_FrameCount = 0;
|
||||
|
@ -1303,7 +1309,7 @@ gboolean EmuLoop(gpointer data)
|
|||
|
||||
desmume_cycle(); /* Emule ! */
|
||||
NDS_SkipFrame(true);
|
||||
for(i = 0; i < Frameskip; i++) {
|
||||
for (i = 0; i < Frameskip; i++) {
|
||||
desmume_cycle();
|
||||
}
|
||||
NDS_SkipFrame(false);
|
||||
|
@ -1311,9 +1317,9 @@ gboolean EmuLoop(gpointer data)
|
|||
_updateDTools();
|
||||
gtk_widget_queue_draw( nds_screen_widget);
|
||||
|
||||
if ( !gtk_fps_limiter_disabled) {
|
||||
if (!gtk_fps_limiter_disabled) {
|
||||
limiter_frame_counter += 1;
|
||||
if ( limiter_frame_counter >= FPS_LIMITER_FRAME_PERIOD) {
|
||||
if (limiter_frame_counter >= FPS_LIMITER_FRAME_PERIOD) {
|
||||
limiter_frame_counter = 0;
|
||||
/* wait for the timer to expire */
|
||||
SDL_SemWait( fps_limiter_semaphore);
|
||||
|
@ -1321,10 +1327,6 @@ gboolean EmuLoop(gpointer data)
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
regMainLoop = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue