Browse Source

Merge branch 'master' of github.com:diasurgical/devilution

Fixes #620
pull/647/head
Anders Jenbo 6 years ago
parent
commit
58e3192ef9
  1. 302
      Source/automap.cpp
  2. 16
      Source/automap.h
  3. 36
      Source/control.cpp
  4. 8
      Source/control.h
  5. 32
      Source/diablo.cpp
  6. 2
      Source/error.cpp
  7. 26
      Source/gamemenu.cpp
  8. 8
      Source/gamemenu.h
  9. 12
      Source/gmenu.cpp
  10. 6
      Source/gmenu.h
  11. 2
      Source/help.cpp
  12. 2
      Source/inv.cpp
  13. 2
      Source/items.cpp
  14. 2
      Source/player.cpp
  15. 2
      Source/plrmsg.cpp
  16. 2
      Source/quests.cpp
  17. 4
      Source/scrollrt.cpp
  18. 4
      Source/stores.cpp
  19. 2
      SourceX/controls/plrctrls.cpp

302
Source/automap.cpp

@ -4,19 +4,19 @@ DEVILUTION_BEGIN_NAMESPACE
// BUGFIX: only the first 256 elements are ever read
WORD automaptype[512];
static int MapX;
static int MapY;
static int AutoMapX;
static int AutoMapY;
BOOL automapflag;
char AmShiftTab[32]; // [31]?
char AmShiftTab[31];
BOOLEAN automapview[DMAXX][DMAXY];
int AutoMapScale;
int AutoMapXOfs;
int AutoMapYOfs;
int AutoMapPosBits;
int AutoMapXPos;
int AutoMapYPos;
int AMPlayerX;
int AMPlayerY;
int AmLine64;
int AmLine32;
int AmLine16;
int AmLine8;
int AmLine4;
// color used to draw the player's arrow
#define COLOR_PLAYER (PAL8_ORANGE + 1)
@ -33,18 +33,18 @@ int AMPlayerY;
#define MAPFLAG_HORZARCH 0x08
#define MAPFLAG_VERTGRATE 0x10
#define MAPFLAG_HORZGRATE 0x20
#define MAPFLAG_SQUARE 0x40
#define MAPFLAG_DIRT 0x40
#define MAPFLAG_STAIRS 0x80
void InitAutomapOnce()
{
automapflag = FALSE;
AutoMapScale = 50;
AutoMapPosBits = 32;
AutoMapXPos = 16;
AutoMapYPos = 8;
AMPlayerX = 4;
AMPlayerY = 2;
AmLine64 = 32;
AmLine32 = 16;
AmLine16 = 8;
AmLine8 = 4;
AmLine4 = 2;
}
void InitAutomap()
@ -140,11 +140,11 @@ void AutomapZoomIn()
{
if (AutoMapScale < 200) {
AutoMapScale += 5;
AutoMapPosBits = (AutoMapScale << 6) / 100;
AutoMapXPos = AutoMapPosBits >> 1;
AutoMapYPos = AutoMapXPos >> 1;
AMPlayerX = AutoMapYPos >> 1;
AMPlayerY = AMPlayerX >> 1;
AmLine64 = (AutoMapScale << 6) / 100;
AmLine32 = AmLine64 >> 1;
AmLine16 = AmLine32 >> 1;
AmLine8 = AmLine16 >> 1;
AmLine4 = AmLine8 >> 1;
}
}
@ -152,11 +152,11 @@ void AutomapZoomOut()
{
if (AutoMapScale > 50) {
AutoMapScale -= 5;
AutoMapPosBits = (AutoMapScale << 6) / 100;
AutoMapXPos = AutoMapPosBits >> 1;
AutoMapYPos = AutoMapXPos >> 1;
AMPlayerX = AutoMapYPos >> 1;
AMPlayerY = AMPlayerX >> 1;
AmLine64 = (AutoMapScale << 6) / 100;
AmLine32 = AmLine64 >> 1;
AmLine16 = AmLine32 >> 1;
AmLine8 = AmLine16 >> 1;
AmLine4 = AmLine8 >> 1;
}
}
@ -168,46 +168,46 @@ void DrawAutomap()
int mapx, mapy;
if (leveltype == DTYPE_TOWN) {
DrawAutomapGame();
DrawAutomapText();
return;
}
gpBufEnd = &gpBuffer[(PANEL_Y)*BUFFER_WIDTH];
MapX = (ViewX - 16) >> 1;
while (MapX + AutoMapXOfs < 0)
AutoMapX = (ViewX - 16) >> 1;
while (AutoMapX + AutoMapXOfs < 0)
AutoMapXOfs++;
while (MapX + AutoMapXOfs >= DMAXX)
while (AutoMapX + AutoMapXOfs >= DMAXX)
AutoMapXOfs--;
MapX += AutoMapXOfs;
AutoMapX += AutoMapXOfs;
MapY = (ViewY - 16) >> 1;
while (MapY + AutoMapYOfs < 0)
AutoMapY = (ViewY - 16) >> 1;
while (AutoMapY + AutoMapYOfs < 0)
AutoMapYOfs++;
while (MapY + AutoMapYOfs >= DMAXY)
while (AutoMapY + AutoMapYOfs >= DMAXY)
AutoMapYOfs--;
MapY += AutoMapYOfs;
AutoMapY += AutoMapYOfs;
cells = AmShiftTab[(AutoMapScale - 50) / 5];
if (ScrollInfo._sxoff + ScrollInfo._syoff)
cells++;
mapx = MapX - cells;
mapy = MapY - 1;
mapx = AutoMapX - cells;
mapy = AutoMapY - 1;
if (cells & 1) {
sx = 384 - AutoMapPosBits * ((cells - 1) >> 1);
sy = 336 - AutoMapXPos * ((cells + 1) >> 1);
sx = 384 - AmLine64 * ((cells - 1) >> 1);
sy = 336 - AmLine32 * ((cells + 1) >> 1);
} else {
sx = 384 - AutoMapPosBits * (cells >> 1) + AutoMapXPos;
sy = 336 - AutoMapXPos * (cells >> 1) - AutoMapYPos;
sx = 384 - AmLine64 * (cells >> 1) + AmLine32;
sy = 336 - AmLine32 * (cells >> 1) - AmLine16;
}
if (ViewX & 1) {
sx -= AutoMapYPos;
sy -= AMPlayerX;
sx -= AmLine16;
sy -= AmLine8;
}
if (ViewY & 1) {
sx += AutoMapYPos;
sy -= AMPlayerX;
sx += AmLine16;
sy -= AmLine8;
}
sx += AutoMapScale * ScrollInfo._sxoff / 100 >> 1;
@ -226,27 +226,27 @@ void DrawAutomap()
for (j = 0; j < cells; j++) {
WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE);
if (maptype)
DrawAutomapType(x, sy, maptype);
x += AutoMapPosBits;
DrawAutomapTile(x, sy, maptype);
x += AmLine64;
}
mapy++;
x = sx - AutoMapXPos;
y = sy + AutoMapYPos;
x = sx - AmLine32;
y = sy + AmLine16;
for (j = 0; j <= cells; j++) {
WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE);
if (maptype)
DrawAutomapType(x, y, maptype);
x += AutoMapPosBits;
DrawAutomapTile(x, y, maptype);
x += AmLine64;
}
mapx++;
sy += AutoMapXPos;
sy += AmLine32;
}
DrawAutomapPlr();
DrawAutomapGame();
DrawAutomapText();
gpBufEnd = &gpBuffer[BUFFER_WIDTH * (SCREEN_HEIGHT + SCREEN_Y)];
}
void DrawAutomapType(int sx, int sy, WORD automap_type)
void DrawAutomapTile(int sx, int sy, WORD automap_type)
{
BOOL do_vert;
BOOL do_horz;
@ -256,30 +256,30 @@ void DrawAutomapType(int sx, int sy, WORD automap_type)
BYTE flags = automap_type >> 8;
if (flags & MAPFLAG_SQUARE) {
if (flags & MAPFLAG_DIRT) {
ENG_set_pixel(sx, sy, COLOR_DIM);
ENG_set_pixel(sx - AMPlayerX, sy - AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx - AMPlayerX, sy + AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx + AMPlayerX, sy - AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx + AMPlayerX, sy + AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx - AutoMapYPos, sy, COLOR_DIM);
ENG_set_pixel(sx + AutoMapYPos, sy, COLOR_DIM);
ENG_set_pixel(sx, sy - AMPlayerX, COLOR_DIM);
ENG_set_pixel(sx, sy + AMPlayerX, COLOR_DIM);
ENG_set_pixel(sx + AMPlayerX - AutoMapXPos, sy + AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx - AMPlayerX + AutoMapXPos, sy + AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx - AutoMapYPos, sy + AMPlayerX, COLOR_DIM);
ENG_set_pixel(sx + AutoMapYPos, sy + AMPlayerX, COLOR_DIM);
ENG_set_pixel(sx - AMPlayerX, sy + AutoMapYPos - AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx + AMPlayerX, sy + AutoMapYPos - AMPlayerY, COLOR_DIM);
ENG_set_pixel(sx, sy + AutoMapYPos, 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);
}
if (flags & MAPFLAG_STAIRS) {
DrawLine(sx - AMPlayerX, sy - AMPlayerX - AMPlayerY, sx + AMPlayerX + AutoMapYPos, sy + AMPlayerY, COLOR_BRIGHT);
DrawLine(sx - AutoMapYPos, sy - AMPlayerX, sx + AutoMapYPos, sy + AMPlayerX, COLOR_BRIGHT);
DrawLine(sx - AutoMapYPos - AMPlayerX, sy - AMPlayerY, sx + AMPlayerX, sy + AMPlayerX + AMPlayerY, COLOR_BRIGHT);
DrawLine(sx - AutoMapXPos, sy, sx, sy + AutoMapYPos, COLOR_BRIGHT);
DrawLine(sx - AmLine8, sy - AmLine8 - AmLine4, sx + AmLine8 + AmLine16, sy + AmLine4, COLOR_BRIGHT);
DrawLine(sx - AmLine16, sy - AmLine8, sx + AmLine16, sy + AmLine8, COLOR_BRIGHT);
DrawLine(sx - AmLine16 - AmLine8, sy - AmLine4, sx + AmLine8, sy + AmLine8 + AmLine4, COLOR_BRIGHT);
DrawLine(sx - AmLine32, sy, sx, sy + AmLine16, COLOR_BRIGHT);
}
do_vert = FALSE;
@ -288,10 +288,10 @@ void DrawAutomapType(int sx, int sy, WORD automap_type)
do_cave_vert = FALSE;
switch (automap_type & MAPFLAG_TYPE) {
case 1: // stand-alone column or other unpassable object
x1 = sx - AutoMapYPos;
y1 = sy - AutoMapYPos;
x2 = x1 + AutoMapXPos;
y2 = sy - AMPlayerX;
x1 = sx - AmLine16;
y1 = sy - AmLine16;
x2 = x1 + AmLine32;
y2 = sy - AmLine8;
DrawLine(sx, y1, x1, y2, COLOR_DIM);
DrawLine(sx, y1, x2, y2, COLOR_DIM);
DrawLine(sx, sy, x1, y2, COLOR_DIM);
@ -331,27 +331,27 @@ void DrawAutomapType(int sx, int sy, WORD automap_type)
if (do_vert) { // right-facing obstacle
if (flags & MAPFLAG_VERTDOOR) { // two wall segments with a door in the middle
x1 = sx - AutoMapXPos;
x2 = sx - AutoMapYPos;
y1 = sy - AutoMapYPos;
y2 = sy - AMPlayerX;
x1 = sx - AmLine32;
x2 = sx - AmLine16;
y1 = sy - AmLine16;
y2 = sy - AmLine8;
DrawLine(sx, y1, sx - AMPlayerX, y1 + AMPlayerY, COLOR_DIM);
DrawLine(x1, sy, x1 + AMPlayerX, sy - AMPlayerY, COLOR_DIM);
DrawLine(sx, y1, sx - AmLine8, y1 + AmLine4, COLOR_DIM);
DrawLine(x1, sy, x1 + AmLine8, sy - AmLine4, COLOR_DIM);
DrawLine(x2, y1, x1, y2, COLOR_BRIGHT);
DrawLine(x2, y1, sx, y2, COLOR_BRIGHT);
DrawLine(x2, sy, x1, y2, COLOR_BRIGHT);
DrawLine(x2, sy, sx, y2, COLOR_BRIGHT);
}
if (flags & MAPFLAG_VERTGRATE) { // right-facing half-wall
DrawLine(sx - AutoMapYPos, sy - AMPlayerX, sx - AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx - AmLine16, sy - AmLine8, sx - AmLine32, sy, COLOR_DIM);
flags |= MAPFLAG_VERTARCH;
}
if (flags & MAPFLAG_VERTARCH) { // window or passable column
x1 = sx - AutoMapYPos;
y1 = sy - AutoMapYPos;
x2 = x1 + AutoMapXPos;
y2 = sy - AMPlayerX;
x1 = sx - AmLine16;
y1 = sy - AmLine16;
x2 = x1 + AmLine32;
y2 = sy - AmLine8;
DrawLine(sx, y1, x1, y2, COLOR_DIM);
DrawLine(sx, y1, x2, y2, COLOR_DIM);
@ -359,32 +359,32 @@ void DrawAutomapType(int sx, int sy, WORD automap_type)
DrawLine(sx, sy, x2, y2, COLOR_DIM);
}
if (!(flags & (MAPFLAG_VERTDOOR | MAPFLAG_VERTGRATE | MAPFLAG_VERTARCH)))
DrawLine(sx, sy - AutoMapYPos, sx - AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx, sy - AmLine16, sx - AmLine32, sy, COLOR_DIM);
}
if (do_horz) { // left-facing obstacle
if (flags & MAPFLAG_HORZDOOR) {
x1 = sx + AutoMapYPos;
x2 = sx + AutoMapXPos;
y1 = sy - AutoMapYPos;
y2 = sy - AMPlayerX;
x1 = sx + AmLine16;
x2 = sx + AmLine32;
y1 = sy - AmLine16;
y2 = sy - AmLine8;
DrawLine(sx, y1, sx + AMPlayerX, y1 + AMPlayerY, COLOR_DIM);
DrawLine(x2, sy, x2 - AMPlayerX, sy - AMPlayerY, COLOR_DIM);
DrawLine(sx, y1, sx + AmLine8, y1 + AmLine4, COLOR_DIM);
DrawLine(x2, sy, x2 - AmLine8, sy - AmLine4, COLOR_DIM);
DrawLine(x1, y1, sx, y2, COLOR_BRIGHT);
DrawLine(x1, y1, x2, y2, COLOR_BRIGHT);
DrawLine(x1, sy, sx, y2, COLOR_BRIGHT);
DrawLine(x1, sy, x2, y2, COLOR_BRIGHT);
}
if (flags & MAPFLAG_HORZGRATE) {
DrawLine(sx + AutoMapYPos, sy - AMPlayerX, sx + AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx + AmLine16, sy - AmLine8, sx + AmLine32, sy, COLOR_DIM);
flags |= MAPFLAG_HORZARCH;
}
if (flags & MAPFLAG_HORZARCH) {
x1 = sx - AutoMapYPos;
y1 = sy - AutoMapYPos;
x2 = x1 + AutoMapXPos;
y2 = sy - AMPlayerX;
x1 = sx - AmLine16;
y1 = sy - AmLine16;
x2 = x1 + AmLine32;
y2 = sy - AmLine8;
DrawLine(sx, y1, x1, y2, COLOR_DIM);
DrawLine(sx, y1, x2, y2, COLOR_DIM);
@ -392,42 +392,42 @@ void DrawAutomapType(int sx, int sy, WORD automap_type)
DrawLine(sx, sy, x2, y2, COLOR_DIM);
}
if (!(flags & (MAPFLAG_HORZDOOR | MAPFLAG_HORZGRATE | MAPFLAG_HORZARCH)))
DrawLine(sx, sy - AutoMapYPos, sx + AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx, sy - AmLine16, sx + AmLine32, sy, COLOR_DIM);
}
// for caves the horz/vert flags are switched
if (do_cave_horz) {
if (flags & MAPFLAG_VERTDOOR) {
x1 = sx - AutoMapXPos;
x2 = sx - AutoMapYPos;
y1 = sy + AutoMapYPos;
y2 = sy + AMPlayerX;
x1 = sx - AmLine32;
x2 = sx - AmLine16;
y1 = sy + AmLine16;
y2 = sy + AmLine8;
DrawLine(sx, y1, sx - AMPlayerX, y1 - AMPlayerY, COLOR_DIM);
DrawLine(x1, sy, x1 + AMPlayerX, sy + AMPlayerY, COLOR_DIM);
DrawLine(sx, y1, sx - AmLine8, y1 - AmLine4, COLOR_DIM);
DrawLine(x1, sy, x1 + AmLine8, sy + AmLine4, COLOR_DIM);
DrawLine(x2, y1, x1, y2, COLOR_BRIGHT);
DrawLine(x2, y1, sx, y2, COLOR_BRIGHT);
DrawLine(x2, sy, x1, y2, COLOR_BRIGHT);
DrawLine(x2, sy, sx, y2, COLOR_BRIGHT);
} else
DrawLine(sx, sy + AutoMapYPos, sx - AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx, sy + AmLine16, sx - AmLine32, sy, COLOR_DIM);
}
if (do_cave_vert) {
if (flags & MAPFLAG_HORZDOOR) {
x1 = sx + AutoMapYPos;
x2 = sx + AutoMapXPos;
y1 = sy + AutoMapYPos;
y2 = sy + AMPlayerX;
x1 = sx + AmLine16;
x2 = sx + AmLine32;
y1 = sy + AmLine16;
y2 = sy + AmLine8;
DrawLine(sx, y1, sx + AMPlayerX, y1 - AMPlayerY, COLOR_DIM);
DrawLine(x2, sy, x2 - AMPlayerX, sy + AMPlayerY, COLOR_DIM);
DrawLine(sx, y1, sx + AmLine8, y1 - AmLine4, COLOR_DIM);
DrawLine(x2, sy, x2 - AmLine8, sy + AmLine4, COLOR_DIM);
DrawLine(x1, y1, sx, y2, COLOR_BRIGHT);
DrawLine(x1, y1, x2, y2, COLOR_BRIGHT);
DrawLine(x1, sy, sx, y2, COLOR_BRIGHT);
DrawLine(x1, sy, x2, y2, COLOR_BRIGHT);
} else
DrawLine(sx, sy + AutoMapYPos, sx + AutoMapXPos, sy, COLOR_DIM);
DrawLine(sx, sy + AmLine16, sx + AmLine32, sy, COLOR_DIM);
}
}
@ -450,55 +450,55 @@ void DrawAutomapPlr()
px = x - 2 * AutoMapXOfs - ViewX;
py = y - 2 * AutoMapYOfs - ViewY;
x = (plr[myplr]._pxoff * AutoMapScale / 100 >> 1) + (ScrollInfo._sxoff * AutoMapScale / 100 >> 1) + (px - py) * AutoMapYPos + 384;
y = (plr[myplr]._pyoff * AutoMapScale / 100 >> 1) + (ScrollInfo._syoff * AutoMapScale / 100 >> 1) + (px + py) * AMPlayerX + 336;
x = (plr[myplr]._pxoff * AutoMapScale / 100 >> 1) + (ScrollInfo._sxoff * AutoMapScale / 100 >> 1) + (px - py) * AmLine16 + 384;
y = (plr[myplr]._pyoff * AutoMapScale / 100 >> 1) + (ScrollInfo._syoff * AutoMapScale / 100 >> 1) + (px + py) * AmLine8 + 336;
if (invflag || sbookflag)
x -= 160;
if (chrflag || questlog)
x += 160;
y -= AMPlayerX;
y -= AmLine8;
switch (plr[myplr]._pdir) {
case DIR_N:
DrawLine(x, y, x, y - AutoMapYPos, COLOR_PLAYER);
DrawLine(x, y - AutoMapYPos, x - AMPlayerY, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x, y - AutoMapYPos, x + AMPlayerY, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x, y, x, y - AmLine16, COLOR_PLAYER);
DrawLine(x, y - AmLine16, x - AmLine4, y - AmLine8, COLOR_PLAYER);
DrawLine(x, y - AmLine16, x + AmLine4, y - AmLine8, COLOR_PLAYER);
break;
case DIR_NE:
DrawLine(x, y, x + AutoMapYPos, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y - AMPlayerX, x + AMPlayerX, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y - AMPlayerX, x + AMPlayerX + AMPlayerY, y, COLOR_PLAYER);
DrawLine(x, y, x + AmLine16, y - AmLine8, COLOR_PLAYER);
DrawLine(x + AmLine16, y - AmLine8, x + AmLine8, y - AmLine8, COLOR_PLAYER);
DrawLine(x + AmLine16, y - AmLine8, x + AmLine8 + AmLine4, y, COLOR_PLAYER);
break;
case DIR_E:
DrawLine(x, y, x + AutoMapYPos, y, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y, x + AMPlayerX, y - AMPlayerY, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y, x + AMPlayerX, y + AMPlayerY, COLOR_PLAYER);
DrawLine(x, y, x + AmLine16, y, COLOR_PLAYER);
DrawLine(x + AmLine16, y, x + AmLine8, y - AmLine4, COLOR_PLAYER);
DrawLine(x + AmLine16, y, x + AmLine8, y + AmLine4, COLOR_PLAYER);
break;
case DIR_SE:
DrawLine(x, y, x + AutoMapYPos, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y + AMPlayerX, x + AMPlayerX + AMPlayerY, y, COLOR_PLAYER);
DrawLine(x + AutoMapYPos, y + AMPlayerX, x + AMPlayerX, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x, y, x + AmLine16, y + AmLine8, COLOR_PLAYER);
DrawLine(x + AmLine16, y + AmLine8, x + AmLine8 + AmLine4, y, COLOR_PLAYER);
DrawLine(x + AmLine16, y + AmLine8, x + AmLine8, y + AmLine8, COLOR_PLAYER);
break;
case DIR_S:
DrawLine(x, y, x, y + AutoMapYPos, COLOR_PLAYER);
DrawLine(x, y + AutoMapYPos, x + AMPlayerY, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x, y + AutoMapYPos, x - AMPlayerY, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x, y, x, y + AmLine16, COLOR_PLAYER);
DrawLine(x, y + AmLine16, x + AmLine4, y + AmLine8, COLOR_PLAYER);
DrawLine(x, y + AmLine16, x - AmLine4, y + AmLine8, COLOR_PLAYER);
break;
case DIR_SW:
DrawLine(x, y, x - AutoMapYPos, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y + AMPlayerX, x - AMPlayerY - AMPlayerX, y, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y + AMPlayerX, x - AMPlayerX, y + AMPlayerX, COLOR_PLAYER);
DrawLine(x, y, x - AmLine16, y + AmLine8, COLOR_PLAYER);
DrawLine(x - AmLine16, y + AmLine8, x - AmLine4 - AmLine8, y, COLOR_PLAYER);
DrawLine(x - AmLine16, y + AmLine8, x - AmLine8, y + AmLine8, COLOR_PLAYER);
break;
case DIR_W:
DrawLine(x, y, x - AutoMapYPos, y, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y, x - AMPlayerX, y - AMPlayerY, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y, x - AMPlayerX, y + AMPlayerY, COLOR_PLAYER);
DrawLine(x, y, x - AmLine16, y, COLOR_PLAYER);
DrawLine(x - AmLine16, y, x - AmLine8, y - AmLine4, COLOR_PLAYER);
DrawLine(x - AmLine16, y, x - AmLine8, y + AmLine4, COLOR_PLAYER);
break;
case DIR_NW:
DrawLine(x, y, x - AutoMapYPos, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y - AMPlayerX, x - AMPlayerX, y - AMPlayerX, COLOR_PLAYER);
DrawLine(x - AutoMapYPos, y - AMPlayerX, x - AMPlayerY - AMPlayerX, y, COLOR_PLAYER);
DrawLine(x, y, x - AmLine16, y - AmLine8, COLOR_PLAYER);
DrawLine(x - AmLine16, y - AmLine8, x - AmLine8, y - AmLine8, COLOR_PLAYER);
DrawLine(x - AmLine16, y - AmLine8, x - AmLine4 - AmLine8, y, COLOR_PLAYER);
break;
}
}
@ -508,18 +508,18 @@ WORD GetAutomapType(int x, int y, BOOL view)
WORD rv;
if (view && x == -1 && y >= 0 && y < DMAXY && automapview[0][y]) {
if (GetAutomapType(0, y, FALSE) & (MAPFLAG_SQUARE << 8)) {
if (GetAutomapType(0, y, FALSE) & (MAPFLAG_DIRT << 8)) {
return 0;
} else {
return MAPFLAG_SQUARE << 8;
return MAPFLAG_DIRT << 8;
}
}
if (view && y == -1 && x >= 0 && x < DMAXY && automapview[x][0]) {
if (GetAutomapType(x, 0, FALSE) & (MAPFLAG_SQUARE << 8)) {
if (GetAutomapType(x, 0, FALSE) & (MAPFLAG_DIRT << 8)) {
return 0;
} else {
return MAPFLAG_SQUARE << 8;
return MAPFLAG_DIRT << 8;
}
}
@ -544,7 +544,7 @@ WORD GetAutomapType(int x, int y, BOOL view)
return rv;
}
void DrawAutomapGame()
void DrawAutomapText()
{
char desc[256];
int nextline = 20;
@ -643,11 +643,11 @@ void AutomapZoomReset()
{
AutoMapXOfs = 0;
AutoMapYOfs = 0;
AutoMapPosBits = (AutoMapScale << 6) / 100;
AutoMapXPos = AutoMapPosBits >> 1;
AutoMapYPos = AutoMapXPos >> 1;
AMPlayerX = AutoMapYPos >> 1;
AMPlayerY = AMPlayerX >> 1;
AmLine64 = (AutoMapScale << 6) / 100;
AmLine32 = AmLine64 >> 1;
AmLine16 = AmLine32 >> 1;
AmLine8 = AmLine16 >> 1;
AmLine4 = AmLine8 >> 1;
}
DEVILUTION_END_NAMESPACE

16
Source/automap.h

@ -4,16 +4,16 @@
extern WORD automaptype[512];
extern BOOL automapflag;
extern char AmShiftTab[32];
extern char AmShiftTab[31];
extern BOOLEAN automapview[DMAXX][DMAXY];
extern int AutoMapScale;
extern int AutoMapXOfs;
extern int AutoMapYOfs;
extern int AutoMapPosBits;
extern int AutoMapXPos;
extern int AutoMapYPos;
extern int AMPlayerX;
extern int AMPlayerY;
extern int AmLine64;
extern int AmLine32;
extern int AmLine16;
extern int AmLine8;
extern int AmLine4;
void InitAutomapOnce();
void InitAutomap();
@ -25,10 +25,10 @@ void AutomapRight();
void AutomapZoomIn();
void AutomapZoomOut();
void DrawAutomap();
void DrawAutomapType(int screen_x, int screen_y, WORD automap_type);
void DrawAutomapTile(int screen_x, int screen_y, WORD automap_type);
void DrawAutomapPlr();
WORD GetAutomapType(int x, int y, BOOL view);
void DrawAutomapGame();
void DrawAutomapText();
void SetAutomapView(int x, int y);
void AutomapZoomReset();

36
Source/control.cpp

@ -471,7 +471,7 @@ void ToggleSpell(int slot)
* @param nCel Number of letter in Windows-1252
* @param col text_color color value
*/
void CPrintString(int sx, int sy, int nCel, char col)
void PrintChar(int sx, int sy, int nCel, char col)
{
/// ASSERT: assert(gpBuffer);
@ -798,7 +798,7 @@ void InitControlPan()
PentSpn2Frame = 1;
}
void ClearCtrlPan()
void DrawCtrlPan()
{
DrawPanelBox(0, sgbPlrTalkTbl + 16, PANEL_WIDTH, PANEL_HEIGHT, PANEL_X, PANEL_Y);
DrawInfoBox();
@ -808,7 +808,7 @@ void ClearCtrlPan()
* Draws the control panel buttons in their current state. If the button is in the default
* state draw it from the panel cel(extract its sub-rect). Else draw it from the buttons cel.
*/
void DrawCtrlPan()
void DrawCtrlBtns()
{
int i;
@ -947,15 +947,14 @@ void DoAutoMap()
*/
void CheckPanelInfo()
{
int i, c, v, s;
int i, c, v, s, xend, yend;
panelflag = FALSE;
ClearPanel();
for (i = 0; i < numpanbtns; i++) {
if (MouseX >= PanBtnPos[i][0]
&& MouseX <= PanBtnPos[i][0] + PanBtnPos[i][2]
&& MouseY >= PanBtnPos[i][1]
&& MouseY <= PanBtnPos[i][1] + PanBtnPos[i][3]) {
xend = PanBtnPos[i][0] + PanBtnPos[i][2];
yend = PanBtnPos[i][1] + PanBtnPos[i][3];
if (MouseX >= PanBtnPos[i][0] && MouseX <= xend && MouseY >= PanBtnPos[i][1] && MouseY <= yend) {
if (i != 7) {
strcpy(infostr, PanBtnStr[i]);
} else {
@ -1219,10 +1218,10 @@ void DrawInfoBox()
}
}
if (infostr[0] || pnumlines)
control_draw_info_str();
PrintInfo();
}
void control_draw_info_str()
void PrintInfo()
{
int yo, lo, i;
@ -1230,18 +1229,18 @@ void control_draw_info_str()
yo = 0;
lo = 1;
if (infostr[0]) {
control_print_info_str(0, infostr, TRUE, pnumlines);
CPrintString(0, infostr, TRUE, pnumlines);
yo = 1;
lo = 0;
}
for (i = 0; i < pnumlines; i++) {
control_print_info_str(i + yo, panelstr[i], pstrjust[i], pnumlines - lo);
CPrintString(i + yo, panelstr[i], pstrjust[i], pnumlines - lo);
}
}
}
void control_print_info_str(int y, char *str, BOOL center, int lines)
void CPrintString(int y, char *str, BOOL center, int lines)
{
BYTE c;
char *tmp;
@ -1267,7 +1266,7 @@ void control_print_info_str(int y, char *str, BOOL center, int lines)
lineOffset += fontkern[c] + 2;
if (c) {
if (lineOffset < 288) {
CPrintString(sx, sy, c, infoclr);
PrintChar(sx, sy, c, infoclr);
}
}
sx += fontkern[c] + 2;
@ -1284,7 +1283,7 @@ void PrintGameStr(int x, int y, const char *str, int color)
c = gbFontTransTbl[(BYTE)*str++];
c = fontframe[c];
if (c)
CPrintString(sx, sy, c, color);
PrintChar(sx, sy, c, color);
sx += fontkern[c] + 1;
}
}
@ -1494,7 +1493,6 @@ void DrawChr()
ADD_PlrStringXY(143, 332, 174, chrstr, col);
}
/**
* @brief Render text string to back buffer
* @param x Screen coordinate
@ -1529,7 +1527,7 @@ void MY_PlrStringXY(int x, int y, int endX, char *pszStr, char col, int base)
line += fontkern[c] + base;
if (c) {
if (line < widthOffset)
CPrintString(sx, sy, c, col);
PrintChar(sx, sy, c, col);
}
sx += fontkern[c] + base;
}
@ -1827,7 +1825,7 @@ void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col)
line += fontkern[c] + 1;
if (c) {
if (line <= 222)
CPrintString(sx, y, c, col);
PrintChar(sx, y, c, col);
}
sx += fontkern[c] + 1;
}
@ -2048,7 +2046,7 @@ char *control_print_talk_msg(char *msg, int *x, int y, int color)
return msg;
msg++;
if (c) {
CPrintString(*x, y + 22 + PANEL_Y, c, color);
PrintChar(*x, y + 22 + PANEL_Y, c, color);
}
*x += fontkern[c] + 1;
}

8
Source/control.h

@ -58,7 +58,7 @@ void DrawSpellList();
void SetSpell();
void SetSpeedSpell(int slot);
void ToggleSpell(int slot);
void CPrintString(int sx, int sy, int nCel, char col);
void PrintChar(int sx, int sy, int nCel, char col);
void AddPanelString(char *str, BOOL just);
void ClearPanel();
void DrawPanelBox(int x, int y, int w, int h, int sx, int sy);
@ -71,8 +71,8 @@ void DrawManaFlask();
void control_update_life_mana();
void UpdateManaFlask();
void InitControlPan();
void ClearCtrlPan();
void DrawCtrlPan();
void DrawCtrlBtns();
void DoSpeedBook();
void DoPanBtn();
void control_set_button_down(int btn_id);
@ -83,8 +83,8 @@ void CheckBtnUp();
void FreeControlPan();
BOOL control_WriteStringToBuffer(BYTE *str);
void DrawInfoBox();
void control_draw_info_str();
void control_print_info_str(int y, char *str, BOOL center, int lines);
void PrintInfo();
void CPrintString(int y, char *str, BOOL center, int lines);
void PrintGameStr(int x, int y, const char *str, int color);
void DrawChr();
#define ADD_PlrStringXY(x, y, width, pszStr, col) MY_PlrStringXY(x, y, width, pszStr, col, 1)

32
Source/diablo.cpp

@ -130,12 +130,12 @@ static bool ProcessInput()
if (PauseMode == 2) {
return false;
}
if (gbMaxPlayers == 1 && gmenu_exception()) {
if (gbMaxPlayers == 1 && gmenu_is_active()) {
force_redraw |= 1;
return false;
}
if (!gmenu_exception() && sgnTimeoutCurs == 0) {
if (!gmenu_is_active() && sgnTimeoutCurs == 0) {
#ifndef USE_SDL1
finish_simulated_mouse_clicks(MouseX, MouseY);
#endif
@ -610,7 +610,7 @@ BOOL LeftMouseDown(int wParam)
} else if (stextflag) {
CheckStoreBtn();
} else if (MouseY < PANEL_TOP || MouseX < PANEL_LEFT || MouseX > PANEL_LEFT + PANEL_WIDTH) {
if (!gmenu_exception() && !TryIconCurs()) {
if (!gmenu_is_active() && !TryIconCurs()) {
if (questlog && MouseX > 32 && MouseX < 288 && MouseY > 32 && MouseY < 308) {
QuestlogESC();
} else if (qtextflag) {
@ -636,7 +636,7 @@ BOOL LeftMouseDown(int wParam)
}
}
} else {
if (!talkflag && !dropGoldFlag && !gmenu_exception())
if (!talkflag && !dropGoldFlag && !gmenu_is_active())
CheckInvScrn();
DoPanBtn();
if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM)
@ -769,7 +769,7 @@ void LeftMouseUp()
void RightMouseDown()
{
if (!gmenu_exception() && sgnTimeoutCurs == CURSOR_NONE && PauseMode != 2 && !plr[myplr]._pInvincible) {
if (!gmenu_is_active() && sgnTimeoutCurs == CURSOR_NONE && PauseMode != 2 && !plr[myplr]._pInvincible) {
if (doomflag) {
doom_close();
} else if (!stextflag) {
@ -792,7 +792,7 @@ void RightMouseDown()
BOOL PressSysKey(int wParam)
{
if (gmenu_exception() || wParam != VK_F10)
if (gmenu_is_active() || wParam != VK_F10)
return FALSE;
diablo_hotkey_msg(1);
return TRUE;
@ -853,7 +853,7 @@ void PressKey(int vkey)
if (vkey == VK_ESCAPE) {
if (!PressEscKey()) {
track_repeat_walk(FALSE);
gamemenu_previous();
gamemenu_on();
}
return;
}
@ -930,31 +930,31 @@ void PressKey(int vkey)
#endif
else if (vkey == VK_F5) {
if (spselflag) {
ToggleSpell(0);
SetSpeedSpell(0);
return;
}
SetSpeedSpell(0);
ToggleSpell(0);
return;
} else if (vkey == VK_F6) {
if (spselflag) {
ToggleSpell(1);
SetSpeedSpell(1);
return;
}
SetSpeedSpell(1);
ToggleSpell(1);
return;
} else if (vkey == VK_F7) {
if (spselflag) {
ToggleSpell(2);
SetSpeedSpell(2);
return;
}
SetSpeedSpell(2);
ToggleSpell(2);
return;
} else if (vkey == VK_F8) {
if (spselflag) {
ToggleSpell(3);
SetSpeedSpell(3);
return;
}
SetSpeedSpell(3);
ToggleSpell(3);
return;
} else if (vkey == VK_F9) {
diablo_hotkey_msg(0);
@ -1043,7 +1043,7 @@ void diablo_pause_game()
/* NOTE: `return` must be used instead of `break` to be bin exact as C++ */
void PressChar(int vkey)
{
if (gmenu_exception() || control_talk_last_key(vkey) || sgnTimeoutCurs != 0 || deathflag) {
if (gmenu_is_active() || control_talk_last_key(vkey) || sgnTimeoutCurs != 0 || deathflag) {
return;
}
if ((char)vkey == 'p' || (char)vkey == 'P') {

2
Source/error.cpp

@ -128,7 +128,7 @@ void DrawDiabloMsg()
for (i = 0; i < len; i++) {
c = fontframe[gbFontTransTbl[(BYTE)tempstr[i]]];
if (c != '\0') {
CPrintString(sx, sy, c, COL_GOLD);
PrintChar(sx, sy, c, COL_GOLD);
}
sx += fontkern[c] + 1;
}

26
Source/gamemenu.cpp

@ -30,7 +30,7 @@ TMenuItem sgOptionsMenu[6] = {
{ GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_sound_volume },
{ GMENU_ENABLED | GMENU_SLIDER, "Gamma", &gamemenu_gamma },
{ GMENU_ENABLED , NULL, &gamemenu_color_cycling },
{ GMENU_ENABLED , "Previous Menu", &j_gamemenu_previous },
{ GMENU_ENABLED , "Previous Menu", &gamemenu_previous },
{ GMENU_ENABLED , NULL, NULL }
// clang-format on
};
@ -38,23 +38,23 @@ char *music_toggle_names[] = { "Music", "Music Disabled" };
char *sound_toggle_names[] = { "Sound", "Sound Disabled" };
char *color_cycling_toggle_names[] = { "Color Cycling Off", "Color Cycling On" };
void gamemenu_previous()
void gamemenu_on()
{
void (*proc)(TMenuItem *);
TMenuItem *item;
if (gbMaxPlayers == 1) {
proc = gamemenu_enable_single;
proc = gamemenu_update_single;
item = sgSingleMenu;
} else {
proc = gamemenu_enable_multi;
proc = gamemenu_update_multi;
item = sgMultiMenu;
}
gmenu_call_proc(item, proc);
gmenu_set_items(item, proc);
PressEscKey();
}
void gamemenu_enable_single(TMenuItem *pMenuItems)
void gamemenu_update_single(TMenuItem *pMenuItems)
{
BOOL enable;
@ -67,27 +67,27 @@ void gamemenu_enable_single(TMenuItem *pMenuItems)
gmenu_enable(sgSingleMenu, enable);
}
void gamemenu_enable_multi(TMenuItem *pMenuItems)
void gamemenu_update_multi(TMenuItem *pMenuItems)
{
gmenu_enable(&sgMultiMenu[2], deathflag);
}
void gamemenu_off()
{
gmenu_call_proc(0, NULL);
gmenu_set_items(0, NULL);
}
void gamemenu_handle_previous()
{
if (gmenu_exception())
if (gmenu_is_active())
gamemenu_off();
else
gamemenu_previous();
gamemenu_on();
}
void j_gamemenu_previous(BOOL bActivate)
void gamemenu_previous(BOOL bActivate)
{
gamemenu_previous();
gamemenu_on();
}
void gamemenu_new_game(BOOL bActivate)
@ -168,7 +168,7 @@ void gamemenu_options(BOOL bActivate)
gamemenu_get_sound();
gamemenu_get_gamma();
gamemenu_get_color_cycling();
gmenu_call_proc(sgOptionsMenu, NULL);
gmenu_set_items(sgOptionsMenu, NULL);
}
void gamemenu_get_music()

8
Source/gamemenu.h

@ -2,12 +2,12 @@
#ifndef __GAMEMENU_H__
#define __GAMEMENU_H__
void gamemenu_previous();
void gamemenu_enable_single(TMenuItem *pMenuItems);
void gamemenu_enable_multi(TMenuItem *pMenuItems);
void gamemenu_on();
void gamemenu_update_single(TMenuItem *pMenuItems);
void gamemenu_update_multi(TMenuItem *pMenuItems);
void gamemenu_off();
void gamemenu_handle_previous();
void j_gamemenu_previous(BOOL bActivate);
void gamemenu_previous(BOOL bActivate);
void gamemenu_new_game(BOOL bActivate);
void gamemenu_quit_game(BOOL bActivate);
void gamemenu_load_game(BOOL bActivate);

12
Source/gmenu.cpp

@ -86,12 +86,12 @@ void gmenu_init_menu()
optbar_cel = LoadFileInMem("Data\\optbar.CEL", NULL);
}
BOOL gmenu_exception()
BOOL gmenu_is_active()
{
return sgpCurrentMenu != 0;
}
void gmenu_call_proc(TMenuItem *pItem, void (*gmFunc)(TMenuItem *))
void gmenu_set_items(TMenuItem *pItem, void (*gmFunc)(TMenuItem *))
{
int i;
@ -240,7 +240,7 @@ BOOL gmenu_presskeys(int vkey)
break;
case VK_ESCAPE:
PlaySFX(IS_TITLEMOV);
gmenu_call_proc(0, 0);
gmenu_set_items(0, 0);
break;
case VK_SPACE:
return FALSE;
@ -287,7 +287,7 @@ BOOL gmenu_on_mouse_move()
if (!mouseNavigation)
return FALSE;
gmenu_valid_mouse_pos(&step);
gmenu_get_mouse_slider(&step);
nSteps = (int)(sgpCurrItem->dwFlags & 0xFFF000) >> 12;
step *= nSteps;
step /= 256;
@ -298,7 +298,7 @@ BOOL gmenu_on_mouse_move()
return TRUE;
}
BOOLEAN gmenu_valid_mouse_pos(int *plOffset)
BOOLEAN gmenu_get_mouse_slider(int *plOffset)
{
*plOffset = 282;
if (MouseX < 282 + PANEL_LEFT) {
@ -355,7 +355,7 @@ BOOL gmenu_left_mouse(BOOL isDown)
sgpCurrItem = pItem;
PlaySFX(IS_TITLEMOV);
if (pItem->dwFlags & GMENU_SLIDER) {
mouseNavigation = gmenu_valid_mouse_pos(&dummy);
mouseNavigation = gmenu_get_mouse_slider(&dummy);
gmenu_on_mouse_move();
} else {
sgpCurrItem->fnMenu(TRUE);

6
Source/gmenu.h

@ -17,8 +17,8 @@ void gmenu_draw_pause();
void gmenu_print_text(int x, int y, char *pszStr);
void FreeGMenu();
void gmenu_init_menu();
BOOL gmenu_exception();
void gmenu_call_proc(TMenuItem *pItem, void (*gmFunc)(TMenuItem *));
BOOL gmenu_is_active();
void gmenu_set_items(TMenuItem *pItem, void (*gmFunc)(TMenuItem *));
void gmenu_up_down(BOOL isDown);
void gmenu_draw();
void gmenu_draw_menu_item(TMenuItem *pItem, int y);
@ -27,7 +27,7 @@ int gmenu_get_lfont(TMenuItem *pItem);
BOOL gmenu_presskeys(int vkey);
void gmenu_left_right(BOOL isRight);
BOOL gmenu_on_mouse_move();
BOOLEAN gmenu_valid_mouse_pos(int *plOffset);
BOOLEAN gmenu_get_mouse_slider(int *plOffset);
BOOL gmenu_left_mouse(BOOL isDown);
void gmenu_enable(TMenuItem *pMenuItem, BOOL enable);
void gmenu_slider_set(TMenuItem *pItem, int min, int max, int gamma);

2
Source/help.cpp

@ -548,7 +548,7 @@ void DrawHelpLine(int always_0, int help_line_nr, char *text, char color)
width += fontkern[c] + 1;
if (c) {
if (width <= 577)
CPrintString(sx, sy, c, color);
PrintChar(sx, sy, c, color);
}
sx += fontkern[c] + 1;
}

2
Source/inv.cpp

@ -421,7 +421,7 @@ void DrawInvBelt()
&& plr[myplr].SpdList[i]._itype != ITYPE_GOLD) {
fi = i + 49;
ff = fontframe[gbFontTransTbl[fi]];
CPrintString(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X + 28 - fontkern[ff], InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, ff, 0);
PrintChar(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X + 28 - fontkern[ff], InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, ff, 0);
}
}
}

2
Source/items.cpp

@ -2941,7 +2941,7 @@ void PrintUString(int x, int y, BOOL cjustflag, char *str, int col)
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
k += fontkern[c] + 1;
if (c && k <= 257) {
CPrintString(sx, sy, c, col);
PrintChar(sx, sy, c, col);
}
sx += fontkern[c] + 1;
}

2
Source/player.cpp

@ -2994,7 +2994,7 @@ BOOL PM_DoDeath(int pnum)
if (deathdelay == 1) {
deathflag = TRUE;
if (gbMaxPlayers == 1) {
gamemenu_previous();
gamemenu_on();
}
}
}

2
Source/plrmsg.cpp

@ -140,7 +140,7 @@ void PrintPlrMsg(DWORD x, DWORD y, DWORD width, const char *str, BYTE col)
c = gbFontTransTbl[(BYTE)*str++];
c = fontframe[c];
if (c)
CPrintString(sx, y, c, col);
PrintChar(sx, y, c, col);
sx += fontkern[c] + 1;
}

2
Source/quests.cpp

@ -721,7 +721,7 @@ void PrintQLString(int x, int y, BOOL cjustflag, char *str, int col)
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
k += fontkern[c] + 1;
if (c && k <= 257) {
CPrintString(sx, sy, c, col);
PrintChar(sx, sy, c, col);
}
sx += fontkern[c] + 1;
}

