Browse Source

Migrate RedBack away from gpBuffer

pull/1170/head
Gleb Mazovetskiy 5 years ago committed by Anders Jenbo
parent
commit
bafbad6b5b
  1. 12
      Source/control.cpp
  2. 2
      Source/control.h
  3. 2
      Source/gmenu.cpp
  4. 2
      Source/scrollrt.cpp

12
Source/control.cpp

@ -1755,30 +1755,30 @@ void DrawDurIcon(CelOutputBuffer out)
DrawDurIcon4Item(out, &p->InvBody[INVLOC_HAND_RIGHT], x, 0); DrawDurIcon4Item(out, &p->InvBody[INVLOC_HAND_RIGHT], x, 0);
} }
void RedBack() void RedBack(CelOutputBuffer out)
{ {
int idx; int idx;
idx = light4flag ? 1536 : 4608; idx = light4flag ? 1536 : 4608;
assert(gpBuffer); assert(out.begin != NULL);
int w, h; int w, h;
BYTE *dst, *tbl; BYTE *dst, *tbl;
if (leveltype != DTYPE_HELL) { if (leveltype != DTYPE_HELL) {
dst = &gpBuffer[SCREENXY(0, 0)]; dst = out.at(SCREEN_X, SCREEN_Y);
tbl = &pLightTbl[idx]; tbl = &pLightTbl[idx];
for (h = gnViewportHeight; h; h--, dst += BUFFER_WIDTH - gnScreenWidth) { for (h = gnViewportHeight; h; h--, dst += out.line_width - gnScreenWidth) {
for (w = gnScreenWidth; w; w--) { for (w = gnScreenWidth; w; w--) {
*dst = tbl[*dst]; *dst = tbl[*dst];
dst++; dst++;
} }
} }
} else { } else {
dst = &gpBuffer[SCREENXY(0, 0)]; dst = out.at(SCREEN_X, SCREEN_Y);
tbl = &pLightTbl[idx]; tbl = &pLightTbl[idx];
for (h = gnViewportHeight; h; h--, dst += BUFFER_WIDTH - gnScreenWidth) { for (h = gnViewportHeight; h; h--, dst += out.line_width - gnScreenWidth) {
for (w = gnScreenWidth; w; w--) { for (w = gnScreenWidth; w; w--) {
if (*dst >= 32) if (*dst >= 32)
*dst = tbl[*dst]; *dst = tbl[*dst];

2
Source/control.h

@ -119,7 +119,7 @@ void DrawLevelUpIcon(CelOutputBuffer out);
void CheckChrBtns(); void CheckChrBtns();
void ReleaseChrBtns(bool addAllStatPoints); void ReleaseChrBtns(bool addAllStatPoints);
void DrawDurIcon(CelOutputBuffer out); void DrawDurIcon(CelOutputBuffer out);
void RedBack(); void RedBack(CelOutputBuffer out);
void DrawSpellBook(CelOutputBuffer out); void DrawSpellBook(CelOutputBuffer out);
void CheckSBook(); void CheckSBook();
const char *get_pieces_str(int nGold); const char *get_pieces_str(int nGold);

2
Source/gmenu.cpp

@ -64,7 +64,7 @@ static void gmenu_print_text(CelOutputBuffer out, int x, int y, const char *pszS
void gmenu_draw_pause(CelOutputBuffer out) void gmenu_draw_pause(CelOutputBuffer out)
{ {
if (currlevel != 0) if (currlevel != 0)
RedBack(); RedBack(out);
if (!sgpCurrentMenu) { if (!sgpCurrentMenu) {
light_table_index = 0; light_table_index = 0;
gmenu_print_text(out, 316 + PANEL_LEFT, 336, "Pause"); gmenu_print_text(out, 316 + PANEL_LEFT, 336, "Pause");

2
Source/scrollrt.cpp

@ -1254,7 +1254,7 @@ void DrawView(CelOutputBuffer out, int StartX, int StartY)
DrawDiabloMsg(out); DrawDiabloMsg(out);
} }
if (deathflag) { if (deathflag) {
RedBack(); RedBack(out);
} else if (PauseMode != 0) { } else if (PauseMode != 0) {
gmenu_draw_pause(out); gmenu_draw_pause(out);
} }

Loading…
Cancel
Save