Browse Source

Remove some unused junk

pull/1052/head
Anders Jenbo 5 years ago
parent
commit
b4e78c5e79
  1. 3
      Source/init.cpp
  2. 14
      Source/loadsave.cpp
  3. 9
      Source/multi.cpp
  4. 1
      Source/pack.cpp
  5. 23
      Source/player.cpp
  6. 1
      Source/player.h
  7. 47
      SourceX/DiabloUI/diabloui.cpp
  8. 20
      SourceX/stubs.h
  9. 20
      structs.h

3
Source/init.cpp

@ -142,9 +142,6 @@ void init_archives()
memset(&fileinfo, 0, sizeof(fileinfo));
fileinfo.size = sizeof(fileinfo);
fileinfo.versionstring = gszVersionNumber;
fileinfo.executablefile = "";
fileinfo.originalarchivefile = "";
fileinfo.patcharchivefile = "";
init_get_file_info();
diabdat_mpq = init_test_access("diabdat.mpq", "DiabloCD", 1000, FS_CD);

14
Source/loadsave.cpp

@ -396,14 +396,14 @@ static void LoadPlayer(int i)
tbuff += 1;
pPlayer->pOriginalCathedral = true;
}
CopyBytes(tbuff, 2, &pPlayer->bReserved);
tbuff += 2; // Avalible bytes
CopyShort(tbuff, &pPlayer->wReflections);
CopyShorts(tbuff, 7, &pPlayer->wReserved);
tbuff += 14; // Avalible bytes
CopyInt(tbuff, &pPlayer->pDiabloKillLevel);
CopyInt(tbuff, &pPlayer->pDifficulty);
CopyInt(tbuff, &pPlayer->pDamAcFlags);
CopyInts(tbuff, 5, &pPlayer->dwReserved);
tbuff += 20; // Avalible bytes
// Omit pointer _pNData
// Omit pointer _pWData
@ -797,7 +797,7 @@ void LoadGame(BOOL firstflag)
for (i = 0; i < giNumberOfLevels; i++) {
glSeedTbl[i] = ILoad();
gnLevelTypeTbl[i] = WLoad();
tbuff += 4; // Skip loading gnLevelTypeTbl
}
LoadPlayer(myplr);
@ -1263,14 +1263,14 @@ static void SavePlayer(int i)
CopyChar(&pPlayer->pBattleNet, tbuff);
CopyChar(&pPlayer->pManaShield, tbuff);
CopyChar(&pPlayer->pOriginalCathedral, tbuff);
CopyBytes(&pPlayer->bReserved, 2, tbuff);
tbuff += 2; // Avalible bytes
CopyShort(&pPlayer->wReflections, tbuff);
CopyShorts(&pPlayer->wReserved, 7, tbuff);
tbuff += 14; // Avalible bytes
CopyInt(&pPlayer->pDiabloKillLevel, tbuff);
CopyInt(&pPlayer->pDifficulty, tbuff);
CopyInt(&pPlayer->pDamAcFlags, tbuff);
CopyInts(&pPlayer->dwReserved, 5, tbuff);
tbuff += 20; // Avalible bytes
// Omit pointer _pNData
// Omit pointer _pWData

9
Source/multi.cpp

@ -756,17 +756,8 @@ BOOL NetInit(BOOL bSinglePlayer, BOOL *pfExitProgram)
plrdata.size = sizeof(plrdata);
memset(&UiData, 0, sizeof(UiData));
UiData.size = sizeof(UiData);
UiData.artcallback = (void (*)())UiArtCallback;
UiData.createcallback = (void (*)())UiCreateGameCallback;
UiData.drawdesccallback = (void (*)())UiDrawDescCallback;
UiData.soundcallback = (void (*)())UiSoundCallback;
UiData.authcallback = (void (*)())UiAuthCallback;
UiData.getdatacallback = (void (*)())UiGetDataCallback;
UiData.categorycallback = (void (*)())UiCategoryCallback;
UiData.selectnamecallback = mainmenu_select_hero_dialog;
UiData.changenamecallback = (void (*)())mainmenu_change_name;
UiData.profilebitmapcallback = (void (*)())UiProfileDraw;
UiData.profilecallback = (void (*)())UiProfileCallback;
UiData.profilefields = UiProfileGetString();
memset(sgbPlayerTurnBitTbl, 0, sizeof(sgbPlayerTurnBitTbl));
gbGameDestroyed = FALSE;

1
Source/pack.cpp

@ -190,7 +190,6 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok)
PkItemStruct *pki;
pPlayer = &plr[pnum];
ClearPlrRVars(pPlayer);
pPlayer->_px = pPack->px;
pPlayer->_py = pPack->py;
pPlayer->_pfutx = pPack->px;

23
Source/player.cpp

