From b75f0f1d6bed9841695b27a0f71dc87757fa21d1 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Wed, 13 Feb 2013 14:38:01 +0000 Subject: [PATCH] [Fix] Squished an offset bug in splite britting. --- src/main.c | 3 +-- src/opengl.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 475d951..eba2dc4 100644 --- a/src/main.c +++ b/src/main.c @@ -322,7 +322,6 @@ static void update_all(void) { if(dt > MINIMUM_FPS) { Vec2 pos; vect_csetmin(&pos, 10., (double)(gl_screen.h-40)); - gl_print(NULL, &pos, "FPS is really low! Skipping frames."); SDL_GL_SwapBuffers(); return; } @@ -365,6 +364,6 @@ static void display_fps(const double dt) { Vec2 pos; vect_csetmin(&pos, 10., (double)(gl_screen.h-20)); if(show_fps) - gl_print(NULL, &pos, "%3.2f", fps); + gl_print(NULL, &pos, NULL, "%3.2f", fps); } diff --git a/src/opengl.c b/src/opengl.c index 4ab05e9..882cbcd 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -331,8 +331,8 @@ void gl_getSpriteFromDir(int* x, int* y, const gl_texture* t, const double dir) // Blit the sprite at given position. void gl_blitSprite(const gl_texture* sprite, const Vec2* pos, const int sx, const int sy, const glColor* c) { // Don't bother drawing if offscreen -- waste of cycles. - if(fabs(VX(*pos) -VX(*gl_camera)) > gl_screen.w / 2 + sprite->sw / 2 || - fabs(VY(*pos) -VY(*gl_camera)) > gl_screen.h / 2 + sprite->sh / 2) + if(fabs(VX(*pos) -VX(*gl_camera)+gui_xoff) > gl_screen.w / 2 + sprite->sw / 2 || + fabs(VY(*pos) -VY(*gl_camera)+gui_yoff) > gl_screen.h / 2 + sprite->sh / 2) return; glEnable(GL_TEXTURE_2D);