Skip to content

Commit

Permalink
Merge pull request diasurgical#1325 from AJenbo/globals
Browse files Browse the repository at this point in the history
Correct GLOBAL types based on PSX SYM 3
  • Loading branch information
mewmew authored Jul 21, 2019
2 parents 29637f0 + 6fba17e commit 952d2c2
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion Source/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int icursH28;
int cursW;
int pcursmonst;
int icursW28;
void *pCursCels;
BYTE *pCursCels;
int icursH;

// inv_item value
Expand Down
2 changes: 1 addition & 1 deletion Source/cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern int icursH28;
extern int cursW;
extern int pcursmonst;
extern int icursW28;
extern void *pCursCels;
extern BYTE *pCursCels;
extern int icursH;
extern char pcursinvitem;
extern int icursW;
Expand Down
2 changes: 1 addition & 1 deletion Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int seed_index;
int level_seeds[NUMLEVELS];
int seed_table[4096];

void *pSquareCel;
BYTE *pSquareCel;
char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY];

Expand Down
2 changes: 1 addition & 1 deletion Source/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef __DEBUG_H__
#define __DEBUG_H__

extern void *pSquareCel;
extern BYTE *pSquareCel;
extern char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
extern char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY];

Expand Down
2 changes: 1 addition & 1 deletion Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void diablo_parse_flags(char *args)
gbBackBuf = 1;
args += strlen("dd_backbuf");
} else if (_strnicmp("ds_noduplicates", args, strlen("ds_noduplicates")) == 0) {
gbDupSounds = 0;
gbDupSounds = FALSE;
args += strlen("ds_noduplicates");
} else {
c = tolower(*args);
Expand Down
16 changes: 8 additions & 8 deletions Source/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ void DrawDiabloMsg()
int i, len, off, width, sx, sy;
BYTE c;

CelDecodeOnly(165, 318, (BYTE *)pSTextSlidCels, 1, 12);
CelDecodeOnly(591, 318, (BYTE *)pSTextSlidCels, 4, 12);
CelDecodeOnly(165, 366, (BYTE *)pSTextSlidCels, 2, 12);
CelDecodeOnly(591, 366, (BYTE *)pSTextSlidCels, 3, 12);
CelDecodeOnly(165, 318, pSTextSlidCels, 1, 12);
CelDecodeOnly(591, 318, pSTextSlidCels, 4, 12);
CelDecodeOnly(165, 366, pSTextSlidCels, 2, 12);
CelDecodeOnly(591, 366, pSTextSlidCels, 3, 12);

sx = 173;
for (i = 0; i < 35; i++) {
CelDecodeOnly(sx, 318, (BYTE *)pSTextSlidCels, 5, 12);
CelDecodeOnly(sx, 366, (BYTE *)pSTextSlidCels, 7, 12);
CelDecodeOnly(sx, 318, pSTextSlidCels, 5, 12);
CelDecodeOnly(sx, 366, pSTextSlidCels, 7, 12);
sx += 12;
}
sy = 330;
for (i = 0; i < 3; i++) {
CelDecodeOnly(165, sy, (BYTE *)pSTextSlidCels, 6, 12);
CelDecodeOnly(591, sy, (BYTE *)pSTextSlidCels, 8, 12);
CelDecodeOnly(165, sy, pSTextSlidCels, 6, 12);
CelDecodeOnly(591, sy, pSTextSlidCels, 8, 12);
sy += 12;
}

Expand Down
60 changes: 30 additions & 30 deletions Source/inv.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "diablo.h"

BOOL invflag;
void *pInvCels;
BYTE *pInvCels;
BOOL drawsbarflag;
int sgdwLastTime; // check name

Expand Down Expand Up @@ -170,7 +170,7 @@ void DrawInv()
BOOL invtest[40];
int frame, frame_width, colour, screen_x, screen_y, i, j, ii;

CelDecodeOnly(384, 511, (BYTE *)pInvCels, 1, 320);
CelDecodeOnly(384, 511, pInvCels, 1, 320);

if (plr[myplr].InvBody[INVLOC_HEAD]._itype != ITYPE_NONE) {
InvDrawSlotBack(517, 219, 2 * INV_SLOT_SIZE_PX, 2 * INV_SLOT_SIZE_PX);
Expand All @@ -186,13 +186,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 517, 219, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
CelDrawHdrOnly(517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(517, 219, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(517, 219, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand All @@ -210,13 +210,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 432, 365, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
CelDrawHdrOnly(432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(432, 365, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(432, 365, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand All @@ -234,13 +234,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 633, 365, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
CelDrawHdrOnly(633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(633, 365, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(633, 365, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand All @@ -258,13 +258,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 589, 220, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
CelDrawHdrOnly(589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(589, 220, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(589, 220, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand All @@ -285,13 +285,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
}

if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) {
Expand All @@ -303,7 +303,7 @@ void DrawInv()
frame_width == INV_SLOT_SIZE_PX
? &gpBuffer[SCREENXY(581, 160)]
: &gpBuffer[SCREENXY(567, 160)],
(BYTE *)pCursCels, frame, frame_width, 0, 8);
pCursCels, frame, frame_width, 0, 8);

cel_transparency_active = 0;
}
Expand All @@ -325,13 +325,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand All @@ -349,13 +349,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 517, 320, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
CelDrawHdrOnly(517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(517, 320, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(517, 320, pCursCels, frame, frame_width, 0, 8, 1);
}
}

Expand Down Expand Up @@ -390,19 +390,19 @@ void DrawInv()
colour,
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(BYTE *)pCursCels, frame, frame_width, 0, 8);
pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].InvList[ii]._iStatFlag) {
CelDrawHdrOnly(
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(BYTE *)pCursCels, frame, frame_width, 0, 8);
pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
pCursCels, frame, frame_width, 0, 8, 1);
}
}
}
Expand Down Expand Up @@ -434,13 +434,13 @@ void DrawInvBelt()
colour = ICOL_BLUE;
if (!plr[myplr].SpdList[i]._iStatFlag)
colour = ICOL_RED;
CelDecodeClr(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
}

if (plr[myplr].SpdList[i]._iStatFlag)
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
else
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1);

if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable
&& plr[myplr].SpdList[i]._iStatFlag
Expand Down
2 changes: 1 addition & 1 deletion Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,7 @@ void PrintItemPower(char plidx, ItemStruct *x)

void DrawUTextBack()
{
CelDecodeOnly(88, 487, (BYTE *)pSTextBoxCels, 1, 271);
CelDecodeOnly(88, 487, pSTextBoxCels, 1, 271);

#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28
Expand Down
8 changes: 4 additions & 4 deletions Source/minitext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ int qtextSpd;
char qtextflag;
int scrolltexty;
int sgLastScroll;
void *pMedTextCels;
void *pTextBoxCels;
BYTE *pMedTextCels;
BYTE *pTextBoxCels;

const BYTE mfontframe[127] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down Expand Up @@ -66,7 +66,7 @@ void InitQTextMsg(int m)

void DrawQTextBack()
{
CelDecodeOnly(88, 487, (BYTE *)pTextBoxCels, 1, 591);
CelDecodeOnly(88, 487, pTextBoxCels, 1, 591);

#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28
Expand Down Expand Up @@ -241,7 +241,7 @@ void DrawQText()
p++;
}
if (c != 0) {
PrintQTextChr(tx, ty, (BYTE *)pMedTextCels, c);
PrintQTextChr(tx, ty, pMedTextCels, c);
}
tx += mfontkern[c] + 2;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/minitext.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ extern char *qtextptr;
extern int qtextSpd;
extern char qtextflag;
extern int scrolltexty;
extern void *pMedTextCels;
extern void *pTextBoxCels;
extern BYTE *pMedTextCels;
extern BYTE *pTextBoxCels;

void FreeQuestText();
void InitQuestText();
Expand Down
14 changes: 7 additions & 7 deletions Source/scrollrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, int dy,
negMon = dMonster[sx][sy - 1];

if (visiondebug && bFlag & BFLAG_LIT) {
Cel2DecodeHdrOnly(pBuff, (BYTE *)pSquareCel, 1, 64, 0, 8);
Cel2DecodeHdrOnly(pBuff, pSquareCel, 1, 64, 0, 8);
}
if (MissilePreFlag && bFlag & BFLAG_MISSILE) {
DrawClippedMissile(sx, sy, dx, dy, 0, 8, 1);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int skipChunks
negMon = dMonster[sx][sy - 1];

if (visiondebug && bFlag & BFLAG_LIT) {
Cel2DecodeHdrOnly(pBuff, (BYTE *)pSquareCel, 1, 64, CelSkip, 8);
Cel2DecodeHdrOnly(pBuff, pSquareCel, 1, 64, CelSkip, 8);
}
if (MissilePreFlag && bFlag & BFLAG_MISSILE) {
DrawClippedMissile(sx, sy, dx, dy, CelSkip, 8, 1);
Expand Down Expand Up @@ -1601,7 +1601,7 @@ void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, int CelCa
negMon = dMonster[sx][sy - 1];

if (visiondebug && bFlag & BFLAG_LIT) {
CelDecodeHdrOnly(pBuff, (BYTE *)pSquareCel, 1, 64, 0, CelCap);
CelDecodeHdrOnly(pBuff, pSquareCel, 1, 64, 0, CelCap);
}
tx = dx - 96;
ty = dy - 16;
Expand Down Expand Up @@ -2322,14 +2322,14 @@ void scrollrt_draw_cursor_item()
if (!plr[myplr].HoldItem._iStatFlag) {
col = PAL16_RED + 5;
}
CelDrawHdrClrHL(col, mx + SCREEN_X, my + cursH + SCREEN_Y - 1, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
CelDrawHdrClrHL(col, mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
if (col != PAL16_RED + 5) {
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
} else {
Cel2DrawHdrLightRed(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, (BYTE *)pCursCels, pcurs, cursW, 0, 8, 1);
Cel2DrawHdrLightRed(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8, 1);
}
} else {
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
}
}

Expand Down
6 changes: 3 additions & 3 deletions Source/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ LPDIRECTSOUNDBUFFER sglpDSB;

/* data */

BYTE gbMusicOn = TRUE;
BYTE gbSoundOn = TRUE;
BYTE gbDupSounds = TRUE;
BOOLEAN gbMusicOn = TRUE;
BOOLEAN gbSoundOn = TRUE;
BOOLEAN gbDupSounds = TRUE;
int sgnMusicTrack = 6;
char *sgszMusicTracks[NUM_MUSIC] = {
"Music\\DTowne.wav",
Expand Down
6 changes: 3 additions & 3 deletions Source/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ int sound_get_or_set_sound_volume(int volume);

/* data */

extern BYTE gbMusicOn;
extern BYTE gbSoundOn;
extern BYTE gbDupSounds;
extern BOOLEAN gbMusicOn;
extern BOOLEAN gbSoundOn;
extern BOOLEAN gbDupSounds;
extern char unk_volume[4][2];

#endif /* __SOUND_H__ */
Loading

0 comments on commit 952d2c2

Please sign in to comment.