Browse Source

Remove unimplemented functions that aren't needed with SDL

pull/340/head
Anders Jenbo 7 years ago
parent
commit
73a7a1ae6d
  1. 9
      Source/diablo.cpp
  2. 1
      Source/multi.cpp
  3. 1
      Source/objects.cpp
  4. 24
      Source/palette.cpp
  5. 3
      SourceS/miniwin/com_macro.h
  6. 5
      SourceS/miniwin/misc.h
  7. 2
      SourceX/DiabloUI/diabloui.cpp
  8. 30
      SourceX/miniwin/misc.cpp
  9. 6
      SourceX/storm/storm.cpp

9
Source/diablo.cpp

@ -495,25 +495,21 @@ LRESULT CALLBACK DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
case WM_LBUTTONDOWN:
if (sgbMouseDown == 0) {
sgbMouseDown = 1;
SetCapture(hWnd);
}
return 0;
case WM_LBUTTONUP:
if (sgbMouseDown == 1) {
sgbMouseDown = 0;
ReleaseCapture();
}
return 0;
case WM_RBUTTONDOWN:
if (sgbMouseDown == 0) {
sgbMouseDown = 2;
SetCapture(hWnd);
}
return 0;
case WM_RBUTTONUP:
if (sgbMouseDown == 2) {
sgbMouseDown = 0;
ReleaseCapture();
}
return 0;
case WM_CAPTURECHANGED:
@ -558,7 +554,6 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MouseY = HIWORD(lParam);
if (sgbMouseDown == 0) {
sgbMouseDown = 1;
SetCapture(hWnd);
track_repeat_walk(LeftMouseDown(wParam));
}
return 0;
@ -569,7 +564,6 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
sgbMouseDown = 0;
LeftMouseUp();
track_repeat_walk(FALSE);
ReleaseCapture();
}
return 0;
case WM_RBUTTONDOWN:
@ -577,7 +571,6 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MouseY = HIWORD(lParam);
if (sgbMouseDown == 0) {
sgbMouseDown = 2;
SetCapture(hWnd);
RightMouseDown();
}
return 0;
@ -586,7 +579,6 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
MouseY = HIWORD(lParam);
if (sgbMouseDown == 2) {
sgbMouseDown = 0;
ReleaseCapture();
}
return 0;
case WM_CAPTURECHANGED:
@ -611,7 +603,6 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
music_stop();
track_repeat_walk(FALSE);
sgbMouseDown = 0;
ReleaseCapture();
ShowProgress(uMsg);
drawpanflag = 255;
DrawAndBlit();

1
Source/multi.cpp

@ -702,7 +702,6 @@ BOOL NetInit(BOOL bSinglePlayer, BOOL *pfExitProgram)
plrdata.size = sizeof(plrdata);
memset(&UiData, 0, sizeof(UiData));
UiData.size = sizeof(UiData);
UiData.parentwindow = SDrawGetFrameWindow(NULL);
UiData.artcallback = (void (*)())UiArtCallback;
UiData.createcallback = (void (*)())UiCreateGameCallback;
UiData.drawdesccallback = (void (*)())UiDrawDescCallback;

1
Source/objects.cpp

@ -1534,7 +1534,6 @@ void Obj_Circle(int i)
AddMissile(plr[myplr].WorldX, plr[myplr].WorldY, 35, 46, plr[myplr]._pdir, MIS_RNDTELEPORT, 0, myplr, 0, 0);
track_repeat_walk(0);
sgbMouseDown = 0;
ReleaseCapture();
ClrPlrPath(myplr);
StartStand(myplr, 0);
}

24
Source/palette.cpp

