context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1, LevelIntro::stat_color);
py += static_cast<int>(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<int>(Resources::normal_font->get_height());
+ }
{
std::stringstream ss;
}
}
+ //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
GLRenderer::GLRenderer() :
desktop_size(-1, -1),
screen_size(-1, -1),
- fullscreen_active(false)
+ fullscreen_active(false),
+ last_texture(static_cast<GLuint> (-1))
{
Renderer::instance_ = this;
GLTexture* gltexture = static_cast<GLTexture*>(surface->get_texture().get());
GLSurfaceData *surface_data = static_cast<GLSurfaceData*>(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(),
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,