Browse Source

Drop unimplemented code

pull/289/head^2
Anders Jenbo 7 years ago
parent
commit
e88e574c5f
  1. 10
      Source/appfat.cpp
  2. 2
      Source/init.cpp
  3. 38
      Source/pfile.cpp
  4. 16
      SourceS/miniwin/misc.h
  5. 3
      SourceS/miniwin/misc_macro.h
  6. 5
      SourceX/DiabloUI/diabloui.cpp
  7. 77
      SourceX/miniwin/misc.cpp
  8. 85
      SourceX/storm/storm.cpp
  9. 9
      SourceX/storm/storm_net.cpp

10
Source/appfat.cpp

@ -274,16 +274,6 @@ void FileErrDlg(const char *error)
app_fatal(NULL);
}
void DiskFreeDlg(char *error)
{
FreeDlg();
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)error) == -1)
app_fatal("DiskFreeDlg");
app_fatal(NULL);
}
BOOL InsertCDDlg()
{
int nResult;

2
Source/init.cpp

@ -55,8 +55,6 @@ void init_create_window(int nCmdShow)
int nWidth, nHeight;
HWND hWnd;
pfile_init_save_directory();
if (GetSystemMetrics(SM_CXSCREEN) < SCREEN_WIDTH)
nWidth = SCREEN_WIDTH;
else

38
Source/pfile.cpp

@ -15,44 +15,6 @@ DEVILUTION_BEGIN_NAMESPACE
static char hero_names[MAX_CHARACTERS][PLR_NAME_LEN];
BOOL gbValidSaveFile;
void pfile_init_save_directory()
{
char Buffer[MAX_PATH];
pfile_check_available_space(Buffer);
GetPrefPath(Buffer, MAX_PATH);
pfile_check_available_space(Buffer);
}
void pfile_check_available_space(char *pszDir)
{
char *s;
BOOL hasSpace;
DWORD TotalNumberOfClusters;
DWORD NumberOfFreeClusters;
DWORD BytesPerSector;
DWORD SectorsPerCluster;
s = pszDir;
while (*s) {
if (*s++ != '\\')
continue;
*s = '\0';
break;
}
hasSpace = GetDiskFreeSpace(pszDir, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters);
if (hasSpace) {
// 10MB is the amount hardcoded in the error dialog
if ((__int64)SectorsPerCluster * BytesPerSector * NumberOfFreeClusters < (__int64)(10 << 20))
hasSpace = FALSE;
}
if (!hasSpace)
DiskFreeDlg(pszDir);
}
void pfile_write_hero()
{
DWORD save_num;

16
SourceS/miniwin/misc.h

@ -221,17 +221,10 @@ BOOL InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase);
BOOL UpdateWindow(HWND hWnd);
BOOL ShowWindow(HWND hWnd, int nCmdShow);
int GetSystemMetrics(int nIndex);
HGDIOBJ GetStockObject(int i);
BOOL GetUserNameA(LPSTR lpBuffer, LPDWORD pcbBuffer);
void GetLocalTime(LPSYSTEMTIME lpSystemTime);
long __cdecl _findfirst(const char *, struct DVL_finddata_t *);
int __cdecl _findnext(long, struct DVL_finddata_t *);
typedef LONG(WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
struct _EXCEPTION_POINTERS *ExceptionInfo);
HMODULE GetModuleHandleA(LPCSTR lpModuleName);
uintptr_t __cdecl DVL_beginthreadex(void *_Security, unsigned _StackSize, unsigned(__stdcall *_StartAddress)(void *),
void *_ArgList, unsigned _InitFlag, unsigned *_ThrdAddr);
HANDLE WINAPI GetCurrentThread();
@ -376,9 +369,6 @@ BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation);
void lstrcpynA(LPSTR lpString1, LPCSTR lpString2, int iMaxLength);
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
int MessageBoxA(HWND hWnd, const char *Text, const char *Title, UINT Flags);
typedef LONG LSTATUS, HKEY, REGSAM, PHKEY;
@ -401,8 +391,6 @@ WINBOOL WINAPI ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRea
LPOVERLAPPED lpOverlapped);
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
UINT GetDriveTypeA(LPCSTR lpRootPathName);
WINBOOL WINAPI GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
WINBOOL WINAPI GetComputerNameA(LPSTR lpBuffer, LPDWORD nSize);
WINBOOL WINAPI DeleteFileA(LPCSTR lpFileName);
@ -513,10 +501,6 @@ typedef struct _MEMORY_BASIC_INFORMATION {
typedef struct {
} SOCKADDR;
BOOL IsBadReadPtr(const void *lp, UINT_PTR ucb);
BOOL IsBadWritePtr(LPVOID lp, UINT_PTR ucb);
SIZE_T VirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
//
// MSCVRT emulation
//

3
SourceS/miniwin/misc_macro.h

@ -23,9 +23,7 @@
#define PostMessage PostMessageA
#define CreateWindowEx CreateWindowExA
#define RegisterClassEx RegisterClassExA
#define GetUserName GetUserNameA
#define LoadImage LoadImageA
#define GetModuleHandle GetModuleHandleA
#define THREAD_BASE_PRIORITY_MAX 2
#define THREAD_PRIORITY_NORMAL 0
@ -111,7 +109,6 @@
#define FindFirstFile FindFirstFileA
#define CreateFile CreateFileA
#define GetDriveType GetDriveTypeA
#define GetDiskFreeSpace GetDiskFreeSpaceA
#define GetComputerName GetComputerNameA
#define DeleteFile DeleteFileA

5
SourceX/DiabloUI/diabloui.cpp

@ -497,11 +497,6 @@ void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, DWORD type)
pInfo->spawned);
}
BOOL UiCopyProtError(int *pdwResult)
{
UNIMPLEMENTED();
}
void UiAppActivate(BOOL bActive)
{
DUMMY();

77
SourceX/miniwin/misc.cpp

@ -97,16 +97,6 @@ WINBOOL FindClose(HANDLE hFindFile)
return true;
}
WINBOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters)
{
*lpBytesPerSector = 1;
*lpSectorsPerCluster = 1;
*lpNumberOfFreeClusters = 10 << 20;
*lpTotalNumberOfClusters = 10 << 20;
return true;
}
WINBOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD nSize)
{
DUMMY();
@ -285,73 +275,6 @@ int GetSystemMetrics(int nIndex)
return 0;
}
/**
* @brief Used for getting a black brush
*/
HGDIOBJ GetStockObject(int i)
{
return NULL;
}
BOOL IsBadReadPtr(const void *lp, UINT_PTR ucb)
{
UNIMPLEMENTED();
return true;
}
BOOL IsBadWritePtr(LPVOID lp, UINT_PTR ucb)
{
UNIMPLEMENTED();
return true;
}
SIZE_T VirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength)
{
UNIMPLEMENTED();
return false;
}
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
UNIMPLEMENTED();
return NULL;
}
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
{
UNIMPLEMENTED();
return false;
}
void GetLocalTime(LPSYSTEMTIME lpSystemTime)
{
UNIMPLEMENTED();
}
long _findfirst(const char *pattern, struct DVL_finddata_t *finder)
{
DUMMY();
return -1;
}
int _findnext(long, struct DVL_finddata_t *finder)
{
UNIMPLEMENTED();
return -1;
}
HMODULE GetModuleHandleA(LPCSTR lpModuleName)
{
UNIMPLEMENTED();
return NULL;
}
BOOL GetUserNameA(LPSTR lpBuffer, LPDWORD pcbBuffer)
{
UNIMPLEMENTED();
return false;
}
int GetDeviceCaps(HDC hdc, int index)
{
SDL_DisplayMode current;

85
SourceX/storm/storm.cpp

@ -57,16 +57,6 @@ void TranslateFileName(char *dst, int dstLen, const char *src)
}
}
// BOOL SFileCloseArchive(HANDLE hArchive)
// {
// UNIMPLEMENTED();
// }
// BOOL SFileCloseFile(HANDLE hFile)
// {
// UNIMPLEMENTED();
// }
BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove,
signed __int32 volume, signed int pan, int a7)
{
@ -128,17 +118,6 @@ BOOL SFileGetFileArchive(HANDLE hFile, HANDLE *archive)
return true;
}
// LONG SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
// {
// UNIMPLEMENTED();
// }
// BOOL SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE
// *phMpq)
// {
// UNIMPLEMENTED();
// }
// Converts ASCII characters to lowercase
// Converts slash (0x2F) / backslash (0x5C) to system file-separator
unsigned char AsciiToLowerTable_Path[256] = {
@ -194,18 +173,6 @@ BOOL SFileOpenFile(const char *filename, HANDLE *phFile)
return result;
}
// BOOL SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE
// *phFile)
// {
// UNIMPLEMENTED();
// }
// BOOL SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read,
// LONG lpDistanceToMoveHigh)
// {
// UNIMPLEMENTED();
// }
BOOL SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *dwHeight, DWORD *pdwBpp)
{
HANDLE hFile;
@ -323,23 +290,12 @@ BOOL SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffe
return true;
}
// int SFileSetFilePointer(HANDLE, int, HANDLE, int)
// {
// UNIMPLEMENTED();
// }
HWND SDrawGetFrameWindow(HWND *sdraw_framewindow)
{
DUMMY();
return NULL;
}
// BOOL SDrawManualInitialize(HWND hWnd, LPDIRECTDRAW ddInterface, LPDIRECTDRAWSURFACE
// primarySurface, LPDIRECTDRAWSURFACE surface2, LPDIRECTDRAWSURFACE surface3, LPDIRECTDRAWSURFACE
// backSurface, LPDIRECTDRAWPALETTE ddPalette, HPALETTE hPalette)
//{
// UNIMPLEMENTED();
//}
void *SMemAlloc(unsigned int amount, char *logfilename, int logline, int defaultValue)
{
// fprintf(stderr, "%s: %d (%s:%d)\n", __FUNCTION__, amount, logfilename, logline);
@ -355,11 +311,6 @@ BOOL SMemFree(void *location, char *logfilename, int logline, char defaultValue)
return true;
}
void *SMemReAlloc(void *location, unsigned int amount, char *logfilename, int logline, char defaultValue)
{
UNIMPLEMENTED();
}
bool getIniValue(const char *sectionName, const char *keyName, char *string, int stringSize, int *dataSize)
{
radon::Section *section = ini.getSection(sectionName);
@ -837,12 +788,6 @@ BOOL SVidPlayEnd(HANDLE video)
return true;
}
BOOL SErrDisplayError(DWORD dwErrMsg, const char *logfilename, int logline, const char *message,
BOOL allowOption, int exitCode)
{
UNIMPLEMENTED();
}
BOOL SErrGetErrorStr(DWORD dwErrCode, char *buffer, unsigned int bufferchars)
{
DUMMY();
@ -859,42 +804,12 @@ void SErrSetLastError(DWORD dwErrCode)
nLastError = dwErrCode;
}
void SMemCopy(void *dest, const void *source, unsigned int size)
{
UNIMPLEMENTED();
}
void SMemFill(void *location, unsigned int length, char fillWith)
{
UNIMPLEMENTED();
}
void SMemZero(void *location, DWORD length)
{
UNIMPLEMENTED();
}
int SMemCmp(void *location1, void *location2, DWORD size)
{
UNIMPLEMENTED();
}
int SStrCopy(char *dest, const char *src, int max_length)
{
strncpy(dest, src, max_length);
return strlen(dest);
}
int SStrCmp(const char *string1, const char *string2, unsigned int size)
{
UNIMPLEMENTED();
}
int SStrCmpI(const char *string1, const char *string2, unsigned int size)
{
UNIMPLEMENTED();
}
void SDrawMessageBox(char *Text, char *Title, int Flags)
{
MessageBoxA(NULL, Text, Title, Flags);

9
SourceX/storm/storm_net.cpp

@ -150,13 +150,4 @@ BOOL SNetPerformUpgrade(DWORD *upgradestatus)
UNIMPLEMENTED();
}
/**
* @brief not called from engine
*/
BOOL SNetSetGameMode(DWORD modeFlags, bool makePublic)
{
UNIMPLEMENTED();
return true;
}
}

Loading…
Cancel
Save