4
Source/scrollrt.cpp

@ -1286,7 +1286,7 @@ void DrawAndBlit()
lock_buf(0);
DrawView(ViewX, ViewY);
if (ctrlPan) {
ClearCtrlPan();
DrawCtrlPan();
}
if (drawhpflag) {
UpdateLifeFlask();
@ -1295,7 +1295,7 @@ void DrawAndBlit()
UpdateManaFlask();
}
if (drawbtnflag) {
DrawCtrlPan();
DrawCtrlBtns();
}
if (drawsbarflag) {
DrawInvBelt();

4
Source/stores.cpp

@ -155,7 +155,7 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val)
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
k += fontkern[c] + 1;
if (c && k <= yy) {
CPrintString(sx, sy, c, col);
PrintChar(sx, sy, c, col);
}
sx += fontkern[c] + 1;
}
@ -166,7 +166,7 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val)
c = fontframe[gbFontTransTbl[(BYTE)valstr[i]]];
sx -= fontkern[c] + 1;
if (c) {
CPrintString(sx, sy, c, col);
PrintChar(sx, sy, c, col);
}
}
}

2
SourceX/controls/plrctrls.cpp

@ -22,7 +22,7 @@ bool InGameMenu()
|| helpflag
|| talkflag
|| qtextflag
|| gmenu_exception()
|| gmenu_is_active()
|| PauseMode == 2
|| plr[myplr]._pInvincible;
}

Loading…
Cancel
Save