Make fast path using FillRect() when opaque

FillRect() is similar enough to memset when blending isn't used, so the
game will take a fast path drawing the roomname background when the
background is opaque.
This commit is contained in:
Info Teddy
2020-01-24 23:30:51 -08:00
committed by Ethan Lee
parent 2f85c2a8dc
commit 2709de9cf0
3 changed files with 10 additions and 12 deletions

View File

@@ -3447,16 +3447,15 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent
{
if(ed.roomnamehide<12) ed.roomnamehide++;
}
dwgfx.footerrect.y = 230+ed.roomnamehide;
if (dwgfx.translucentroomname)
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 127);
SDL_BlitSurface(dwgfx.footerbuffer, NULL, dwgfx.backBuffer, &dwgfx.footerrect);
}
else
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 255);
FillRect(dwgfx.backBuffer, 0,230+ed.roomnamehide,320,10, dwgfx.getRGB(0,0,0));
}
dwgfx.footerrect.y = 230+ed.roomnamehide;
SDL_BlitSurface(dwgfx.footerbuffer, NULL, dwgfx.backBuffer, &dwgfx.footerrect);
dwgfx.bprint(5,231+ed.roomnamehide,ed.level[ed.levx+(ed.maxwidth*ed.levy)].roomname, 196, 196, 255 - help.glow, true);
dwgfx.bprint(4, 222, "SPACE ^ SHIFT ^", 196, 196, 255 - help.glow, false);
dwgfx.bprint(268,222, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false);