diff --git a/.gitignore b/.gitignore index d14076aeb..97e810c1d 100644 --- a/.gitignore +++ b/.gitignore @@ -373,3 +373,4 @@ ASALocalRun/ *.pubxml.user # End of https://www.gitignore.io/api/visualstudio +/docs/html/ diff --git a/Source/all.h b/Source/all.h index 4a19fbbfa..75e229319 100644 --- a/Source/all.h +++ b/Source/all.h @@ -1,3 +1,8 @@ +/** + * @file all.h + * + * Include all aplication headers. + */ #ifndef __ALL_H__ #define __ALL_H__ diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 51be3e1d5..69222e70c 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -1,8 +1,15 @@ +/** + * @file appfat.cpp + * + * Implementation of error dialogs. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" char sz_error_buf[256]; +/** Set to true when a fatal error is encountered and the application should shut down. */ BOOL terminating; +/** Thread id of the last callee to FreeDlg(). */ int cleanup_thread_id; // delete overloads the delete operator. @@ -80,6 +87,12 @@ char *GetErrorStr(DWORD error_code) return sz_error_buf; } +/** + * @brief Generate a textual message for DirectDraw error codes + * @param hError DirectDraw error code + * @param pszBuffer Buffer for the error message + * @param dwMaxChars Length of pszBuffer + */ void TraceErrorDD(HRESULT hError, char *pszBuffer, DWORD dwMaxChars) { const char *szError; @@ -390,6 +403,12 @@ void TraceErrorDD(HRESULT hError, char *pszBuffer, DWORD dwMaxChars) strncpy(pszBuffer, szError, dwMaxChars); } +/** + * @brief Generate a textual message for DirectSound error codes + * @param hError DirectSound error code + * @param pszBuffer Buffer for the error message + * @param dwMaxChars Length of pszBuffer + */ void TraceErrorDS(HRESULT hError, char *pszBuffer, DWORD dwMaxChars) { const char *szError; diff --git a/Source/appfat.h b/Source/appfat.h index 97c498254..ea335f09a 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file appfat.h + * + * Interface of error dialogs. + */ #ifndef __APPFAT_H__ #define __APPFAT_H__ diff --git a/Source/automap.cpp b/Source/automap.cpp index 5a2df7ab6..6f64b0692 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -1,3 +1,8 @@ +/** + * @file automap.cpp + * + * Implementation of the ingame map overlay. + */ #include "all.h" // BUGFIX: only the first 256 elements are ever read @@ -16,15 +21,15 @@ int AmLine16; int AmLine8; int AmLine4; -// color used to draw the player's arrow +/** color used to draw the player's arrow */ #define COLOR_PLAYER (PAL8_ORANGE + 1) -// color for bright map lines (doors, stairs etc.) +/** color for bright map lines (doors, stairs etc.) */ #define COLOR_BRIGHT PAL8_YELLOW -// color for dim map lines/dots +/** color for dim map lines/dots */ #define COLOR_DIM (PAL16_YELLOW + 8) #define MAPFLAG_TYPE 0x000F -// these are in the second byte +/** these are in the second byte */ #define MAPFLAG_VERTDOOR 0x01 #define MAPFLAG_HORZDOOR 0x02 #define MAPFLAG_VERTARCH 0x04 diff --git a/Source/automap.h b/Source/automap.h index a947c4670..22ccfaa78 100644 --- a/Source/automap.h +++ b/Source/automap.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file automap.h + * + * Interface of the ingame map overlay. + */ #ifndef __AUTOMAP_H__ #define __AUTOMAP_H__ diff --git a/Source/capture.cpp b/Source/capture.cpp index ce3a07bf3..552b43e26 100644 --- a/Source/capture.cpp +++ b/Source/capture.cpp @@ -1,5 +1,17 @@ +/** + * @file capture.cpp + * + * Implementation of the screenshot function. + */ #include "all.h" +/** + * @brief Write the PCX-file header + * @param hFile File handler for the PCX file. + * @param width Image width + * @param height Image height + * @return True on success + */ static BOOL CaptureHdr(HANDLE hFile, short width, short height) { DWORD lpNumBytes; diff --git a/Source/capture.h b/Source/capture.h index c1e86c10c..9a54e2d11 100644 --- a/Source/capture.h +++ b/Source/capture.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file capture.h + * + * Interface of the screenshot function. + */ #ifndef __CAPTURE_H__ #define __CAPTURE_H__ diff --git a/Source/codec.cpp b/Source/codec.cpp index 835cf4470..1e9402b7c 100644 --- a/Source/codec.cpp +++ b/Source/codec.cpp @@ -1,3 +1,8 @@ +/** + * @file codec.cpp + * + * Implementation of save game encryption algorithm. + */ #include "all.h" struct CodecSignature { diff --git a/Source/codec.h b/Source/codec.h index 0cae27849..00c11ceab 100644 --- a/Source/codec.h +++ b/Source/codec.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file codec.h + * + * Interface of save game encryption algorithm. + */ #ifndef __CODEC_H__ #define __CODEC_H__ diff --git a/Source/control.cpp b/Source/control.cpp index 589efcfb9..d612b2b3a 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1,3 +1,8 @@ +/** + * @file control.cpp + * + * Implementation of the character and main control panels + */ #include "all.h" BYTE sgbNextTalkSave; @@ -18,7 +23,8 @@ BOOL drawmanaflag; BOOL chrbtnactive; char sgszTalkMsg[MAX_SEND_STR_LEN]; BYTE *pPanelText; -int nGoldFrame; /** current frame # for the pentagram caret in gold input */ +/** current frame # for the pentagram caret in gold input */ +int nGoldFrame; BYTE *pLifeBuff; BYTE *pBtmBuff; BYTE *pTalkBtns; @@ -36,7 +42,8 @@ char tempstr[256]; BOOLEAN whisper[MAX_PLRS]; int sbooktab; int pSplType; -int frame; /** current frame # for the pentagram caret in chat input */ +/** current frame # for the pentagram caret in chat input */ +int frame; int initialDropGoldIndex; BOOL talkflag; BYTE *pSBkIconCels; diff --git a/Source/control.h b/Source/control.h index 1e64e1fa1..0fa126091 100644 --- a/Source/control.h +++ b/Source/control.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file control.h + * + * Interface of the character and main control panels + */ #ifndef __CONTROL_H__ #define __CONTROL_H__ diff --git a/Source/cursor.cpp b/Source/cursor.cpp index d463c15aa..8fa3aa31b 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -1,3 +1,8 @@ +/** + * @file cursor.cpp + * + * Implementation of cursor tracking functionality. + */ #include "all.h" int cursH; @@ -8,7 +13,7 @@ int icursW28; BYTE *pCursCels; int icursH; -// inv_item value +/** inv_item value */ char pcursinvitem; int icursW; char pcursitem; @@ -20,6 +25,7 @@ int pcurstemp; int pcurs; /* rdata */ +/** Maps from objcurs.cel frame number to frame width. */ const int InvItemWidth[180] = { // Cursors 0, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 23, @@ -43,6 +49,7 @@ const int InvItemWidth[180] = { 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28 }; +/** Maps from objcurs.cel frame number to frame height. */ const int InvItemHeight[180] = { // Cursors 0, 29, 32, 32, 32, 32, 32, 32, 32, 32, 32, 35, diff --git a/Source/cursor.h b/Source/cursor.h index 5fbb42419..42b1df215 100644 --- a/Source/cursor.h +++ b/Source/cursor.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file cursor.h + * + * Interface of cursor tracking functionality. + */ #ifndef __CURSOR_H__ #define __CURSOR_H__ diff --git a/Source/dead.cpp b/Source/dead.cpp index 00e87d27e..ba72cd0a7 100644 --- a/Source/dead.cpp +++ b/Source/dead.cpp @@ -1,6 +1,11 @@ +/** + * @file dead.cpp + * + * Implementation of functions for placing dead monsters. + */ #include "all.h" -// unused, this was probably for blood boil/burn +/** unused, this was probably for blood boil/burn */ int spurtndx; DeadStruct dead[MAXDEAD]; int stonendx; diff --git a/Source/dead.h b/Source/dead.h index bc16374d3..f9e992a22 100644 --- a/Source/dead.h +++ b/Source/dead.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file dead.h + * + * Interface of functions for placing dead monsters. + */ #ifndef __DEAD_H__ #define __DEAD_H__ diff --git a/Source/debug.cpp b/Source/debug.cpp index f01542c6c..24d004d06 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -1,3 +1,8 @@ +/** + * @file debug.cpp + * + * Implementation of debug functions. + */ #include "all.h" #ifdef _DEBUG diff --git a/Source/debug.h b/Source/debug.h index d3dacf707..439fc9c8a 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file debug.h + * + * Interface of debug functions. + */ #ifndef __DEBUG_H__ #define __DEBUG_H__ diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 8b97a5d82..c764276d2 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1,3 +1,8 @@ +/** + * @file diablo.cpp + * + * Implementation of the main game initialization functions. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" #include "../DiabloUI/diabloui.h" @@ -22,11 +27,13 @@ int DebugMonsters[10]; BOOLEAN cineflag; int force_redraw; BOOL visiondebug; -BOOL scrollflag; /* unused */ +/** unused */ +BOOL scrollflag; BOOL light4flag; BOOL leveldebug; BOOL monstdebug; -BOOL trigdebug; /* unused */ +/** unused */ +BOOL trigdebug; int setseed; int debugmonsttypes; int PauseMode; @@ -56,12 +63,14 @@ int framerate; int framestart; #endif BOOL FriendlyMode = TRUE; +/** Default quick messages */ char *spszMsgTbl[4] = { "I need help! Come Here!", "Follow me.", "Here's something for you.", "Now you DIE!" }; +/** INI files variable names for quick message keys */ char *spszMsgHotKeyTbl[4] = { "F9", "F10", "F11", "F12" }; void FreeGameMem() @@ -236,6 +245,13 @@ BOOL diablo_get_not_running() return GetLastError() != ERROR_ALREADY_EXISTS; } +/** + * @brief Main entry point, check env, initialize systesm, play intros, start main menu, shut down + * @param hInstance A handle to the current instance of the application. + * @param hPrevInstance Always null + * @param lpCmdLine The command line for the application + * @param nCmdShow Initial window state + */ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HINSTANCE hInst; diff --git a/Source/diablo.h b/Source/diablo.h index 8127673e4..1e3f50020 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file diablo.h + * + * Interface of the main game initialization functions. + */ #ifndef __DIABLO_H__ #define __DIABLO_H__ @@ -22,11 +26,13 @@ extern int DebugMonsters[10]; extern BOOLEAN cineflag; extern int force_redraw; extern BOOL visiondebug; -extern BOOL scrollflag; /* unused */ +/** unused */ +extern BOOL scrollflag; extern BOOL light4flag; extern BOOL leveldebug; extern BOOL monstdebug; -extern BOOL trigdebug; /* unused */ +/** unused */ +extern BOOL trigdebug; extern int setseed; extern int debugmonsttypes; extern int PauseMode; diff --git a/Source/doom.cpp b/Source/doom.cpp index b336849e8..b419c7021 100644 --- a/Source/doom.cpp +++ b/Source/doom.cpp @@ -1,3 +1,8 @@ +/** + * @file doom.cpp + * + * Implementation of the map of the stars quest. + */ #include "all.h" int doom_quest_time; diff --git a/Source/doom.h b/Source/doom.h index 31635fe0e..b72b2c331 100644 --- a/Source/doom.h +++ b/Source/doom.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file doom.h + * + * Interface of the map of the stars quest. + */ #ifndef __DOOM_H__ #define __DOOM_H__ diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index 64391da7f..9aa561412 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -1,3 +1,8 @@ +/** + * @file drlg_l1.cpp + * + * Implementation of the cathedral level generation algorithms. + */ #include "all.h" BYTE L5dungeon[80][80]; diff --git a/Source/drlg_l1.h b/Source/drlg_l1.h index e9e354d5e..2b0ff6c54 100644 --- a/Source/drlg_l1.h +++ b/Source/drlg_l1.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file drlg_l1.h + * + * Interface of the cathedral level generation algorithms. + */ #ifndef __DRLG_L1_H__ #define __DRLG_L1_H__ diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index b66ccab96..fc3ea9225 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -1,3 +1,8 @@ +/** + * @file drlg_l2.cpp + * + * Implementation of the catacombs level generation algorithms. + */ #ifndef SPAWN #include "all.h" diff --git a/Source/drlg_l2.h b/Source/drlg_l2.h index 35beda6bc..8b9e86906 100644 --- a/Source/drlg_l2.h +++ b/Source/drlg_l2.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file drlg_l2.h + * + * Interface of the catacombs level generation algorithms. + */ #ifndef __DRLG_L2_H__ #define __DRLG_L2_H__ diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index 43a1a67ee..3679c2e47 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -1,3 +1,8 @@ +/** + * @file drlg_l3.cpp + * + * Implementation of the caves level generation algorithms. + */ #ifndef SPAWN #include "all.h" diff --git a/Source/drlg_l3.h b/Source/drlg_l3.h index 9170d7f9f..a3067300a 100644 --- a/Source/drlg_l3.h +++ b/Source/drlg_l3.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file drlg_l3.h + * + * Interface of the caves level generation algorithms. + */ #ifndef __DRLG_L3_H__ #define __DRLG_L3_H__ diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 9cf009bf7..f97a0be4a 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -1,3 +1,8 @@ +/** + * @file drlg_l4.cpp + * + * Implementation of the hell level generation algorithms. + */ #include "all.h" int diabquad1x; diff --git a/Source/drlg_l4.h b/Source/drlg_l4.h index 6559545b1..cf64e9176 100644 --- a/Source/drlg_l4.h +++ b/Source/drlg_l4.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file drlg_l4.h + * + * Interface of the hell level generation algorithms. + */ #ifndef __DRLG_L4_H__ #define __DRLG_L4_H__ diff --git a/Source/dthread.cpp b/Source/dthread.cpp index b17457cfe..6e3e9a0b9 100644 --- a/Source/dthread.cpp +++ b/Source/dthread.cpp @@ -1,3 +1,8 @@ +/** + * @file dthread.cpp + * + * Implementation of functions for updating game state from network commands. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" diff --git a/Source/dthread.h b/Source/dthread.h index 4ad5d3fb6..7a9e86c96 100644 --- a/Source/dthread.h +++ b/Source/dthread.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file dthread.h + * + * Interface of functions for updating game state from network commands. + */ #ifndef __DTHREAD_H__ #define __DTHREAD_H__ diff --git a/Source/dx.cpp b/Source/dx.cpp index 99c5dc33e..2ead8b687 100644 --- a/Source/dx.cpp +++ b/Source/dx.cpp @@ -1,3 +1,8 @@ +/** + * @file dx.cpp + * + * Implementation of functions setting up the graphics pipeline. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" diff --git a/Source/dx.h b/Source/dx.h index 39c0fbef1..1a13e3b12 100644 --- a/Source/dx.h +++ b/Source/dx.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file dx.h + * + * Interface of functions setting up the graphics pipeline. + */ #ifndef __DX_H__ #define __DX_H__ diff --git a/Source/effects.cpp b/Source/effects.cpp index 0afb731a9..cfa3d203f 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -1,3 +1,8 @@ +/** + * @file effects.cpp + * + * Implementation of functions for loading and playing sounds. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" @@ -6,10 +11,17 @@ int sfxdnum; HANDLE sfx_stream; TSFX *sfx_data_cur; +/** + * Monster sound type prefix + * a: Attack + * h: Hit + * d: Death + * s: Special + */ const char MonstSndChar[] = { 'a', 'h', 'd', 's' }; /* data */ - +/** List of all sounds, except monsters and music */ TSFX sgSFX[] = { // clang-format off // bFlags, pszName, pSnd diff --git a/Source/effects.h b/Source/effects.h index 8ed845e69..5aa3ddbcc 100644 --- a/Source/effects.h +++ b/Source/effects.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file effects.h + * + * Interface of functions for loading and playing sounds. + */ #ifndef __EFFECTS_H__ #define __EFFECTS_H__ diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index 50abc7831..dd4d0a4a2 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -1,3 +1,8 @@ +/** + * @file encrypt.cpp + * + * Implementation of functions for compression and decompressing MPQ data. + */ #include "all.h" #include "../3rdParty/PKWare/pkware.h" diff --git a/Source/encrypt.h b/Source/encrypt.h index 0d76b0f85..552bed221 100644 --- a/Source/encrypt.h +++ b/Source/encrypt.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file encrypt.h + * + * Interface of functions for compression and decompressing MPQ data. + */ #ifndef __ENCRYPT_H__ #define __ENCRYPT_H__ diff --git a/Source/engine.cpp b/Source/engine.cpp index 13a86bfc7..fb4608269 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -1,3 +1,15 @@ +/** + * @file engine.cpp + * + * Implementation of basic engine helper functions: + * - Sprite blitting + * - Drawing + * - Angle calculation + * - RNG + * - Memory allocation + * - File loading + * - Video playback + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" @@ -8,7 +20,9 @@ char gbPixelCol; // automap pixel color 8-bit (palette entry) BOOL gbRotateMap; // flip - if y < x int orgseed; +/** Width of sprite being blitted */ int sgnWidth; +/** Current game seed */ int sglGameSeed; #ifdef __cplusplus static CCritSect sgMemCrit; @@ -2255,12 +2269,14 @@ void engine_draw_pixel(int sx, int sy) #endif } +/** Macro used in DrawLine() */ #define GG_SWAP(A, B) \ { \ (A) ^= (B); \ (B) ^= (A); \ (A) ^= (B); \ } +/** Macro used in DrawLine() */ #define GG_ABSOLUTE(I, J, K) (((I) - (J)) * ((K) = (((I) - (J)) < 0 ? -1 : 1))) /** diff --git a/Source/engine.h b/Source/engine.h index 26075080b..9027445b8 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -1,15 +1,31 @@ -//HEADER_GOES_HERE +/** + * @file engine.h + * + * of basic engine helper functions: + * - Sprite blitting + * - Drawing + * - Angle calculation + * - RNG + * - Memory allocation + * - File loading + * - Video playback + */ #ifndef __ENGINE_H__ #define __ENGINE_H__ //offset 0 //pCelBuff->pFrameTable[0] -extern char gbPixelCol; // automap pixel color 8-bit (palette entry) -extern BOOL gbRotateMap; // flip - if y < x +/** automap pixel color 8-bit (palette entry) */ +extern char gbPixelCol; +/** flip - if y < x */ +extern BOOL gbRotateMap; +/** Seed value before the most recent call to SetRndSeed() */ extern int orgseed; +/** Track number of calls to GetRndSeed() since last call to SetRndSeed() */ extern int SeedCount; -extern BOOL gbNotInView; // valid - if x/y are in bounds +/** valid - if x/y are in bounds */ +extern BOOL gbNotInView; __FINLINE BYTE *CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize); diff --git a/Source/error.cpp b/Source/error.cpp index 1d96d370a..2df97ac30 100644 --- a/Source/error.cpp +++ b/Source/error.cpp @@ -1,3 +1,8 @@ +/** + * @file error.cpp + * + * Implementation of in-game message functions. + */ #include "all.h" char msgtable[MAX_SEND_STR_LEN]; @@ -5,6 +10,7 @@ char msgdelay; char msgflag; char msgcnt; +/** Maps from error_id to error message. */ char *MsgStrings[44] = { "", "No automap available in town", diff --git a/Source/error.h b/Source/error.h index 4191582ad..046307b88 100644 --- a/Source/error.h +++ b/Source/error.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file error.h + * + * Interface of in-game message functions. + */ #ifndef __ERROR_H__ #define __ERROR_H__ diff --git a/Source/fault.cpp b/Source/fault.cpp index 64d2f5d84..43e14f5e7 100644 --- a/Source/fault.cpp +++ b/Source/fault.cpp @@ -1,3 +1,8 @@ +/** + * @file fault.cpp + * + * Implementation of exception logging functionality. + */ #include "all.h" LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter; diff --git a/Source/fault.h b/Source/fault.h index 0dc743cbc..4ed85ea17 100644 --- a/Source/fault.h +++ b/Source/fault.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file fault.h + * + * Interface of exception logging functionality. + */ #ifndef __FAULT_H__ #define __FAULT_H__ diff --git a/Source/gamemenu.cpp b/Source/gamemenu.cpp index 7cf3db3c4..2e385b0bb 100644 --- a/Source/gamemenu.cpp +++ b/Source/gamemenu.cpp @@ -1,3 +1,8 @@ +/** + * @file gamemenu.cpp + * + * Implementation of the ingame menu functions. + */ #include "all.h" TMenuItem sgSingleMenu[6] = { diff --git a/Source/gamemenu.h b/Source/gamemenu.h index 634e17cfa..a6ad2f1ce 100644 --- a/Source/gamemenu.h +++ b/Source/gamemenu.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file gamemenu.h + * + * Interface of the ingame menu functions. + */ #ifndef __GAMEMENU_H__ #define __GAMEMENU_H__ diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index d78cd99f9..c13c76765 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -1,3 +1,8 @@ +/** + * @file gmenu.cpp + * + * Implementation of the ingame navigation and interaction. + */ #include "all.h" BYTE *optbar_cel; @@ -13,6 +18,7 @@ BYTE *option_cel; BYTE *sgpLogo; int sgCurrentMenuIdx; +/** Maps from font index to bigtgold.cel frame number. */ const BYTE lfontframe[127] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -28,6 +34,7 @@ const BYTE lfontframe[127] = { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 20, 0, 21, 0 }; +/* Maps from bigtgold.cel frame number to character width. */ const BYTE lfontkern[56] = { 18, 33, 21, 26, 28, 19, 19, 26, 25, 11, 12, 25, 19, 34, 28, 32, 20, 32, 28, 20, diff --git a/Source/gmenu.h b/Source/gmenu.h index b884a9a94..1d0490d37 100644 --- a/Source/gmenu.h +++ b/Source/gmenu.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file gmenu.h + * + * Interface of the ingame navigation and interaction. + */ #ifndef __GMENU_H__ #define __GMENU_H__ diff --git a/Source/interfac.cpp b/Source/interfac.cpp index e3b3ebd17..be837929b 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -5,7 +5,9 @@ void *sgpBackCel; int sgdwProgress; int progress_id; +/** The colour used for the progress bar as an index into the palette. */ const BYTE BarColor[3] = { 138, 43, 254 }; +/** The screen position of the top left corner of the progress bar. */ const int BarPos[3][2] = { { 53, 37 }, { 53, 421 }, { 53, 37 } }; void interface_msg_pump() diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 51b8edaaa..adde0a7f0 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -1,3 +1,8 @@ +/** + * @file lighting.cpp + * + * Implementation of light and vision. + */ #include "all.h" LightListStruct VisionList[MAXVISION]; @@ -401,9 +406,7 @@ char CrawlTable[2749] = { -18, -1, 18, -1, -18, 0, 18, 0 }; -/** - * pCrawlTable maps from circle radius to the X- and Y-coordinate deltas from the center of a circle. - */ +/** pCrawlTable maps from circle radius to the X- and Y-coordinate deltas from the center of a circle. */ char *pCrawlTable[19] = { CrawlTable, CrawlTable + 3, @@ -425,9 +428,7 @@ char *pCrawlTable[19] = { CrawlTable + 2187, CrawlTable + 2460 }; -/** - * vCrawlTable specifies the X- Y-coordinate offsets of lighting visions. - */ +/** vCrawlTable specifies the X- Y-coordinate offsets of lighting visions. */ BYTE vCrawlTable[23][30] = { { 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0 }, { 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1 }, @@ -453,31 +454,29 @@ BYTE vCrawlTable[23][30] = { { 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15 }, { 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15 } }; -BYTE byte_49463C[18][18] = /* unused */ - { - { 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 }, - { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3 }, - { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3 }, - { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3 }, - { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 } - }; +/** unused */ +BYTE byte_49463C[18][18] = { + { 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 } +}; -/** - * RadiusAdj maps from vCrawlTable index to lighting vision radius adjustment. - */ +/** RadiusAdj maps from vCrawlTable index to lighting vision radius adjustment. */ BYTE RadiusAdj[23] = { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 4, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0 }; void RotateRadius(int *x, int *y, int *dx, int *dy, int *lx, int *ly, int *bx, int *by) diff --git a/Source/lighting.h b/Source/lighting.h index 5b5934232..ac4b12783 100644 --- a/Source/lighting.h +++ b/Source/lighting.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file lighting.h + * + * Interface of light and vision. + */ #ifndef __LIGHTING_H__ #define __LIGHTING_H__ diff --git a/Source/list.h b/Source/list.h index 154f9beca..7a2c35fc7 100644 --- a/Source/list.h +++ b/Source/list.h @@ -1,4 +1,6 @@ -/* Intrusive double-linked list implementation, +/** + * @file list.h + * Intrusive double-linked list implementation, * based on https://github.com/webcoyote/coho/blob/master/Base/List.h */ @@ -7,22 +9,22 @@ #define OBJECT_NAME(obj) (((const char *)&typeid(obj)) + 8) /****************************************************************************** -* -* List definition macros -* -***/ + * + * List definition macros + * + ***/ -// Define a field within a structure that will be used to link it into a list +/** Define a field within a structure that will be used to link it into a list */ #define LIST_LINK(T) TLink template class TLink; /****************************************************************************** -* -* TList -* -***/ + * + * TList + * + ***/ //============================================================================= template @@ -159,10 +161,10 @@ void TList::UnlinkAll() } /****************************************************************************** -* -* TLink -* -***/ + * + * TLink + * + ***/ //============================================================================= template diff --git a/Source/logging.cpp b/Source/logging.cpp index c0ea8a7cb..cffa639ec 100644 --- a/Source/logging.cpp +++ b/Source/logging.cpp @@ -11,7 +11,9 @@ DWORD nNumberOfBytesToWrite; /* data */ +/** Has the log file not yet been created. */ BOOL log_not_created = TRUE; +/** Handle to the log file. */ HANDLE log_file = INVALID_HANDLE_VALUE; void __cdecl log_flush(BOOL force_close) diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 1c66f7038..d9eec3351 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -6,6 +6,7 @@ char gszHero[16]; /* data */ +/** The active music track id for the main menu. */ int menu_music_track_id = TMUSIC_INTRO; void mainmenu_refresh_music() diff --git a/Source/misdat.cpp b/Source/misdat.cpp index 6449e655b..49cc10342 100644 --- a/Source/misdat.cpp +++ b/Source/misdat.cpp @@ -1,5 +1,6 @@ #include "all.h" +/** Data related to each missile ID. */ MissileData missiledata[] = { // clang-format off // mName, mAddProc, mProc, mDraw, mType, mResist, mFileNum, miSFX, mlSFX; @@ -74,6 +75,7 @@ MissileData missiledata[] = { // clang-format on }; +/** Data related to each missile graphic ID. */ MisFileData misfiledata[] = { // clang-format off // mAnimName, mAnimFAmt, mName, mFlags, mAnimData[16], mAnimDelay[16], mAnimLen[16], mAnimWidth[16], mAnimWidth2[16] diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 96910d80a..517b2ac29 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -9,7 +9,9 @@ ChainStruct chain[MAXMISSILES]; BOOL MissilePreFlag; int numchains; +/** Maps from direction to X-offset. */ int XDirAdd[8] = { 1, 0, -1, -1, -1, 0, 1, 1 }; +/** Maps from direction to Y-offset. */ int YDirAdd[8] = { 1, 1, 1, 0, -1, -1, -1, 0 }; void GetDamageAmt(int i, int *mind, int *maxd) diff --git a/Source/monster.cpp b/Source/monster.cpp index 924ba1077..cf1e1ac91 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -1,7 +1,12 @@ +/** + * @file monster.cpp + * + * Implementation of monster functionality, AI, actions, spawning, loading, etc. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" -// Tracks which missile files are already loaded +/** Tracks which missile files are already loaded */ int MissileFileFlag; // BUGFIX: replace monstkills[MAXMONSTERS] with monstkills[NUM_MTYPES]. @@ -54,7 +59,7 @@ int opposite[8] = { 4, 5, 6, 7, 0, 1, 2, 3 }; int offset_x[8] = { 1, 0, -1, -1, -1, 0, 1, 1 }; int offset_y[8] = { 1, 1, 1, 0, -1, -1, -1, 0 }; -/* unused */ +/** unused */ int rnd5[4] = { 5, 10, 15, 20 }; int rnd10[4] = { 10, 15, 20, 30 }; int rnd20[4] = { 20, 30, 40, 50 }; diff --git a/Source/monster.h b/Source/monster.h index 45d884df7..881e4cabd 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file monster.h + * + * Interface of monster functionality, AI, actions, spawning, loading, etc. + */ #ifndef __MONSTER_H__ #define __MONSTER_H__ @@ -174,7 +178,7 @@ extern int opposite[8]; extern int offset_x[8]; extern int offset_y[8]; -/* unused */ +/** unused */ extern int rnd5[4]; extern int rnd10[4]; extern int rnd20[4]; diff --git a/Source/movie.cpp b/Source/movie.cpp index 40c513c3b..75fb47917 100644 --- a/Source/movie.cpp +++ b/Source/movie.cpp @@ -1,7 +1,9 @@ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" +/** Should the movie continue playing. */ BYTE movie_playing; +/** Should the movie play in a loop. */ BOOL loop_movie; void play_movie(char *pszMovie, BOOL user_can_close) diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 985eb25b8..2bdcbfc6f 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -4,8 +4,10 @@ DWORD sgdwMpqOffset; char mpq_buf[4096]; _HASHENTRY *sgpHashTbl; +/** Has the savegame-file been modified in memory. */ BOOL save_archive_modified; _BLOCKENTRY *sgpBlockTbl; +/** Is the savegame-file currently open. */ BOOLEAN save_archive_open; //note: 32872 = 32768 + 104 (sizeof(_FILEHEADER)) diff --git a/Source/nthread.cpp b/Source/nthread.cpp index 4911067ad..ec5d75bd2 100644 --- a/Source/nthread.cpp +++ b/Source/nthread.cpp @@ -1,3 +1,8 @@ +/** + * @file nthread.cpp + * + * Implementation of functions for managing game ticks. + */ #include "all.h" #include "../3rdParty/Storm/Source/storm.h" diff --git a/Source/nthread.h b/Source/nthread.h index 84263e95f..98b501215 100644 --- a/Source/nthread.h +++ b/Source/nthread.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file nthread.h + * + * Interface of functions for managing game ticks. + */ #ifndef __NTHREAD_H__ #define __NTHREAD_H__ diff --git a/Source/objects.cpp b/Source/objects.cpp index 07b3a32e0..5f3c81262 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -52,7 +52,7 @@ char shrinemax[NUM_SHRINETYPE] = { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }; -// 0 - sp+mp, 1 - sp only, 2 - mp only +/** 0 - sp+mp, 1 - sp only, 2 - mp only */ BYTE shrineavail[NUM_SHRINETYPE] = { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, diff --git a/Source/pack.cpp b/Source/pack.cpp index 2ebe39468..931a1c0c6 100644 --- a/Source/pack.cpp +++ b/Source/pack.cpp @@ -106,8 +106,14 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield) pPack->pManaShield = FALSE; } -// Note: last slot of item[MAXITEMS+1] used as temporary buffer -// find real name reference below, possibly [sizeof(item[])/sizeof(ItemStruct)] +/** + * Expand a PkItemStruct in to a ItemStruct + * + * Note: last slot of item[MAXITEMS+1] used as temporary buffer + * find real name reference below, possibly [sizeof(item[])/sizeof(ItemStruct)] + * @param is The source packed item + * @param id The distination item + */ static void UnPackItem(PkItemStruct *is, ItemStruct *id) { if (is->idx == 0xFFFF) { diff --git a/Source/path.cpp b/Source/path.cpp index d0dd05d73..0dda48264 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -1,30 +1,37 @@ +/** + * @file path.cpp + * + * Implementation of the path finding algorithms. + */ #include "all.h" -// preallocated nodes, search is terminated after 300 nodes are visited +/** Notes visisted by the path finding algorithm. */ PATHNODE path_nodes[MAXPATHNODES]; -// size of the pnode_tblptr stack +/** size of the pnode_tblptr stack */ int gdwCurPathStep; -// the number of in-use nodes in path_nodes +/** the number of in-use nodes in path_nodes */ int gdwCurNodes; -/* for reconstructing the path after the A* search is done. The longest +/** + * for reconstructing the path after the A* search is done. The longest * possible path is actually 24 steps, even though we can fit 25 */ int pnode_vals[MAX_PATH_LENGTH]; -// a linked list of all visited nodes +/** A linked list of all visited nodes */ PATHNODE *pnode_ptr; -// a stack for recursively searching nodes +/** A stack for recursively searching nodes */ PATHNODE *pnode_tblptr[MAXPATHNODES]; -// a linked list of the A* frontier, sorted by distance +/** A linked list of the A* frontier, sorted by distance */ PATHNODE *path_2_nodes; PATHNODE path_unusednodes[MAXPATHNODES]; -// for iterating over the 8 possible movement directions +/** For iterating over the 8 possible movement directions */ const char pathxdir[8] = { -1, -1, 1, 1, -1, 0, 1, 0 }; const char pathydir[8] = { -1, 1, -1, 1, 0, -1, 0, 1 }; /* data */ -/* each step direction is assigned a number like this: +/** + * each step direction is assigned a number like this: * dx * -1 0 1 * +----- diff --git a/Source/path.h b/Source/path.h index ff3330849..83191d34f 100644 --- a/Source/path.h +++ b/Source/path.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file path.h + * + * Interface of the path finding algorithms. + */ #ifndef __PATH_H__ #define __PATH_H__ diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 9fea06a5c..d6ac5fa02 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -10,6 +10,7 @@ #define PASSWORD_MULTI "szqnlsk1" #endif +/** List of character names for the character selection screen. */ static char hero_names[MAX_CHARACTERS][PLR_NAME_LEN]; BOOL gbValidSaveFile; diff --git a/Source/player.cpp b/Source/player.cpp index bef128d77..c4913c3fd 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -42,7 +42,7 @@ int PWVel[3][3] = { { 2048, 1024, 512 }, { 2048, 1024, 512 } }; -// Total number of frames in walk animation. +/** Total number of frames in walk animation. */ int AnimLenFromClass[3] = { 8, 8, 8 }; diff --git a/Source/plrmsg.cpp b/Source/plrmsg.cpp index c5b85113d..d745df869 100644 --- a/Source/plrmsg.cpp +++ b/Source/plrmsg.cpp @@ -3,6 +3,7 @@ static BYTE plr_msg_slot; _plrmsg plr_msgs[PMSG_COUNT]; +/** Maps from player_num to text colour, as used in chat messages. */ const char text_color_from_player_num[MAX_PLRS + 1] = { COL_WHITE, COL_WHITE, COL_WHITE, COL_WHITE, COL_GOLD }; void plrmsg_delay(BOOL delay) diff --git a/Source/portal.cpp b/Source/portal.cpp index 038c33d87..88df7ac7d 100644 --- a/Source/portal.cpp +++ b/Source/portal.cpp @@ -1,9 +1,13 @@ #include "all.h" +/** In-game state of portals. */ PortalStruct portal[MAXPORTAL]; +/** Current portal number (a portal array index). */ int portalindex; +/** X-coordinate of each players portal in town. */ int WarpDropX[MAXPORTAL] = { 57, 59, 61, 63 }; +/** Y-coordinate of each players portal in town. */ int WarpDropY[MAXPORTAL] = { 40, 40, 40, 40 }; void InitPortals() diff --git a/Source/render.cpp b/Source/render.cpp index 39a22cb31..7d1327f9e 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -84,7 +84,7 @@ int WorldTbl3x16[48] = { 60, 60, 60 }; -// slope/angle tables, left and right +/** slope/angle tables, left and right */ int WorldTbl17_1[17] = { 0, 4, 8, 16, 24, 36, 48, 64, 80, 100, 120, 144, 168, 196, 224, 256, 288 }; int WorldTbl17_2[17] = { 0, 32, 60, 88, 112, 136, 156, 176, 192, 208, 220, 232, 240, 248, 252, 256, 288 }; diff --git a/Source/setmaps.cpp b/Source/setmaps.cpp index 51b0a3454..3a0b8735c 100644 --- a/Source/setmaps.cpp +++ b/Source/setmaps.cpp @@ -54,6 +54,7 @@ BYTE SkelChamTrans3[36] = { 50, 43, 59, 51 }; +/** Maps from quest level to quest level names. */ char *quest_level_names[] = { "", "Skeleton King's Lair", diff --git a/Source/spelldat.cpp b/Source/spelldat.cpp index 8337d5980..ce198eaf6 100644 --- a/Source/spelldat.cpp +++ b/Source/spelldat.cpp @@ -1,5 +1,6 @@ #include "all.h" +/** Data related to each spell ID. */ SpellData spelldata[MAX_SPELLS] = { // clang-format off // sName, sManaCost, sType, sNameText, sSkillText, sBookLvl, sStaffLvl, sTargeted, sTownSpell, sMinInt, sSFX, sMissiles[3], sManaAdj, sMinMana, sStaffMin, sStaffMax, sBookCost, sStaffCost diff --git a/Source/stores.cpp b/Source/stores.cpp index 61d3dd7d0..5bb86f53d 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -60,6 +60,7 @@ int SStringY[24] = { 264, 276 }; +/** Maps from towner IDs to NPC names. */ char *talkname[9] = { "Griswold", "Pepin", diff --git a/Source/textdat.cpp b/Source/textdat.cpp index b34327590..dbf7898a1 100644 --- a/Source/textdat.cpp +++ b/Source/textdat.cpp @@ -784,4 +784,5 @@ const TextDataStruct alltext[] = { { "Thank goodness you've returned!\nMuch has changed since you lived here, my friend. All was peaceful until the dark riders came and destroyed our village. Many were cut down where they stood, and those who took up arms were slain or dragged away to become slaves - or worse. The church at the edge of town has been desecrated and is being used for dark rituals. The screams that echo in the night are inhuman, but some of our townsfolk may yet survive. Follow the path that lies between my tavern and the blacksmith shop to find the church and save who you can. \n \nPerhaps I can tell you more if we speak again. Good luck.|", 1, 5, TSFX_TAVERN0 } }; -const DWORD gdwAllTextEntries = 259; /* unused */ +/** unused */ +const DWORD gdwAllTextEntries = 259; diff --git a/Source/themes.cpp b/Source/themes.cpp index 4c9a8dddf..4ebbf3b5e 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -1,3 +1,8 @@ +/** + * @file themes.cpp + * + * Implementation of the theme room placing algorithms. + */ #include "all.h" int numthemes; @@ -451,7 +456,9 @@ void InitThemes() } } -// HoldThemeRooms marks theme rooms as populated. +/** + * @brief HoldThemeRooms marks theme rooms as populated. + */ void HoldThemeRooms() { int i, x, y; @@ -475,11 +482,12 @@ void HoldThemeRooms() } } -// PlaceThemeMonsts places theme monsters with the specified frequency. -// -// Parameters: -// - t: theme number (index into themes array). -// - f: frequency (1/f likelihood of adding monster). +/** + * PlaceThemeMonsts places theme monsters with the specified frequency. + * + * @param t theme number (index into themes array). + * @param f frequency (1/f likelihood of adding monster). + */ void PlaceThemeMonsts(int t, int f) { int xp, yp; @@ -505,10 +513,11 @@ void PlaceThemeMonsts(int t, int f) } } -// Theme_Barrel initializes the barrel theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Barrel initializes the barrel theme. + * + * @param t theme number (index into themes array). + */ void Theme_Barrel(int t) { int xp, yp, r; @@ -532,10 +541,11 @@ void Theme_Barrel(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_Shrine initializes the shrine theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Shrine initializes the shrine theme. + * + * @param t theme number (index into themes array). + */ void Theme_Shrine(int t) { char monstrnd[4] = { 6, 6, 3, 9 }; @@ -553,10 +563,11 @@ void Theme_Shrine(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_MonstPit initializes the monster pit theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_MonstPit initializes the monster pit theme. + * + * @param t theme number (index into themes array). + */ void Theme_MonstPit(int t) { int r; @@ -589,10 +600,11 @@ void Theme_MonstPit(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_SkelRoom initializes the skeleton room theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_SkelRoom initializes the skeleton room theme. + * + * @param t theme number (index into themes array). + */ void Theme_SkelRoom(int t) { int xp, yp, i; @@ -658,10 +670,11 @@ void Theme_SkelRoom(int t) } } -// Theme_Treasure initializes the treasure theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Treasure initializes the treasure theme. + * + * @param t theme number (index into themes array). + */ void Theme_Treasure(int t) { int xp, yp; @@ -695,10 +708,11 @@ void Theme_Treasure(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_Library initializes the library theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Library initializes the library theme. + * + * @param t theme number (index into themes array). + */ void Theme_Library(int t) { int xp, yp, oi; @@ -740,10 +754,11 @@ void Theme_Library(int t) } } -// Theme_Torture initializes the torture theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Torture initializes the torture theme. + * + * @param t theme number (index into themes array). + */ void Theme_Torture(int t) { int xp, yp; @@ -764,10 +779,10 @@ void Theme_Torture(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_BloodFountain initializes the blood fountain theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_BloodFountain initializes the blood fountain theme. + * @param t Theme number (index into themes array). + */ void Theme_BloodFountain(int t) { char monstrnd[4] = { 6, 8, 3, 9 }; @@ -777,10 +792,11 @@ void Theme_BloodFountain(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_Decap initializes the decapitated theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Decap initializes the decapitated theme. + * + * @param t theme number (index into themes array). + */ void Theme_Decap(int t) { int xp, yp; @@ -801,10 +817,11 @@ void Theme_Decap(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_PurifyingFountain initializes the purifying fountain theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_PurifyingFountain initializes the purifying fountain theme. + * + * @param t theme number (index into themes array). + */ void Theme_PurifyingFountain(int t) { char monstrnd[4] = { 6, 7, 3, 9 }; @@ -814,10 +831,11 @@ void Theme_PurifyingFountain(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_ArmorStand initializes the armor stand theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_ArmorStand initializes the armor stand theme. + * + * @param t theme number (index into themes array). + */ void Theme_ArmorStand(int t) { int xp, yp; @@ -843,10 +861,11 @@ void Theme_ArmorStand(int t) armorFlag = FALSE; } -// Theme_GoatShrine initializes the goat shrine theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_GoatShrine initializes the goat shrine theme. + * + * @param t theme number (index into themes array). + */ void Theme_GoatShrine(int t) { int xx, yy; @@ -862,10 +881,11 @@ void Theme_GoatShrine(int t) } } -// Theme_Cauldron initializes the cauldron theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_Cauldron initializes the cauldron theme. + * + * @param t theme number (index into themes array). + */ void Theme_Cauldron(int t) { char monstrnd[4] = { 6, 7, 3, 9 }; @@ -875,10 +895,11 @@ void Theme_Cauldron(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_MurkyFountain initializes the murky fountain theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_MurkyFountain initializes the murky fountain theme. + * + * @param t theme number (index into themes array). + */ void Theme_MurkyFountain(int t) { char monstrnd[4] = { 6, 7, 3, 9 }; @@ -888,10 +909,11 @@ void Theme_MurkyFountain(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_TearFountain initializes the tear fountain theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_TearFountain initializes the tear fountain theme. + * + * @param t theme number (index into themes array). + */ void Theme_TearFountain(int t) { char monstrnd[4] = { 6, 7, 3, 9 }; @@ -901,10 +923,11 @@ void Theme_TearFountain(int t) PlaceThemeMonsts(t, monstrnd[leveltype - 1]); } -// Theme_BrnCross initializes the burning cross theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_BrnCross initializes the burning cross theme. + * + * @param t theme number (index into themes array). + */ void Theme_BrnCross(int t) { int xp, yp; @@ -926,10 +949,11 @@ void Theme_BrnCross(int t) bCrossFlag = TRUE; } -// Theme_WeaponRack initializes the weapon rack theme. -// -// Parameters: -// - t: theme number (index into themes array). +/** + * Theme_WeaponRack initializes the weapon rack theme. + * + * @param t theme number (index into themes array). + */ void Theme_WeaponRack(int t) { int xp, yp; @@ -955,7 +979,9 @@ void Theme_WeaponRack(int t) weaponFlag = FALSE; } -// UpdateL4Trans sets each value of the transparency map to 1. +/** + * UpdateL4Trans sets each value of the transparency map to 1. + */ void UpdateL4Trans() { int i, j; @@ -969,7 +995,9 @@ void UpdateL4Trans() } } -// CreateThemeRooms adds thematic elements to rooms. +/** + * CreateThemeRooms adds thematic elements to rooms. + */ void CreateThemeRooms() { int i; diff --git a/Source/themes.h b/Source/themes.h index 5ee91827c..35c4cb083 100644 --- a/Source/themes.h +++ b/Source/themes.h @@ -1,4 +1,8 @@ -//HEADER_GOES_HERE +/** + * @file themes.h + * + * Interface of the theme room placing algorithms. + */ #ifndef __THEMES_H__ #define __THEMES_H__ diff --git a/Source/towners.cpp b/Source/towners.cpp index 09782e238..103271ef4 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -4,7 +4,8 @@ BOOL storeflag; int sgnCowMsg; int numtowners; DWORD sgdwCowClicks; -BOOL bannerflag; // unused 0x6AAC28 +/** unused 0x6AAC28 */ +BOOL bannerflag; BOOL boyloadflag; BYTE *pCowCels; TownerStruct towner[16]; diff --git a/defs.h b/defs.h index 20c09ac78..505eb4bf8 100644 --- a/defs.h +++ b/defs.h @@ -1,4 +1,8 @@ -// some global definitions, found in debug release +/** + * @file defs.h + * + * Global definitions and Macros. + */ #define GAME_NAME "DIABLO" diff --git a/doxygen.config b/doxygen.config new file mode 100644 index 000000000..47dd195f7 --- /dev/null +++ b/doxygen.config @@ -0,0 +1,34 @@ +PROJECT_NAME = "Devilution" +PROJECT_BRIEF = "Diablo devolved - magic behind the 1996 computer game" +OUTPUT_DIRECTORY = docs +INPUT = ./ ./Source +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cpp \ + *.h \ + *.inc +GENERATE_LATEX = NO + +# Call graphces alows logical navigation of the docs +CALL_GRAPH = YES +CALLER_GRAPH = YES + +# all.h includes everything and everything inclues it so the graph is usless past depth 1 +MAX_DOT_GRAPH_DEPTH = 1 + +SOURCE_BROWSER = YES +EXTRACT_STATIC = YES +JAVADOC_AUTOBRIEF = YES +OPTIMIZE_OUTPUT_FOR_C = YES + +HTML_COLORSTYLE_HUE = 0 +HTML_COLORSTYLE_SAT = 125 +HTML_COLORSTYLE_GAMMA = 200 +HTML_DYNAMIC_SECTIONS = YES + +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = YES + +# Not all files are documented yet +EXTRACT_ALL = YES +