From 124b8a60c39e72d8b864d33eb21cc75790d38d48 Mon Sep 17 00:00:00 2001 From: qndel Date: Sat, 5 Oct 2019 12:35:06 +0200 Subject: [PATCH] DIABOOL (#1768) --- Source/doom.cpp | 6 +----- Source/doom.h | 6 +----- Source/init.cpp | 12 ++---------- Source/objects.cpp | 24 ++++-------------------- Source/objects.h | 6 +----- defs.h | 9 +++++++++ 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/Source/doom.cpp b/Source/doom.cpp index 7b7f6dc42..281de4797 100644 --- a/Source/doom.cpp +++ b/Source/doom.cpp @@ -3,11 +3,7 @@ int doom_quest_time; int doom_stars_drawn; BYTE *pDoomCel; -#ifdef HELLFIRE -BOOLEAN doomflag; -#else -BOOL doomflag; -#endif +DIABOOL doomflag; int DoomQuestState; /* diff --git a/Source/doom.h b/Source/doom.h index 16e4429be..bdff7e176 100644 --- a/Source/doom.h +++ b/Source/doom.h @@ -5,11 +5,7 @@ extern int doom_quest_time; extern int doom_stars_drawn; extern BYTE *pDoomCel; -#ifdef HELLFIRE -extern BOOLEAN doomflag; -#else -extern BOOL doomflag; -#endif +extern DIABOOL doomflag; extern int DoomQuestState; /* diff --git a/Source/init.cpp b/Source/init.cpp index f10b7b493..e9b778bdd 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -201,11 +201,7 @@ void init_create_window(int nCmdShow) wcex.hIcon = LoadIcon(ghInst, MAKEINTRESOURCE(IDI_ICON1)); wcex.hCursor = LoadCursor(0, IDC_ARROW); wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); -#ifdef HELLFIRE - wcex.lpszMenuName = "HELLFIRE"; -#else - wcex.lpszMenuName = "DIABLO"; -#endif + wcex.lpszMenuName = GAME_NAME; wcex.lpszClassName = "DIABLO"; wcex.hIconSm = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); if (!RegisterClassEx(&wcex)) @@ -218,11 +214,7 @@ void init_create_window(int nCmdShow) nHeight = SCREEN_HEIGHT; else nHeight = GetSystemMetrics(SM_CYSCREEN); -#ifdef HELLFIRE - hWnd = CreateWindowEx(0, "DIABLO", "HELLFIRE", WS_POPUP, 0, 0, nWidth, nHeight, NULL, NULL, ghInst, NULL); -#else - hWnd = CreateWindowEx(0, "DIABLO", "DIABLO", WS_POPUP, 0, 0, nWidth, nHeight, NULL, NULL, ghInst, NULL); -#endif + hWnd = CreateWindowEx(0, "DIABLO", GAME_NAME, WS_POPUP, 0, 0, nWidth, nHeight, NULL, NULL, ghInst, NULL); if (!hWnd) app_fatal("Unable to create main window"); ShowWindow(hWnd, SW_SHOWNORMAL); // nCmdShow used only in beta: ShowWindow(hWnd, nCmdShow) diff --git a/Source/objects.cpp b/Source/objects.cpp index 485c8e15f..f1f98d974 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -122,11 +122,7 @@ void FreeObjectGFX() numobjfiles = 0; } -#ifdef HELLFIRE -BOOLEAN RndLocOk(int xp, int yp) -#else -BOOL RndLocOk(int xp, int yp) -#endif +DIABOOL RndLocOk(int xp, int yp) { if (dMonster[xp][yp]) return FALSE; @@ -341,11 +337,7 @@ void InitRndBarrels() int numobjs; // number of groups of barrels to generate int xp, yp; _object_id o; -#ifdef HELLFIRE - BOOLEAN found; -#else - BOOL found; -#endif + DIABOOL found; int p; // regulates chance to stop placing barrels in current group int dir; int t; // number of tries of placing next barrel in current group @@ -4092,11 +4084,7 @@ void SyncOpObject(int pnum, int cmd, int i) void BreakCrux(int i) { int j, oi; -#ifdef HELLFIRE - BOOLEAN triggered; -#else - BOOL triggered; -#endif + DIABOOL triggered; object[i]._oAnimFlag = 1; object[i]._oAnimFrame = 1; @@ -4253,11 +4241,7 @@ void SyncL1Doors(int i) void SyncCrux(int i) { -#ifdef HELLFIRE - BOOLEAN found; -#else - BOOL found; -#endif + DIABOOL found; int j, oi, type; found = TRUE; diff --git a/Source/objects.h b/Source/objects.h index bc45b65b8..91eacdff4 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -16,11 +16,7 @@ extern int numobjfiles; void InitObjectGFX(); void FreeObjectGFX(); -#ifdef HELLFIRE -BOOLEAN RndLocOk(int xp, int yp); -#else -BOOL RndLocOk(int xp, int yp); -#endif +DIABOOL RndLocOk(int xp, int yp); void InitRndLocObj(int min, int max, int objtype); void InitRndLocBigObj(int min, int max, int objtype); void InitRndLocObj5x5(int min, int max, int objtype); diff --git a/defs.h b/defs.h index 12fc92fa3..8d6784fed 100644 --- a/defs.h +++ b/defs.h @@ -1,5 +1,14 @@ // some global definitions, found in debug release +#ifdef HELLFIRE +#define DIABOOL BOOLEAN +#define GAME_NAME "HELLFIRE" +#else +#define DIABOOL BOOL +#define GAME_NAME "DIABLO" +#endif + + #define DMAXX 40 #define DMAXY 40