From d593275c3e18f9e36e17d59a277900d43aaeb097 Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Mon, 8 Feb 2010 17:19:45 +0000
Subject: [PATCH] bg scaling fix
---
src/sdl-instead/themes.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/sdl-instead/themes.c b/src/sdl-instead/themes.c
index 0e6884a..4d60a70 100644
--- a/src/sdl-instead/themes.c
+++ b/src/sdl-instead/themes.c
@@ -287,8 +287,6 @@ static int game_theme_scale(int w, int h)
static int theme_gfx_scale(void)
{
struct game_theme *t = &game_theme;
- if (t->scale == 1.0f)
- return 0;
if (theme_img_scale(&t->a_up) ||
theme_img_scale(&t->a_down) ||
theme_img_scale(&t->inv_a_up) ||
@@ -307,15 +305,17 @@ static int theme_gfx_scale(void)
xoff = 0;
if (yoff < 0)
yoff = 0;
- pic = gfx_new(t->w, t->h);
- if (!pic)
- return -1;
- screen = gfx_screen(pic);
- gfx_img_fill(pic, 0, 0, t->w, t->h, gfx_col(0,0,0));
- gfx_draw(t->bg, xoff, yoff);
- gfx_screen(screen);
- gfx_free_image(t->bg);
- t->bg = pic;
+ if (t->scale != 1.0f || xoff || yoff) {
+ pic = gfx_new(t->w, t->h);
+ if (!pic)
+ return -1;
+ screen = gfx_screen(pic);
+ gfx_img_fill(pic, 0, 0, t->w, t->h, gfx_col(0,0,0));
+ gfx_draw(t->bg, xoff, yoff);
+ gfx_screen(screen);
+ gfx_free_image(t->bg);
+ t->bg = pic;
+ }
}
return 0;
}