mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Convert roomname background to a surface, then draw that
The roomname background used to just be a simple SDL_Rect that was drawn using SDL_FillRect with a color of 0. Unfortunately, it seems that you cannot use transparent colors with SDL_FillRect, it just defaults to being fully opaque. However, you CAN draw surfaces with translucency, which seems like the easiest thing to do. But the first step is to convert the roomname background to an SDL_Surface. This replaces the FillRect()s with SDL_BlitSurface() in the three places roomnames are drawn: in towerrender, in gamerender, and in editorrender.
This commit is contained in:
@@ -125,6 +125,9 @@ int main(int argc, char *argv[])
|
||||
const SDL_PixelFormat* fmt = gameScreen.GetFormat();
|
||||
graphics.backBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE ,320 ,240 ,32,fmt->Rmask,fmt->Gmask,fmt->Bmask,fmt->Amask ) ;
|
||||
SDL_SetSurfaceBlendMode(graphics.backBuffer, SDL_BLENDMODE_NONE);
|
||||
graphics.footerbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 10, 32, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask);
|
||||
SDL_SetSurfaceBlendMode(graphics.footerbuffer, SDL_BLENDMODE_BLEND);
|
||||
FillRect(graphics.footerbuffer, SDL_MapRGB(fmt, 0, 0, 0));
|
||||
graphics.Makebfont();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user