X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmainloop.cpp;h=d0b6236931a82bbeb49d5adea006c5cd41ba9514;hb=339968d0eb222f5cad1397580631ab44acf40b10;hp=9f8be24e855b6c2868e37d8b2fe16e0a77a54bef;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/mainloop.cpp b/src/mainloop.cpp index 9f8be24e8..d0b623693 100644 --- a/src/mainloop.cpp +++ b/src/mainloop.cpp @@ -68,10 +68,7 @@ MainLoop::push_screen(Screen* screen, ScreenFade* screen_fade) { this->next_screen.reset(screen); this->screen_fade.reset(screen_fade); - if(nextpop) - nextpush = false; - else - nextpush = true; + nextpush = !nextpop; nextpop = false; speed = 1.0; } @@ -114,8 +111,8 @@ MainLoop::draw_fps(DrawingContext& context, float fps_fps) char str[60]; snprintf(str, sizeof(str), "%3.1f", fps_fps); const char* fpstext = "FPS"; - context.draw_text(white_text, fpstext, Vector(SCREEN_WIDTH - white_text->get_text_width(fpstext) - gold_text->get_text_width(" 99999") - BORDER_X, BORDER_Y + 20), LEFT_ALLIGN, LAYER_FOREGROUND1); - context.draw_text(gold_text, str, Vector(SCREEN_WIDTH - BORDER_X, BORDER_Y + 20), RIGHT_ALLIGN, LAYER_FOREGROUND1); + context.draw_text(white_text, fpstext, Vector(SCREEN_WIDTH - white_text->get_text_width(fpstext) - gold_text->get_text_width(" 99999") - BORDER_X, BORDER_Y + 20), LEFT_ALLIGN, LAYER_HUD); + context.draw_text(gold_text, str, Vector(SCREEN_WIDTH - BORDER_X, BORDER_Y + 20), RIGHT_ALLIGN, LAYER_HUD); } void @@ -132,7 +129,7 @@ MainLoop::run() running = true; while(running) { - while( (next_screen.get() != NULL || nextpop == true) && + while( (next_screen.get() != NULL || nextpop) && (screen_fade.get() == NULL || screen_fade->done())) { if(current_screen.get() != NULL) { current_screen->leave(); @@ -167,7 +164,7 @@ MainLoop::run() float elapsed_time = 1.0 / LOGICAL_FPS; ticks = SDL_GetTicks(); if(ticks > fps_nextframe_ticks) { - if(skipdraw == true) { + if(skipdraw) { // already skipped last frame? we have to slow down the game then... skipdraw = false; fps_nextframe_ticks -= (Uint32) (1000.0 / LOGICAL_FPS);