Devilution
Diablo devolved - magic behind the 1996 computer game
|
Go to the documentation of this file.
16 char szName[MAX_PATH];
18 int _ViewX, _ViewY, _nummonsters, _numitems, _nummissiles, _nobjects;
26 if (
ILoad() !=
'RETL')
37 _nummonsters =
WLoad();
39 _nummissiles =
WLoad();
108 for (i = 0; i < 128; i++)
111 for (j = 0; j <
MAXDUNY; j++) {
115 for (j = 0; j <
MAXDUNY; j++) {
119 for (j = 0; j <
MAXDUNY; j++) {
123 for (j = 0; j <
MAXDUNY; j++) {
129 for (j = 0; j <
MAXDUNY; j++) {
133 for (j = 0; j <
MAXDUNY; j++) {
137 for (j = 0; j <
MAXDUNY; j++) {
141 for (j = 0; j <
MAXDUNY; j++) {
145 for (j = 0; j <
MAXDUNY; j++) {
149 for (j = 0; j <
DMAXY; j++) {
150 for (i = 0; i <
DMAXX; i++)
153 for (j = 0; j <
MAXDUNY; j++) {
189 int rv = *
tbuff++ << 24;
190 rv |= *
tbuff++ << 16;
199 int rv = *
tbuff++ << 24;
200 rv |= *
tbuff++ << 16;
209 if (*
tbuff++ == TRUE)
223 *(
char*)dst = *(
char*)src;
230 memcpy(&buf, src, 2);
233 memcpy(dst, &buf, 2);
238 const auto *s =
reinterpret_cast<const unsigned short *
>(src);
239 auto *d =
reinterpret_cast<unsigned short *
>(dst);
240 for(
int i = 0; i < n; i++) {
249 memcpy(&buf, src, 4);
252 memcpy(dst, &buf, 4);
255 void CopyInts(
const void *src,
const int n,
void *dst)
257 const auto *s =
reinterpret_cast<const unsigned int *
>(src);
258 auto *d =
reinterpret_cast<unsigned int *
>(dst);
259 for(
int i = 0; i < n; i++) {
267 unsigned long long buf;
268 memcpy(&buf, src, 8);
270 buf = SDL_SwapLE64(buf);
271 memcpy(dst, &buf, 8);
742 for (
int i = 0; i < n; i++) {
830 char szName[MAX_PATH];
902 for (i = 0; i < 128; i++)
905 for (j = 0; j <
MAXDUNY; j++) {
909 for (j = 0; j <
MAXDUNY; j++) {
913 for (j = 0; j <
MAXDUNY; j++) {
917 for (j = 0; j <
MAXDUNY; j++) {
923 for (j = 0; j <
MAXDUNY; j++) {
927 for (j = 0; j <
MAXDUNY; j++) {
931 for (j = 0; j <
MAXDUNY; j++) {
935 for (j = 0; j <
MAXDUNY; j++) {
939 for (j = 0; j <
MAXDUNY; j++) {
943 for (j = 0; j <
DMAXY; j++) {
944 for (i = 0; i <
DMAXX; i++)
947 for (j = 0; j <
MAXDUNY; j++) {
1460 for (
int i = 0; i < n; i++) {
1548 char szName[MAX_PATH];
1560 for (j = 0; j <
MAXDUNY; j++) {
1590 for (j = 0; j <
MAXDUNY; j++) {
1594 for (j = 0; j <
MAXDUNY; j++) {
1600 for (j = 0; j <
MAXDUNY; j++) {
1604 for (j = 0; j <
MAXDUNY; j++) {
1608 for (j = 0; j <
MAXDUNY; j++) {
1612 for (j = 0; j <
MAXDUNY; j++) {
1616 for (j = 0; j <
DMAXY; j++) {
1617 for (i = 0; i <
DMAXX; i++)
1620 for (j = 0; j <
MAXDUNY; j++) {
1641 char szName[MAX_PATH];
1649 for (j = 0; j <
MAXDUNY; j++) {
1682 for (j = 0; j <
MAXDUNY; j++) {
1686 for (j = 0; j <
MAXDUNY; j++) {
1692 for (j = 0; j <
MAXDUNY; j++) {
1696 for (j = 0; j <
MAXDUNY; j++) {
1700 for (j = 0; j <
MAXDUNY; j++) {
1704 for (j = 0; j <
MAXDUNY; j++) {
1708 for (j = 0; j <
DMAXY; j++) {
1709 for (i = 0; i <
DMAXX; i++)
1712 for (j = 0; j <
MAXDUNY; j++) {
unsigned char mArmorClass
void CopyChar(const void *src, void *dst)
void pfile_write_save_file(const char *pszName, BYTE *pbData, DWORD dwLen, DWORD qwLen)
void SyncObjectAnim(int o)
void SyncMonsterAnim(int i)
QuestStruct quests[MAXQUESTS]
char InvGrid[NUM_INV_GRID_ELEM]
int AutoMapScale
Specifies the scale of the automap.
unsigned char mMaxDamage2
void LoadItemData(ItemStruct *pItem)
#define SMITH_PREMIUM_ITEMS
void CopyShorts(const void *src, const int n, void *dst)
ItemStruct item[MAXITEMS+1]
void GetPermLevelNames(char *szPerm)
DEVILUTION_BEGIN_NAMESPACE int itemactive[MAXITEMS]
MissileStruct missile[MAXMISSILES]
DEVILUTION_BEGIN_NAMESPACE PortalStruct portal[MAXPORTAL]
In-game state of portals.
LightListStruct LightList[MAXLIGHTS]
ItemStruct InvList[NUM_INV_GRID_ELEM]
int gnLevelTypeTbl[NUMLEVELS]
void CopyInts(const void *src, const int n, void *dst)
BOOL automapflag
Specifies whether the automap is enabled.
void CopyInt64(const void *src, void *dst)
void pfile_rename_temp_to_perm()
ItemStruct SpdList[MAXBELTITEMS]
int objectavail[MAXOBJECTS]
char dObject[MAXDUNX][MAXDUNY]
ItemStruct premiumitem[SMITH_PREMIUM_ITEMS]
char walkpath[MAX_PATH_LENGTH]
void SaveItems(ItemStruct *pItem, const int n)
BOOLEAN _pLvlVisited[NUMLEVELS]
int missileavail[MAXMISSILES]
char dLight[MAXDUNX][MAXDUNY]
void SyncInitPlr(int pnum)
void LoadItems(const int n, ItemStruct *pItem)
void app_fatal(const char *pszFmt,...)
#define DEVILUTION_END_NAMESPACE
void SyncPlrAnim(int pnum)
MonsterStruct monster[MAXMONSTERS]
unsigned char mMinDamage2
char dMissile[MAXDUNX][MAXDUNY]
void LoadGame(BOOL firstflag)
char dItem[MAXDUNX][MAXDUNY]
int objectactive[MAXOBJECTS]
DEVILUTION_BEGIN_NAMESPACE int missileactive[MAXMISSILES]
BOOLEAN _pSLvlVisited[NUMLEVELS]
int GetRndSeed()
Get the current RNG seed.
void SaveItem(ItemStruct *pItem)
BYTE * pfile_read(const char *pszName, DWORD *pdwLen)
void pfile_get_game_name(char *dst)
DWORD codec_get_encoded_len(DWORD dwSrcBytes)
void GetTempLevelNames(char *szTemp)
DEVILUTION_BEGIN_NAMESPACE LightListStruct VisionList[MAXVISION]
void LoadGameLevel(BOOL firstflag, int lvldir)
BOOLEAN automapview[DMAXX][DMAXY]
Tracks the explored areas of the map.
int monstkills[MAXMONSTERS]
void CopyBytes(const void *src, const int n, void *dst)
int monstactive[MAXMONSTERS]
DEVILUTION_BEGIN_NAMESPACE BOOL invflag
char dPreLight[MAXDUNX][MAXDUNY]
DWORD glSeedTbl[NUMLEVELS]
BYTE * DiabloAllocPtr(DWORD dwBytes)
Multithreaded safe malloc.
ItemStruct InvBody[NUM_INVLOC]
void pfile_remove_temp_files()
BYTE lightactive[MAXLIGHTS]
void CopyInt(const void *src, void *dst)
void mem_free_dbg(void *p)
Multithreaded safe memfree.
int dMonster[MAXDUNX][MAXDUNY]
void CopyShort(const void *src, void *dst)
void missiles_process_charge()
char dPlayer[MAXDUNX][MAXDUNY]
char dFlags[MAXDUNX][MAXDUNY]
#define NUM_INV_GRID_ELEM
char _pName[PLR_NAME_LEN]
char dDead[MAXDUNX][MAXDUNY]
PlayerStruct plr[MAX_PLRS]
DEVILUTION_BEGIN_NAMESPACE BYTE * tbuff