bg scaling fix
This commit is contained in:
parent
9b908d86bd
commit
d593275c3e
|
@ -287,8 +287,6 @@ static int game_theme_scale(int w, int h)
|
||||||
static int theme_gfx_scale(void)
|
static int theme_gfx_scale(void)
|
||||||
{
|
{
|
||||||
struct game_theme *t = &game_theme;
|
struct game_theme *t = &game_theme;
|
||||||
if (t->scale == 1.0f)
|
|
||||||
return 0;
|
|
||||||
if (theme_img_scale(&t->a_up) ||
|
if (theme_img_scale(&t->a_up) ||
|
||||||
theme_img_scale(&t->a_down) ||
|
theme_img_scale(&t->a_down) ||
|
||||||
theme_img_scale(&t->inv_a_up) ||
|
theme_img_scale(&t->inv_a_up) ||
|
||||||
|
@ -307,15 +305,17 @@ static int theme_gfx_scale(void)
|
||||||
xoff = 0;
|
xoff = 0;
|
||||||
if (yoff < 0)
|
if (yoff < 0)
|
||||||
yoff = 0;
|
yoff = 0;
|
||||||
pic = gfx_new(t->w, t->h);
|
if (t->scale != 1.0f || xoff || yoff) {
|
||||||
if (!pic)
|
pic = gfx_new(t->w, t->h);
|
||||||
return -1;
|
if (!pic)
|
||||||
screen = gfx_screen(pic);
|
return -1;
|
||||||
gfx_img_fill(pic, 0, 0, t->w, t->h, gfx_col(0,0,0));
|
screen = gfx_screen(pic);
|
||||||
gfx_draw(t->bg, xoff, yoff);
|
gfx_img_fill(pic, 0, 0, t->w, t->h, gfx_col(0,0,0));
|
||||||
gfx_screen(screen);
|
gfx_draw(t->bg, xoff, yoff);
|
||||||
gfx_free_image(t->bg);
|
gfx_screen(screen);
|
||||||
t->bg = pic;
|
gfx_free_image(t->bg);
|
||||||
|
t->bg = pic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue