Browse Source

Remove unused code

pull/573/head
Anders Jenbo 6 years ago
parent
commit
118e3668b4
  1. 918
      3rdParty/Storm/Source/storm.h
  2. 38
      DiabloUI/diabloui.h
  3. 2
      Source/dthread.cpp
  4. 55
      SourceS/miniwin/misc.h
  5. 2
      SourceS/ui_fwd.h
  6. 6
      SourceX/DiabloUI/diabloui.cpp
  7. 2
      SourceX/display.cpp
  8. 8
      SourceX/miniwin/misc_msg.cpp
  9. 19
      SourceX/miniwin/thread.cpp

918
3rdParty/Storm/Source/storm.h vendored

File diff suppressed because it is too large Load Diff

38
DiabloUI/diabloui.h

@ -4,35 +4,10 @@
namespace dvl {
//#if defined(__GNUC__) || defined(__cplusplus)
//extern "C" {
//#endif
struct FontStruct {
unsigned char fontbin[258];
HANDLE fonttrans[256];
BOOL active;
};
struct ProfileStruct {
char *name;
char field_4;
int msg;
int field_C;
};
struct ProfFntStruct {
int size;
char *fontname;
int field_8;
};
void UiDestroy();
void UiTitleDialog();
void UiSetSpawned(BOOL bSpawned);
void UiInitialize();
BOOL UiCopyProtError(int *pdwResult);
void UiAppActivate(BOOL bActive);
BOOL UiValidPlayerName(char *name); /* check */
BOOL UiSelHeroMultDialog(BOOL (*fninfo)(BOOL (*fninfofunc)(_uiheroinfo *)), BOOL (*fncreate)(_uiheroinfo *), BOOL (*fnremove)(_uiheroinfo *), BOOL (*fnstats)(unsigned int, _uidefaultstats *), int *dlgresult, BOOL *hero_is_created, char *name);
BOOL UiSelHeroSingDialog(BOOL (*fninfo)(BOOL (*fninfofunc)(_uiheroinfo *)), BOOL (*fncreate)(_uiheroinfo *), BOOL (*fnremove)(_uiheroinfo *), BOOL (*fnstats)(unsigned int, _uidefaultstats *), int *dlgresult, char *name, int *difficulty);
@ -44,23 +19,16 @@ void UiProfileCallback();
void UiProfileDraw();
BOOL UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, DWORD *a6, DWORD *a7);
BOOL UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);
BOOL UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, LPSTR lpBuffer, int cchBufferMax);
BOOL UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, char *lpBuffer, int cchBufferMax);
BOOL UiSoundCallback(int a1, int type, int a3);
void UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType);
BOOL UiDrawDescCallback(int game_type, DWORD color, LPCSTR lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
void UiMessageBoxCallback(HWND hWnd, char *lpText, const char *lpCaption, UINT uType);
BOOL UiDrawDescCallback(int game_type, DWORD color, const char *lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
BOOL UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
BOOL UiArtCallback(int game_type, unsigned int art_code, SDL_Color *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
int UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6);
int UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type);
BOOL UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char *desc);
void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, DWORD type);
void UiCreateGameCriteria(_uiheroinfo *pInfo, char *str);
BOOL UiGetDefaultStats(int pclass, _uidefaultstats *pStats);
BOOL UiBetaDisclaimer(int a1);
//#if defined(__GNUC__) || defined(__cplusplus)
//}
//#endif
}

2
Source/dthread.cpp

@ -58,7 +58,7 @@ void dthread_start()
return;
}
sghWorkToDoEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
sghWorkToDoEvent = CreateEvent();
if (!sghWorkToDoEvent) {
error_buf = TraceLastError();
app_fatal("dthread:1\n%s", error_buf);

55
SourceS/miniwin/misc.h

@ -4,49 +4,34 @@ namespace dvl {
constexpr auto DVL_MAX_PATH = 260;
typedef char CHAR;
typedef uint16_t SHORT;
typedef int32_t LONG;
typedef uint8_t BOOLEAN;
typedef LONG *PLONG;
typedef unsigned char UCHAR;
typedef uint32_t DWORD;
typedef int BOOL, WINBOOL;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef float FLOAT;
typedef DWORD *LPDWORD;
typedef void *LPVOID;
typedef void *PVOID;
typedef const void *LPCVOID;
typedef int INT;
typedef unsigned int UINT;
typedef intptr_t INT_PTR, *PINT_PTR;
typedef intptr_t LONG_PTR, *PLONG_PTR;
typedef uintptr_t ULONG_PTR, *PULONG_PTR;
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
typedef CHAR *LPSTR;
typedef const CHAR *LPCSTR;
typedef uintptr_t DWORD_PTR, *PDWORD_PTR;
typedef uintptr_t WPARAM;
typedef LONG_PTR LPARAM;
typedef LONG_PTR LRESULT;
typedef uintptr_t LPARAM;
typedef uintptr_t LRESULT;
//
// Handles
//
typedef void *HANDLE;
typedef HANDLE HWND, HGDIOBJ, HMODULE, HDC, HRGN, HINSTANCE, HCURSOR;
typedef LONG LCID;
typedef HANDLE HWND, HMODULE, HDC, HINSTANCE;
typedef LRESULT(*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
@ -55,31 +40,17 @@ typedef struct _FILETIME {
DWORD dwHighDateTime;
} FILETIME, *LPFILETIME;
typedef struct tagPOINT {
LONG x;
LONG y;
} POINT;
typedef struct tagSIZE {
LONG cx;
LONG cy;
} SIZE;
typedef struct tagMSG {
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
} MSG, *LPMSG;
//
// Everything else
//
typedef void *LPSECURITY_ATTRIBUTES;
HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, WINBOOL bManualReset, WINBOOL bInitialState,
LPCSTR lpName);
HANDLE CreateEventA();
BOOL CloseEvent(HANDLE event);
void SetEvent(HANDLE hEvent);
void ResetEvent(HANDLE hEvent);
@ -90,22 +61,16 @@ void FocusOnCharInfo();
SHORT GetAsyncKeyState(int vKey);
WINBOOL PeekMessageA(LPMSG lpMsg);
bool PeekMessageA(LPMSG lpMsg);
WINBOOL TranslateMessage(const MSG *lpMsg);
bool TranslateMessage(const MSG *lpMsg);
LRESULT DispatchMessageA(const MSG *lpMsg);
WINBOOL PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam);
bool PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam);
uintptr_t DVL_beginthreadex(void *_Security, unsigned _StackSize, unsigned(*_StartAddress)(void *),
void *_ArgList, unsigned _InitFlag, unsigned *_ThrdAddr);
DWORD GetCurrentThreadId();
WINBOOL SetThreadPriority(HANDLE hThread, int nPriority);
//
// Total fakes
//
typedef struct {
} SOCKADDR;
bool SetThreadPriority(HANDLE hThread, int nPriority);
//
// MSCVRT emulation

