From: Matthias Braun Date: Sun, 13 Aug 2006 13:27:28 +0000 (+0000) Subject: more small adjustments from Tron X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d091bb359b3d5112bd3a6fb73def479bcb779b6f;p=supertux.git more small adjustments from Tron SVN-Revision: 4179 --- diff --git a/src/level.cpp b/src/level.cpp index 1a81bca08..134f1f566 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -90,7 +90,6 @@ Level::load(const std::string& filepath) add_sector(sector); } else { log_warning << "Unknown token '" << token << "' in level file" << std::endl; - continue; } } diff --git a/src/mainloop.cpp b/src/mainloop.cpp index 72b3eed93..8baec7c72 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 != NULL; nextpop = false; speed = 1.0; } @@ -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); diff --git a/src/moving_object.hpp b/src/moving_object.hpp index 29e12f2c6..31f47ad23 100644 --- a/src/moving_object.hpp +++ b/src/moving_object.hpp @@ -31,7 +31,7 @@ class CollisionGrid; enum CollisionGroup { /** Objects in DISABLED group are not tested for collisions */ - COLGROUP_DISABLED, + COLGROUP_DISABLED = 0, /** * "default" is moving object. MovingObjects get tested against all other * objects and against other movingobjects diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 6fe11d441..ec91db212 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -171,8 +171,8 @@ TileMap::draw(DrawingContext& context) /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. * I have no idea why */ - float start_x = ((int)((roundf(context.get_translation().x) - roundf(x_offset)) / 32)) * 32 + roundf(x_offset); - float start_y = ((int)((roundf(context.get_translation().y) - roundf(y_offset)) / 32)) * 32 + roundf(y_offset); + float start_x = int((roundf(context.get_translation().x) - roundf(x_offset)) / 32) * 32 + roundf(x_offset); + float start_y = int((roundf(context.get_translation().y) - roundf(y_offset)) / 32) * 32 + roundf(y_offset); float end_x = std::min(start_x + SCREEN_WIDTH + 32, float(width * 32 + roundf(x_offset))); float end_y = std::min(start_y + SCREEN_HEIGHT + 32, float(height * 32 + roundf(y_offset))); int tsx = int((start_x - roundf(x_offset)) / 32); // tilestartindex x diff --git a/src/refcounter.hpp b/src/refcounter.hpp index 0a56b0680..e810efe10 100644 --- a/src/refcounter.hpp +++ b/src/refcounter.hpp @@ -44,7 +44,6 @@ public: refcount--; if(refcount <= 0) { delete this; - return; } } diff --git a/tools/tilemanager/Parser.cs b/tools/tilemanager/Parser.cs index daa0ade11..a09ccd9ce 100644 --- a/tools/tilemanager/Parser.cs +++ b/tools/tilemanager/Parser.cs @@ -83,7 +83,7 @@ public class Parser { get { return Int32.Parse(lexer.TokenString); } } public bool BoolValue { - get { return StringValue == "t" ? true : false; } + get { return StringValue == "t"; } } public float FloatValue { get { return Single.Parse(lexer.TokenString); }