@ -24,7 +24,6 @@ void palette_init()
{
LoadGamma();
memcpy(system_palette, orig_palette, sizeof(orig_palette));
LoadSysPal();
CreatePalette();
}
@ -48,29 +47,6 @@ void LoadGamma()
color_cycling_enabled = value;
}
void LoadSysPal()
{
HDC hDC;
int i, iStartIndex;
for (i = 0; i < 256; i++)
system_palette[i].peFlags = PC_NOCOLLAPSE | PC_RESERVED;
if (!fullscreen) {
gdwPalEntries = GetDeviceCaps(hDC, NUMRESERVED) / 2;
GetSystemPaletteEntries(hDC, 0, gdwPalEntries, system_palette);
for (i = 0; i < gdwPalEntries; i++)
system_palette[i].peFlags = 0;
iStartIndex = 256 - gdwPalEntries;
GetSystemPaletteEntries(hDC, iStartIndex, gdwPalEntries, &system_palette[iStartIndex]);
if (iStartIndex < 256) {
for (i = iStartIndex; i < 256; i++)
system_palette[i].peFlags = 0;
}
}
}
void LoadPalette(char *pszFileName)
{
int i;

3
SourceS/miniwin/com_macro.h

@ -8,8 +8,5 @@
#define DDBLTFAST_WAIT 0x00000010
#define PC_RESERVED 0x01
#define PC_NOCOLLAPSE 0x04
#define ERROR_SUCCESS DVL_ERROR_SUCCESS
#define DS_OK DVL_DS_OK

5
SourceS/miniwin/misc.h

@ -191,8 +191,6 @@ BOOL WINAPI ResetEvent(HANDLE hEvent);
int WINAPI WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);
WINBOOL WINAPI SetCursorPos(int X, int Y);
HWND WINAPI SetCapture(HWND hWnd);
WINBOOL WINAPI ReleaseCapture();
SHORT WINAPI GetAsyncKeyState(int vKey);
@ -216,9 +214,6 @@ void WINAPI Sleep(DWORD dwMilliseconds);
WINBOOL WINAPI TextOutA(HDC hdc, int x, int y, LPCSTR lpString, int c);
int WINAPI GetDeviceCaps(HDC hdc, int index);
UINT WINAPI GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LPPALETTEENTRY pPalEntries);
int WINAPIV wsprintfA(LPSTR, LPCSTR, ...);
int WINAPIV wvsprintfA(LPSTR dest, LPCSTR format, va_list arglist);
int __cdecl _strcmpi(const char *_Str1, const char *_Str2);

2
SourceX/DiabloUI/diabloui.cpp

@ -54,7 +54,6 @@ struct {
void UiDestroy()
{
DUMMY();
ArtHero.Unload();
UnloadTtfFont();
}
@ -369,7 +368,6 @@ char connect_plrinfostr[128];
char connect_categorystr[128];
void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, DWORD type)
{
DUMMY();
SStrCopy(connect_plrinfostr, infostr, 128);
char format[32] = "";
strncpy(format, (char *)&type, 4);

30
SourceX/miniwin/misc.cpp

@ -129,18 +129,6 @@ WINBOOL DeleteFileA(LPCSTR lpFileName)
return true;
}
HWND SetCapture(HWND hWnd)
{
DUMMY_ONCE();
return hWnd;
}
WINBOOL ReleaseCapture()
{
DUMMY_ONCE();
return true;
}
void FakeWMDestroy()
{
init_cleanup();
@ -224,24 +212,6 @@ bool SpawnWindow(LPCSTR lpWindowName, int nWidth, int nHeight)
return window != NULL;
}
int GetDeviceCaps(HDC hdc, int index)
{
SDL_DisplayMode current;
if (SDL_GetCurrentDisplayMode(0, &current) <= -1) {
SDL_Log(SDL_GetError());
return 0;
}
return 0;
}
UINT GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LPPALETTEENTRY pPalEntries)
{
DUMMY();
return 0;
}
BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation)
{
lpVersionInformation->dwMajorVersion = 5;

6
SourceX/storm/storm.cpp

@ -300,12 +300,6 @@ BOOL SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffe
return true;
}
HWND SDrawGetFrameWindow(HWND *sdraw_framewindow)
{
DUMMY();
return NULL;
}
void *SMemAlloc(unsigned int amount, char *logfilename, int logline, int defaultValue)
{
// fprintf(stderr, "%s: %d (%s:%d)\n", __FUNCTION__, amount, logfilename, logline);

Loading…
Cancel
Save