1 /** 2 * @file structs.h 3 * 4 * Various global structures. 5 */ 6 7 DEVILUTION_BEGIN_NAMESPACE 8 9 ////////////////////////////////////////////////// 10 // textdat 11 ////////////////////////////////////////////////// 12 13 typedef struct TextDataStruct { 14 const char *txtstr; 15 int scrlltxt; 16 int txtspd; /* calculated dynamically, 01/23/21 */ 17 int sfxnr; 18 } TextDataStruct; 19 20 ////////////////////////////////////////////////// 21 // effects/sound 22 ////////////////////////////////////////////////// 23 24 typedef struct TSnd { 25 const char *sound_path; 26 HANDLE file_handle; // for streamed audio 27 SoundSample *DSB; 28 int start_tc; 29 } TSnd; 30 31 typedef struct TSFX { 32 unsigned char bFlags; 33 const char *pszName; 34 TSnd *pSnd; 35 } TSFX; 36 37 ////////////////////////////////////////////////// 38 // monster 39 ////////////////////////////////////////////////// 40 41 typedef struct AnimStruct { 42 BYTE *CMem; 43 BYTE *Data[8]; 44 int Frames; 45 int Rate; 46 } AnimStruct; 47 48 ////////////////////////////////////////////////// 49 // objects 50 ////////////////////////////////////////////////// 51 52 typedef struct ObjDataStruct { 53 char oload; 54 char ofindex; 55 char ominlvl; 56 char omaxlvl; 57 char olvltype; 58 char otheme; 59 char oquest; 60 int oAnimFlag; 61 int oAnimDelay; // Tick length of each frame in the current animation 62 int oAnimLen; // Number of frames in current animation 63 int oAnimWidth; 64 BOOL oSolidFlag; 65 BOOL oMissFlag; 66 BOOL oLightFlag; 67 char oBreak; 68 char oSelFlag; 69 BOOL oTrapFlag; 70 } ObjDataStruct; 71 72 typedef struct ObjectStruct { 73 int _otype; 74 int _ox; 75 int _oy; 76 bool _oLight; 77 Uint32 _oAnimFlag; 78 unsigned char *_oAnimData; 79 int _oAnimDelay; // Tick length of each frame in the current animation 80 int _oAnimCnt; // Increases by one each game tick, counting how close we are to _pAnimDelay 81 int _oAnimLen; // Number of frames in current animation 82 int _oAnimFrame; // Current frame of animation. 83 int _oAnimWidth; 84 int _oAnimWidth2; 85 BOOL _oDelFlag; 86 char _oBreak; // check 87 BOOL _oSolidFlag; 88 BOOL _oMissFlag; 89 char _oSelFlag; // check 90 BOOL _oPreFlag; 91 BOOL _oTrapFlag; 92 BOOL _oDoorFlag; 93 int _olid; 94 int _oRndSeed; 95 int _oVar1; 96 int _oVar2; 97 int _oVar3; 98 int _oVar4; 99 int _oVar5; 100 int _oVar6; 101 _speech_id _oVar7; 102 int _oVar8; 103 } ObjectStruct; 104 105 ////////////////////////////////////////////////// 106 // gamemenu/gmenu 107 ////////////////////////////////////////////////// 108 109 // TPDEF PTR FCN VOID TMenuFcn 110 111 typedef struct TMenuItem { 112 DWORD dwFlags; 113 const char *pszStr; 114 void (*fnMenu)(BOOL); /* fix, should have one arg */ 115 } TMenuItem; 116 117 // TPDEF PTR FCN VOID TMenuUpdateFcn 118 119 ////////////////////////////////////////////////// 120 // spells 121 ////////////////////////////////////////////////// 122 123 typedef struct SpellData { 124 unsigned char sName; 125 unsigned char sManaCost; 126 unsigned char sType; 127 const char *sNameText; 128 const char *sSkillText; 129 int sBookLvl; 130 int sStaffLvl; 131 BOOL sTargeted; 132 BOOL sTownSpell; 133 int sMinInt; 134 unsigned char sSFX; 135 unsigned char sMissiles[3]; 136 unsigned char sManaAdj; 137 unsigned char sMinMana; 138 int sStaffMin; 139 int sStaffMax; 140 int sBookCost; 141 int sStaffCost; 142 } SpellData; 143 144 ////////////////////////////////////////////////// 145 // drlg 146 ////////////////////////////////////////////////// 147 148 typedef struct ShadowStruct { 149 unsigned char strig; 150 unsigned char s1; 151 unsigned char s2; 152 unsigned char s3; 153 unsigned char nv1; 154 unsigned char nv2; 155 unsigned char nv3; 156 } ShadowStruct; 157 158 typedef struct HALLNODE { 159 int nHallx1; 160 int nHally1; 161 int nHallx2; 162 int nHally2; 163 int nHalldir; 164 struct HALLNODE *pNext; 165 } HALLNODE; 166 167 typedef struct ROOMNODE { 168 int nRoomx1; 169 int nRoomy1; 170 int nRoomx2; 171 int nRoomy2; 172 int nRoomDest; 173 } ROOMNODE; 174 175 ////////////////////////////////////////////////// 176 // themes 177 ////////////////////////////////////////////////// 178 179 typedef struct ThemeStruct { 180 char ttype; /* aligned 4 */ 181 int ttval; 182 } ThemeStruct; 183 184 ////////////////////////////////////////////////// 185 // inv 186 ////////////////////////////////////////////////// 187 188 typedef struct InvXY { 189 int X; 190 int Y; 191 } InvXY; 192 193 ////////////////////////////////////////////////// 194 // diabloui 195 ////////////////////////////////////////////////// 196 197 // TPDEF PTR FCN VOID PLAYSND 198 199 typedef struct _uidefaultstats { 200 WORD strength; 201 WORD magic; 202 WORD dexterity; 203 WORD vitality; 204 } _uidefaultstats; 205 206 typedef struct _uiheroinfo { 207 struct _uiheroinfo *next; 208 char name[16]; 209 WORD level; 210 plr_class heroclass; 211 BYTE herorank; 212 WORD strength; 213 WORD magic; 214 WORD dexterity; 215 WORD vitality; 216 int gold; 217 int hassaved; 218 BOOL spawned; 219 } _uiheroinfo; 220 221 // TPDEF PTR FCN UCHAR ENUMHEROPROC 222 // TPDEF PTR FCN UCHAR ENUMHEROS 223 // TPDEF PTR FCN UCHAR CREATEHERO 224 // TPDEF PTR FCN UCHAR DELETEHERO 225 // TPDEF PTR FCN UCHAR GETDEFHERO 226 227 // TPDEF PTR FCN INT PROGRESSFCN 228 229 ////////////////////////////////////////////////// 230 // storm 231 ////////////////////////////////////////////////// 232 233 // TPDEF PTR FCN UCHAR SMSGIDLEPROC 234 // TPDEF PTR FCN VOID SMSGHANDLER 235 236 typedef struct _SNETCAPS { 237 DWORD size; 238 DWORD flags; 239 DWORD maxmessagesize; 240 DWORD maxqueuesize; 241 DWORD maxplayers; 242 DWORD bytessec; 243 DWORD latencyms; 244 DWORD defaultturnssec; 245 DWORD defaultturnsintransit; 246 } _SNETCAPS; 247 248 typedef struct _SNETEVENT { 249 DWORD eventid; 250 DWORD playerid; 251 void *data; 252 DWORD databytes; 253 } _SNETEVENT; 254 255 // TPDEF PTR FCN UCHAR SNETABORTPROC 256 // TPDEF PTR FCN UCHAR SNETCATEGORYPROC 257 // TPDEF PTR FCN UCHAR SNETCHECKAUTHPROC 258 // TPDEF PTR FCN UCHAR SNETCREATEPROC 259 // TPDEF PTR FCN UCHAR SNETDRAWDESCPROC 260 // TPDEF PTR FCN UCHAR SNETENUMDEVICESPROC 261 // TPDEF PTR FCN UCHAR SNETENUMGAMESPROC 262 // TPDEF PTR FCN UCHAR SNETENUMPROVIDERSPROC 263 // TPDEF PTR FCN VOID SNETEVENTPROC 264 // TPDEF PTR FCN UCHAR SNETGETARTPROC 265 // TPDEF PTR FCN UCHAR SNETGETDATAPROC 266 // TPDEF PTR FCN INT SNETMESSAGEBOXPROC 267 // TPDEF PTR FCN UCHAR SNETPLAYSOUNDPROC 268 // TPDEF PTR FCN UCHAR SNETSELECTEDPROC 269 // TPDEF PTR FCN UCHAR SNETSTATUSPROC 270 271 typedef struct _SNETPLAYERDATA { 272 int size; 273 char *playername; 274 char *playerdescription; 275 } _SNETPLAYERDATA; 276 277 typedef struct _SNETVERSIONDATA { 278 int size; 279 const char *versionstring; 280 } _SNETVERSIONDATA; 281 282 typedef struct _SNETUIDATA { 283 int size; 284 void (*selectedcallback)(); 285 void (*statuscallback)(); 286 void (*categorylistcallback)(); 287 void (*newaccountcallback)(); 288 const char **profilefields; 289 bool (*selectnamecallback)( 290 const struct _SNETPROGRAMDATA *, 291 const struct _SNETPLAYERDATA *, 292 const struct _SNETUIDATA *, 293 const struct _SNETVERSIONDATA *, 294 DWORD provider, /* e.g. 'BNET', 'IPXN', 'MODM', 'SCBL' */ 295 char *, DWORD, /* character name will be copied here */ 296 char *, DWORD, /* character "description" will be copied here (used to advertise games) */ 297 bool * /* new character? - unsure about this */ 298 ); 299 void (*changenamecallback)(); 300 } _SNETUIDATA; 301 302 // TPDEF PTR FCN UCHAR SNETSPIBIND 303 // TPDEF PTR FCN UCHAR SNETSPIQUERY 304 305 ////////////////////////////////////////////////// 306 // capture 307 ////////////////////////////////////////////////// 308 309 typedef struct _PcxHeader { 310 BYTE Manufacturer; 311 BYTE Version; 312 BYTE Encoding; 313 BYTE BitsPerPixel; 314 WORD Xmin; 315 WORD Ymin; 316 WORD Xmax; 317 WORD Ymax; 318 WORD HDpi; 319 WORD VDpi; 320 BYTE Colormap[48]; 321 BYTE Reserved; 322 BYTE NPlanes; 323 WORD BytesPerLine; 324 WORD PaletteInfo; 325 WORD HscreenSize; 326 WORD VscreenSize; 327 BYTE Filler[54]; 328 } PCXHEADER; 329 330 DEVILUTION_END_NAMESPACE 331