@ -652,26 +652,6 @@ void SetPlrAnims(int pnum)
}
}
void ClearPlrRVars(PlayerStruct *p)
{
// TODO: Missing debug assert p != NULL
p->bReserved[0] = 0;
p->bReserved[1] = 0;
p->wReserved[0] = 0;
p->wReserved[1] = 0;
p->wReserved[2] = 0;
p->wReserved[3] = 0;
p->wReserved[4] = 0;
p->wReserved[5] = 0;
p->wReserved[6] = 0;
p->dwReserved[0] = 0;
p->dwReserved[1] = 0;
p->dwReserved[2] = 0;
p->dwReserved[3] = 0;
p->dwReserved[4] = 0;
}
/**
* @param c plr_classes value
@ -683,7 +663,6 @@ void CreatePlayer(int pnum, char c)
int i;
memset(&plr[pnum], 0, sizeof(PlayerStruct));
ClearPlrRVars(&plr[pnum]);
SetRndSeed(SDL_GetTicks());
if ((DWORD)pnum >= MAX_PLRS) {
@ -1004,8 +983,6 @@ void InitPlayer(int pnum, BOOL FirstTime)
app_fatal("InitPlayer: illegal player %d", pnum);
}
ClearPlrRVars(&plr[pnum]);
if (FirstTime) {
plr[pnum]._pRSplType = RSPLTYPE_INVALID;
plr[pnum]._pRSpell = SPL_INVALID;

1
Source/player.h

@ -23,7 +23,6 @@ void InitPlrGFXMem(int pnum);
void FreePlayerGFX(int pnum);
void NewPlrAnim(int pnum, BYTE *Peq, int numFrames, int Delay, int width);
void SetPlrAnims(int pnum);
void ClearPlrRVars(PlayerStruct *p);
void CreatePlayer(int pnum, char c);
int CalcStatDiff(int pnum);
#ifdef _DEBUG

47
SourceX/DiabloUI/diabloui.cpp

@ -505,53 +505,6 @@ BOOL UiValidPlayerName(const char *name)
return true;
}
void UiProfileCallback()
{
UNIMPLEMENTED();
}
void UiProfileDraw()
{
UNIMPLEMENTED();
}
BOOL UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, DWORD *a6, DWORD *a7)
{
UNIMPLEMENTED();
}
BOOL UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5)
{
UNIMPLEMENTED();
}
BOOL UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, char *lpBuffer, int cchBufferMax)
{
UNIMPLEMENTED();
}
BOOL UiSoundCallback(int a1, int type, int a3)
{
UNIMPLEMENTED();
}
BOOL UiDrawDescCallback(int game_type, DWORD color, const char *lpString, char *a4, int a5, UINT align, time_t a7,
HDC *a8)
{
UNIMPLEMENTED();
}
BOOL UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6)
{
UNIMPLEMENTED();
}
BOOL UiArtCallback(int game_type, unsigned int art_code, SDL_Color *pPalette, BYTE *pBuffer,
DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp)
{
UNIMPLEMENTED();
}
BOOL UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char (*desc)[128])
{
char format[32] = "";

20
SourceX/stubs.h

@ -10,12 +10,6 @@
abort(); \
} while (0)
#define UNIMPLEMENTED_UNLESS(x) \
do { \
if (!(x)) \
UNIMPLEMENTED(); \
} while (0)
#define ABORT() \
do { \
SDL_Log("ABORT: %s @ %s:%d", __FUNCTION__, __FILE__, __LINE__); \
@ -24,20 +18,6 @@
#define DUMMY() SDL_Log("DUMMY: %s @ %s:%d", __FUNCTION__, __FILE__, __LINE__)
#define DUMMY_ONCE() \
do { \
static bool dummy_shown = false; \
if (!dummy_shown) { \
DUMMY(); \
dummy_shown = true; \
} \
} while (0)
static inline const char *nullstr(const char *a)
{
return a ? a : "(null)";
}
#define ASSERT(x) \
if (!(x)) { \
SDL_Log("Assertion failed in %s:%d: %s", __FILE__, __LINE__, #x); \

20
structs.h

@ -334,13 +334,10 @@ typedef struct PlayerStruct {
BOOLEAN pManaShield;
unsigned char pDungMsgs2;
BOOLEAN pOriginalCathedral;
char bReserved[2];
WORD wReflections;
short wReserved[7];
DWORD pDiabloKillLevel;
int pDifficulty;
int pDamAcFlags;
int dwReserved[5];
unsigned char *_pNData;
unsigned char *_pWData;
unsigned char *_pAData;
@ -350,7 +347,6 @@ typedef struct PlayerStruct {
unsigned char *_pHData;
unsigned char *_pDData;
unsigned char *_pBData;
void *pReserved;
} PlayerStruct;
//////////////////////////////////////////////////
@ -1158,7 +1154,6 @@ typedef struct _SNETPLAYERDATA {
int size;
char *playername;
char *playerdescription;
int reserved;
} _SNETPLAYERDATA;
typedef struct _SNETPROGRAMDATA {
@ -1167,11 +1162,9 @@ typedef struct _SNETPROGRAMDATA {
const char *programdescription;
int programid;
int versionid;
int reserved1;
int maxplayers;
_gamedata *initdata;
int initdatabytes;
void *reserved2;
int optcategorybits;
char *cdkey;
char *registereduser;
@ -1182,28 +1175,15 @@ typedef struct _SNETPROGRAMDATA {
typedef struct _SNETVERSIONDATA {
int size;
const char *versionstring;
const char *executablefile;
const char *originalarchivefile;
const char *patcharchivefile;
} _SNETVERSIONDATA;
typedef struct _SNETUIDATA {
int size;
int uiflags;
void (*artcallback)();
void (*authcallback)();
void (*createcallback)();
void (*drawdesccallback)();
void (*selectedcallback)();
void (*soundcallback)();
void (*statuscallback)();
void (*getdatacallback)();
void (*categorycallback)();
void (*categorylistcallback)();
void (*newaccountcallback)();
void (*profilecallback)();
const char **profilefields;
void (*profilebitmapcallback)();
int (*selectnamecallback)(
const struct _SNETPROGRAMDATA *,
const struct _SNETPLAYERDATA *,

Loading…
Cancel
Save