2
SourceS/ui_fwd.h

@ -2,7 +2,7 @@
namespace dvl {
bool SpawnWindow(LPCSTR lpWindowName, int nWidth, int nHeight);
bool SpawnWindow(const char *lpWindowName, int nWidth, int nHeight);
void UiErrorOkDialog(const char *text, const char *caption, bool error = true);
} // namespace dvl

6
SourceX/DiabloUI/diabloui.cpp

@ -496,7 +496,7 @@ 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, LPSTR lpBuffer, int cchBufferMax)
BOOL UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, char *lpBuffer, int cchBufferMax)
{
UNIMPLEMENTED();
}
@ -506,12 +506,12 @@ BOOL UiSoundCallback(int a1, int type, int a3)
UNIMPLEMENTED();
}
void UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType)
void UiMessageBoxCallback(HWND hWnd, char *lpText, const char *lpCaption, UINT uType)
{
UNIMPLEMENTED();
}
BOOL UiDrawDescCallback(int game_type, DWORD color, LPCSTR lpString, char *a4, int a5, UINT align, time_t a7,
BOOL UiDrawDescCallback(int game_type, DWORD color, const char *lpString, char *a4, int a5, UINT align, time_t a7,
HDC *a8)
{
UNIMPLEMENTED();

2
SourceX/display.cpp

@ -43,7 +43,7 @@ void InitVideoMode(int width, int height, int bpp, std::uint32_t flags)
} // namespace
bool SpawnWindow(LPCSTR lpWindowName, int nWidth, int nHeight)
bool SpawnWindow(const char *lpWindowName, int nWidth, int nHeight)
{
if (SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_HAPTIC) <= -1) {
ErrSdl();

8
SourceX/miniwin/misc_msg.cpp

@ -256,7 +256,7 @@ WPARAM keystate_for_mouse(WPARAM ret)
return ret;
}
WINBOOL false_avail(const char *name, int value)
bool false_avail(const char *name, int value)
{
SDL_Log("Unhandled SDL event: %s %d", name, value);
return true;
@ -342,7 +342,7 @@ bool BlurInventory()
return true;
}
WINBOOL PeekMessageA(LPMSG lpMsg)
bool PeekMessageA(LPMSG lpMsg)
{
#ifdef __SWITCH__
HandleDocking();
@ -623,7 +623,7 @@ WINBOOL PeekMessageA(LPMSG lpMsg)
return true;
}
WINBOOL TranslateMessage(const MSG *lpMsg)
bool TranslateMessage(const MSG *lpMsg)
{
if (lpMsg->message == DVL_WM_KEYDOWN) {
int key = lpMsg->wParam;
@ -763,7 +763,7 @@ LRESULT DispatchMessageA(const MSG *lpMsg)
return CurrentProc(NULL, lpMsg->message, lpMsg->wParam, lpMsg->lParam);
}
WINBOOL PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam)
bool PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam)
{
MSG msg;
msg.message = Msg;

19
SourceX/miniwin/thread.cpp

@ -57,7 +57,7 @@ DWORD GetCurrentThreadId()
return SDL_GetThreadID(NULL);
}
WINBOOL SetThreadPriority(HANDLE hThread, int nPriority)
bool SetThreadPriority(HANDLE hThread, int nPriority)
{
// SDL cannot set the priority of the non-current thread
// (and e.g. unprivileged processes on Linux cannot increase it)
@ -92,23 +92,8 @@ void DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
SDL_DestroyMutex(*((SDL_mutex **)lpCriticalSection));
}
HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, WINBOOL bManualReset, WINBOOL bInitialState,
LPCSTR lpName)
HANDLE CreateEventA()
{
if (lpName != NULL && !strcmp(lpName, "DiabloEvent")) {
// This is used by diablo.cpp to check whether
// the game is already running
// (we do not want to replicate this behaviour anyway)
return NULL;
}
if (lpEventAttributes != NULL)
UNIMPLEMENTED();
if (bManualReset != true)
UNIMPLEMENTED();
if (bInitialState != false)
UNIMPLEMENTED();
if (lpName != NULL)
UNIMPLEMENTED();
struct event_emul *ret;
ret = (struct event_emul *)malloc(sizeof(struct event_emul));
ret->mutex = SDL_CreateMutex();

Loading…
Cancel
Save