From: LMH Date: Wed, 20 Feb 2013 23:39:03 +0000 (-1000) Subject: Merge branch 'icyworld' new worldmap graphics for Icy Island X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=c0a483397740673cd5b0c3c67f65562f5270a0eb;hp=8b702031ef7d7938ebfafd5414c4bf42f814dedd;p=supertux.git Merge branch 'icyworld' new worldmap graphics for Icy Island --- diff --git a/src/supertux/collision.cpp b/src/supertux/collision.cpp index 95fbbbbc6..4e1c601d5 100644 --- a/src/supertux/collision.cpp +++ b/src/supertux/collision.cpp @@ -54,7 +54,7 @@ bool rectangle_aatriangle(Constraints* constraints, const Rectf& rect, return false; Vector normal; - float c; + float c = 0.0; Vector p1; Rectf area; switch(triangle.dir & AATriangle::DEFORM_MASK) { diff --git a/src/supertux/levelintro.cpp b/src/supertux/levelintro.cpp index bbd3f215f..98d854452 100644 --- a/src/supertux/levelintro.cpp +++ b/src/supertux/levelintro.cpp @@ -116,6 +116,13 @@ LevelIntro::draw(DrawingContext& context) context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1, LevelIntro::stat_color); py += static_cast(Resources::normal_font->get_height()); } + + { + std::stringstream ss; + ss << _("Badguys killed") << ": " << Statistics::frags_to_string((best_level_statistics && (best_level_statistics->coins >= 0)) ? best_level_statistics->badguys : 0, stats.total_badguys); + context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1,LevelIntro::stat_color); + py += static_cast(Resources::normal_font->get_height()); + } { std::stringstream ss; diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index c52a03cf0..91b469d97 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -594,7 +594,13 @@ Sector::activate(const Vector& player_pos) } } + //FIXME: This is a really dirty workaround for this strange camera jump + player->move(player->get_pos()+Vector(-32, 0)); camera->reset(player->get_pos()); + camera->update(1); + player->move(player->get_pos()+(Vector(32, 0))); + camera->update(1); + update_game_objects(); //Run default.nut just before init script diff --git a/src/supertux/tile.cpp b/src/supertux/tile.cpp index d29a6c509..b81595308 100644 --- a/src/supertux/tile.cpp +++ b/src/supertux/tile.cpp @@ -271,8 +271,8 @@ bool Tile::check_position_unisolid (const Rectf& obj_bbox, float gradient; float delta_x; float delta_y; - float obj_x; - float obj_y; + float obj_x = 0.0; + float obj_y = 0.0; /* If this is not a slope, this is - again - easy */ if (!this->is_slope()) diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp index 361f30a51..2f1f505ef 100644 --- a/src/video/gl/gl_renderer.cpp +++ b/src/video/gl/gl_renderer.cpp @@ -34,7 +34,8 @@ GLRenderer::GLRenderer() : desktop_size(-1, -1), screen_size(-1, -1), - fullscreen_active(false) + fullscreen_active(false), + last_texture(static_cast (-1)) { Renderer::instance_ = this; @@ -116,7 +117,11 @@ GLRenderer::draw_surface(const DrawingRequest& request) GLTexture* gltexture = static_cast(surface->get_texture().get()); GLSurfaceData *surface_data = static_cast(surface->get_surface_data()); - glBindTexture(GL_TEXTURE_2D, gltexture->get_handle()); + GLuint th = gltexture->get_handle(); + if (th != last_texture) { + last_texture = th; + glBindTexture(GL_TEXTURE_2D, th); + } intern_draw(request.pos.x, request.pos.y, request.pos.x + surface->get_width(), request.pos.y + surface->get_height(), @@ -148,7 +153,11 @@ GLRenderer::draw_surface_part(const DrawingRequest& request) float uv_right = surface_data->get_uv_left() + (uv_width * (surfacepartrequest->source.x + surfacepartrequest->size.x)) / surface->get_width(); float uv_bottom = surface_data->get_uv_top() + (uv_height * (surfacepartrequest->source.y + surfacepartrequest->size.y)) / surface->get_height(); - glBindTexture(GL_TEXTURE_2D, gltexture->get_handle()); + GLuint th = gltexture->get_handle(); + if (th != last_texture) { + last_texture = th; + glBindTexture(GL_TEXTURE_2D, th); + } intern_draw(request.pos.x, request.pos.y, request.pos.x + surfacepartrequest->size.x, request.pos.y + surfacepartrequest->size.y, diff --git a/src/video/gl/gl_renderer.hpp b/src/video/gl/gl_renderer.hpp index 9e208597b..d5d999520 100644 --- a/src/video/gl/gl_renderer.hpp +++ b/src/video/gl/gl_renderer.hpp @@ -109,6 +109,8 @@ private: Size desktop_size; Size screen_size; bool fullscreen_active; + + GLuint last_texture; public: GLRenderer();