Browse Source

Cleanup: Remove ENG_set_pixel function

Migrated to SetPixel
pull/1082/head
Gleb Mazovetskiy 5 years ago committed by Anders Jenbo
parent
commit
e5d7571ea7
  1. 33
      Source/automap.cpp
  2. 3
      Source/engine.cpp
  3. 4
      Source/engine.h

33
Source/automap.cpp

@ -206,22 +206,23 @@ static void DrawAutomapTile(int sx, int sy, WORD automap_type)
BYTE flags = automap_type >> 8;
if (flags & MAPFLAG_DIRT) {
ENG_set_pixel(sx, sy, COLOR_DIM);
ENG_set_pixel(sx - AmLine8, sy - AmLine4, COLOR_DIM);
ENG_set_pixel(sx - AmLine8, sy + AmLine4, COLOR_DIM);
ENG_set_pixel(sx + AmLine8, sy - AmLine4, COLOR_DIM);
ENG_set_pixel(sx + AmLine8, sy + AmLine4, COLOR_DIM);
ENG_set_pixel(sx - AmLine16, sy, COLOR_DIM);
ENG_set_pixel(sx + AmLine16, sy, COLOR_DIM);
ENG_set_pixel(sx, sy - AmLine8, COLOR_DIM);
ENG_set_pixel(sx, sy + AmLine8, COLOR_DIM);
ENG_set_pixel(sx + AmLine8 - AmLine32, sy + AmLine4, COLOR_DIM);
ENG_set_pixel(sx - AmLine8 + AmLine32, sy + AmLine4, COLOR_DIM);
ENG_set_pixel(sx - AmLine16, sy + AmLine8, COLOR_DIM);
ENG_set_pixel(sx + AmLine16, sy + AmLine8, COLOR_DIM);
ENG_set_pixel(sx - AmLine8, sy + AmLine16 - AmLine4, COLOR_DIM);
ENG_set_pixel(sx + AmLine8, sy + AmLine16 - AmLine4, COLOR_DIM);
ENG_set_pixel(sx, sy + AmLine16, COLOR_DIM);
CelOutputBuffer out = GlobalBackBuffer();
SetPixel(out, sx, sy, COLOR_DIM);
SetPixel(out, sx - AmLine8, sy - AmLine4, COLOR_DIM);
SetPixel(out, sx - AmLine8, sy + AmLine4, COLOR_DIM);
SetPixel(out, sx + AmLine8, sy - AmLine4, COLOR_DIM);
SetPixel(out, sx + AmLine8, sy + AmLine4, COLOR_DIM);
SetPixel(out, sx - AmLine16, sy, COLOR_DIM);
SetPixel(out, sx + AmLine16, sy, COLOR_DIM);
SetPixel(out, sx, sy - AmLine8, COLOR_DIM);
SetPixel(out, sx, sy + AmLine8, COLOR_DIM);
SetPixel(out, sx + AmLine8 - AmLine32, sy + AmLine4, COLOR_DIM);
SetPixel(out, sx - AmLine8 + AmLine32, sy + AmLine4, COLOR_DIM);
SetPixel(out, sx - AmLine16, sy + AmLine8, COLOR_DIM);
SetPixel(out, sx + AmLine16, sy + AmLine8, COLOR_DIM);
SetPixel(out, sx - AmLine8, sy + AmLine16 - AmLine4, COLOR_DIM);
SetPixel(out, sx + AmLine8, sy + AmLine16 - AmLine4, COLOR_DIM);
SetPixel(out, sx, sy + AmLine16, COLOR_DIM);
}
if (flags & MAPFLAG_STAIRS) {

3
Source/engine.cpp

@ -550,8 +550,9 @@ void DrawLine(int x0, int y0, int x1, int y1, BYTE col)
sx = x0;
sy = y0;
CelOutputBuffer out = GlobalBackBuffer();
for (i = 0; i <= steps; i++, sx += ix, sy += iy) {
ENG_set_pixel(sx, sy, col);
SetPixel(out, sx, sy, col);
}
}

4
Source/engine.h

@ -286,10 +286,6 @@ inline void CelBlitOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, i
* @param col Color index from current palette
*/
void SetPixel(CelOutputBuffer out, int sx, int sy, BYTE col);
inline void ENG_set_pixel(int sx, int sy, BYTE col)
{
return SetPixel(GlobalBackBuffer(), sx, sy, col);
}
/**
* @brief Blit CL2 sprite, to the back buffer at the given coordianates

Loading…
Cancel
Save