@ -3,7 +3,7 @@
#include <cstdint>
#include <limits>
#include <string>
namespace dvl {
namespace devilution {
typedef struct PCXHeader {
Uint8 Manufacturer;
@ -2,7 +2,7 @@
#ifndef __DIABLOUI_H__
#define __DIABLOUI_H__
typedef struct _uidefaultstats {
Uint16 strength;
@ -7,7 +7,7 @@
#include "../3rdParty/Storm/Source/storm.h"
#include <config.h>
namespace {
@ -49,7 +49,7 @@ void FreeDlg()
SNetDestroy();
}
} // namespace
/**
* @brief Terminates the game and displays an error message box.
@ -173,4 +173,4 @@ void DirErrorDlg(const char *error)
app_fatal(NULL);
} // namespace devilution
#include <SDL.h>
[[noreturn]] void app_fatal(const char *pszFmt, ...);
void DrawDlg(const char *pszFmt, ...);
@ -5,7 +5,7 @@
*/
#include "all.h"
@ -453,7 +453,7 @@ void DrawAutomapText(CelOutputBuffer out)
bool automapflag;
bool automapview[DMAXX][DMAXY];
@ -764,4 +764,4 @@ void AutomapZoomReset()
AmLine4 = AmLine8 >> 1;
@ -8,7 +8,7 @@
#include "engine.h"
#ifdef __cplusplus
extern "C" {
@ -10,7 +10,7 @@
#include "paths.h"
#include "file_util.h"
* @brief Write the PCX-file header
@ -205,4 +205,4 @@ void CaptureScreen()
delete out_stream;
@ -6,7 +6,7 @@
#ifndef __CAPTURE_H__
#define __CAPTURE_H__
#include <cstddef>
typedef struct CodecSignature {
DWORD checksum;
@ -142,4 +142,4 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPasswo
SHA1Clear();
#ifndef __CODEC_H__
#define __CODEC_H__
@ -2311,4 +2311,4 @@ BOOL control_presskeys(int vkey)
return ret;
@ -9,7 +9,7 @@
#include "spelldat.h"
/** Pixel width of the current cursor image */
int cursW;
@ -661,4 +661,4 @@ void CheckCursMove()
#ifndef __CURSOR_H__
#define __CURSOR_H__
DeadStruct dead[MAXDEAD];
int stonendx;
@ -91,4 +91,4 @@ void SetDead()
#ifndef __DEAD_H__
#define __DEAD_H__
#ifdef _DEBUG
BOOL update_seed_check = FALSE;
@ -224,4 +224,4 @@ void NextDebugMonster()
#endif
#ifndef __DEBUG_H__
#define __DEBUG_H__
@ -11,7 +11,7 @@
#include "../DiabloUI/diabloui.h"
SDL_Window *ghMainWnd;
DWORD glSeedTbl[NUMLEVELS];
@ -2094,4 +2094,4 @@ void diablo_color_cyc_logic()
#include "monstdat.h"
int doom_quest_time;
int doom_stars_drawn;
@ -95,4 +95,4 @@ void doom_draw(CelOutputBuffer out)
CelDrawTo(out, PANEL_X, PANEL_Y - 1, pDoomCel, 1, 640);
int UberRow;
int UberCol;
@ -2904,4 +2904,4 @@ void drlg_l1_crypt_pattern7(int rndper)
drlg_l1_crypt_rndset(byte_48A1DC, rndper);
#ifndef __DRLG_L1_H__
#define __DRLG_L1_H__
BYTE predungeon[DMAXX][DMAXY];
@ -3471,4 +3471,4 @@ void CreateL2Dungeon(DWORD rseed, int entry)
DRLG_SetPC();
#ifndef __DRLG_L2_H__
#define __DRLG_L2_H__
@ -2756,4 +2756,4 @@ void LoadPreL3Dungeon(const char *sFileName, int vx, int vy)
mem_free_dbg(pLevelMap);
#ifndef __DRLG_L3_H__
#define __DRLG_L3_H__
int diabquad1x;
int diabquad1y;
@ -1891,4 +1891,4 @@ void LoadPreL4Dungeon(char *sFileName, int vx, int vy)
#ifndef __DRLG_L4_H__
#define __DRLG_L4_H__
static CCritSect sgMemCrit;
SDL_threadID glpDThreadId;
@ -140,4 +140,4 @@ void dthread_cleanup()
#ifndef __DTHREAD_H__
#define __DTHREAD_H__
#ifndef __DX_H__
#define __DX_H__
CelOutputBuffer GlobalBackBuffer();
#include <SDL_mixer.h>
int sfxdelay;
int sfxdnum;
@ -1420,4 +1420,4 @@ int GetSFXLength(int nSFX)
return sgSFX[nSFX].pSnd->DSB->GetLength();
#include "sound.h"
#include "../3rdParty/PKWare/pkware.h"
DWORD hashtable[5][256];
@ -161,4 +161,4 @@ void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes)
mem_free_dbg(pbOutBuff);
#ifndef __ENCRYPT_H__
#define __ENCRYPT_H__
@ -14,7 +14,7 @@
#include "options.h"
/** Seed value before the most recent call to SetRndSeed() */
Sint32 orgseed;
@ -1084,4 +1084,4 @@ void PlayInGameMovie(const char *pszMovie)
force_redraw = 255;
@ -25,7 +25,7 @@
#include "../types.h"
// `malloc` that returns a user-friendly error on OOM.
//
char msgtable[MAX_SEND_STR_LEN];
DWORD msgdelay;
@ -162,4 +162,4 @@ void DrawDiabloMsg(CelOutputBuffer out)
bool gbRunInTown = false;
@ -396,4 +396,4 @@ void gamemenu_color_cycling(BOOL bActivate)
sgOptionsMenu[3].pszStr = color_cycling_toggle_names[sgOptions.Graphics.bColorCycling ? 1 : 0];
#ifndef __GAMEMENU_H__
#define __GAMEMENU_H__
/** Contains the tile IDs of the map. */
BYTE dungeon[DMAXX][DMAXY];
@ -604,4 +604,4 @@ void InitLevels()
setlevel = FALSE;
#ifndef __GENDUNG_H__
#define __GENDUNG_H__
#include "../SourceX/controls/axis_direction.h"
#include "../SourceX/controls/controller_motion.h"
BYTE *optbar_cel;
BOOLEAN mouseNavigation;
@ -436,4 +436,4 @@ void gmenu_slider_steps(TMenuItem *pItem, int steps)
pItem->dwFlags |= (steps << 12) & 0xFFF000;
int help_select_line;
BOOL helpflag;
@ -586,4 +586,4 @@ void HelpScrollDown()
help_select_line++;
#ifndef __HELP_H__
#define __HELP_H__
@ -18,7 +18,7 @@
int _newlib_heap_size_user = 100 * 1024 * 1024;
/** True if the game is the current active window */
int gbActive;
@ -231,4 +231,4 @@ WNDPROC SetWindowProc(WNDPROC NewProc)
return OldProc;
#ifndef __INIT_H__
#define __INIT_H__
#include "../SourceX/DiabloUI/art_draw.h"
BYTE *sgpBackCel;
Uint32 sgdwProgress;
@ -387,4 +387,4 @@ void ShowProgress(interface_mode uMsg)
gbSomebodyWonGameKludge = FALSE;
#ifndef __INTERFAC_H__
#define __INTERFAC_H__
BOOL invflag;
BYTE *pInvCels;
@ -2871,4 +2871,4 @@ BOOL DropItemBeforeTrig()
return FALSE;
#include "items.h"
#include "player.h"
/** Contains the data related to each item ID. */
ItemDataStruct AllItemsList[] = {
@ -500,4 +500,4 @@ const UItemStruct UniqueItemList[] = {
// clang-format on
};
#ifndef __ITEMDAT_H__
#define __ITEMDAT_H__
int itemactive[MAXITEMS];
BOOL uitemflag;
@ -5472,4 +5472,4 @@ void PutItemRecord(int nSeed, WORD wCI, int nIndex)
#include "itemdat.h"
LightListStruct VisionList[MAXVISION];
BYTE lightactive[MAXLIGHTS];
@ -1297,4 +1297,4 @@ void lighting_color_cycling()
#ifndef __LIGHTING_H__
#define __LIGHTING_H__
bool gbIsHellfireSaveGame;
int giNumberOfLevels;
@ -181,7 +181,7 @@ public:
void RemoveInvalidItem(ItemStruct *pItem)
{
@ -2090,4 +2090,4 @@ void LoadLevel()
char gszHero[16];
@ -156,4 +156,4 @@ void mainmenu_loop()
music_stop();
#include "multi.h"
/** Specify if the quest dialog window is being shown */
bool qtextflag;
@ -260,4 +260,4 @@ void DrawQText(CelOutputBuffer out)
DrawQTextContent(out);
#ifndef __MINITEXT_H__
#define __MINITEXT_H__
/** Data related to each missile ID. */
MissileData missiledata[] = {
@ -189,4 +189,4 @@ MisFileData misfiledata[] = {
#include "missiles.h"
int missileactive[MAXMISSILES];
int missileavail[MAXMISSILES];
@ -5671,4 +5671,4 @@ void ClearMissileSpot(int mi)
dMissile[missile[mi]._mix][missile[mi]._miy] = 0;
#ifndef __MISSILES_H__
#define __MISSILES_H__
/** Contains the data related to each monster ID. */
const MonsterData monsterdata[] = {
@ -566,4 +566,4 @@ const UniqMonstStruct UniqMonst[] = {
#ifndef __MONSTDAT_H__
#define __MONSTDAT_H__
/** Tracks which missile files are already loaded */
int MissileFileFlag;
@ -5707,4 +5707,4 @@ void decode_enemy(int m, int enemy)
#ifndef __MONSTER_H__
#define __MONSTER_H__
#include "../SourceX/display.h"
/** Should the movie continue playing. */
BYTE movie_playing;
@ -56,4 +56,4 @@ void play_movie(const char *pszMovie, BOOL user_can_close)
OutputToLogical(&MouseX, &MouseY);
#ifndef __MOVIE_H__
#define __MOVIE_H__
#include "../SourceS/file_util.h"
#define INDEX_ENTRIES 2048
@ -704,4 +704,4 @@ BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, DWORD dwChar)
return cur_archive.Close(/*clear_tables=*/bFree);
#include <stdint.h>
static DWORD sgdwOwnerWait;
static DWORD sgdwRecvOffset;
@ -2685,4 +2685,4 @@ DWORD ParseCmd(int pnum, TCmd *pCmd)
return On_DLEVEL(pnum, pCmd);
#ifndef __MSG_H__
#define __MSG_H__
BOOLEAN gbSomebodyWonGameKludge;
TBuffer sgHiPriBuf;
@ -919,4 +919,4 @@ void recv_plrinfo(int pnum, TCmdPlrInfoHdr *p, BOOL recv)
#include "msg.h"
BYTE sgbNetUpdateRate;
DWORD gdwMsgLenTbl[MAX_PLRS];
@ -242,4 +242,4 @@ BOOL nthread_has_500ms_passed()
return ticksElapsed >= 0;
#ifndef __NTHREAD_H__
#define __NTHREAD_H__
/** Maps from dun_object_id to object_id. */
const _object_id ObjTypeConv[] = {
@ -435,4 +435,4 @@ const char *ObjHiveLoadList[] = {
"LzStand",
#ifndef __OBJDAT_H__
#define __OBJDAT_H__
int trapid;
int trapdir;
@ -5271,4 +5271,4 @@ bool objects_lv_24_454B04(int s)
#ifndef __OBJECTS_H__
#define __OBJECTS_H__
@ -1,6 +1,6 @@
#pragma once
struct DiabloOptions {
/** @brief Play game intro video on startup. */
void PackItem(PkItemStruct *id, const ItemStruct *is)
@ -301,4 +301,4 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL netSync)
pPlayer->pDamAcFlags = SwapLE32(pPack->pDamAcFlags);
SDL_Color logical_palette[256];
SDL_Color system_palette[256];
@ -383,4 +383,4 @@ void palette_update_quest_palette(int n)
GenerateBlendedLookupTable(logical_palette, 1, 31, 32 - n); // Possible optimization would be to only update color 0 as only the UI can overlap with transparency in this quest
#ifndef __PALETTE_H__
#define __PALETTE_H__
/** Notes visisted by the path finding algorithm. */
PATHNODE path_nodes[MAXPATHNODES];
/** size of the pnode_tblptr stack */
@ -379,4 +379,4 @@ PATHNODE *path_new_step()
return new_node;
#ifndef __PATH_H__
#define __PATH_H__
#define PASSWORD_SPAWN_SINGLE "adslhfb1"
#define PASSWORD_SPAWN_MULTI "lshbkfg1"
@ -551,4 +551,4 @@ void pfile_update(bool force_save)
pfile_write_hero();
int plr_lframe_size;
int plr_wframe_size;
@ -4411,4 +4411,4 @@ int get_max_dexterity(int i)
return MaxStats[i][ATTRIB_DEX];
#ifndef __PLAYER_H__
#define __PLAYER_H__
typedef enum PLR_MODE {
PM_STAND,