Skip to content
Snippets Groups Projects
Commit 22f9890d authored by deuce's avatar deuce
Browse files

Move lastfg/lastbg out of sdl_draw_one_char() and reset them to -1 when

the font is loaded to ensure the colours are set correctly on a screen
redraw.
parent aa1ac7fc
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,8 @@ SDL_Surface *sdl_cursor=NULL; ...@@ -61,6 +61,8 @@ SDL_Surface *sdl_cursor=NULL;
static int lastcursor_x=0; static int lastcursor_x=0;
static int lastcursor_y=0; static int lastcursor_y=0;
static int sdl_current_font=-1; static int sdl_current_font=-1;
static int lastfg=-1;
static int lastbg=-1;
unsigned short *last_vmem=NULL; unsigned short *last_vmem=NULL;
...@@ -1001,6 +1003,8 @@ int sdl_load_font(char *filename) ...@@ -1001,6 +1003,8 @@ int sdl_load_font(char *filename)
} }
sdl.mutexV(sdl_vstatlock); sdl.mutexV(sdl_vstatlock);
free(font); free(font);
lastfg=-1;
lastbg=-1;
return(0); return(0);
} }
...@@ -1056,8 +1060,6 @@ int sdl_draw_one_char(unsigned short sch, unsigned int x, unsigned int y, struct ...@@ -1056,8 +1060,6 @@ int sdl_draw_one_char(unsigned short sch, unsigned int x, unsigned int y, struct
SDL_Rect src; SDL_Rect src;
SDL_Rect dst; SDL_Rect dst;
unsigned char ch; unsigned char ch;
static int lastfg=-1;
static int lastbg=-1;
ch=(sch >> 8) & 0x0f; ch=(sch >> 8) & 0x0f;
if(lastfg!=ch) { if(lastfg!=ch) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment