mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-18 13:21:16 +00:00
Fix config app (#89)
This commit is contained in:
parent
7fa7643bfb
commit
c6107bdb5b
@ -130,8 +130,8 @@ struct CMenu {
|
|||||||
|
|
||||||
struct CWinApp {
|
struct CWinApp {
|
||||||
CWinApp();
|
CWinApp();
|
||||||
virtual ~CWinApp();
|
virtual ~CWinApp() = default;
|
||||||
virtual BOOL InitInstance();
|
virtual BOOL InitInstance() = 0;
|
||||||
virtual int ExitInstance();
|
virtual int ExitInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -188,10 +188,7 @@ inline int GetSystemMetrics(int nIndex)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline BOOL GetVersionEx(OSVERSIONINFOA* version)
|
BOOL GetVersionEx(OSVERSIONINFOA* version);
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GlobalMemoryStatus(MEMORYSTATUS* memory_status);
|
void GlobalMemoryStatus(MEMORYSTATUS* memory_status);
|
||||||
|
|
||||||
|
|||||||
@ -21,20 +21,13 @@ CWinApp::CWinApp()
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
wndTop = this;
|
wndTop = this;
|
||||||
}
|
|
||||||
|
|
||||||
CWinApp::~CWinApp() = default;
|
|
||||||
|
|
||||||
BOOL CWinApp::InitInstance()
|
|
||||||
{
|
|
||||||
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)) {
|
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)) {
|
||||||
SDL_Log("SDL_Init: %s\n", SDL_GetError());
|
SDL_Log("SDL_Init: %s\n", SDL_GetError());
|
||||||
return FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = SDL_CreateWindow(title, 640, 480, 0);
|
window = SDL_CreateWindow(title, 640, 480, 0);
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CWinApp::ExitInstance()
|
int CWinApp::ExitInstance()
|
||||||
@ -73,9 +66,7 @@ int main(int argc, char* argv[])
|
|||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No CWinApp created");
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No CWinApp created");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
if (!wndTop->InitInstance()) {
|
wndTop->InitInstance();
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "CWinApp::InitInstance failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
bool running = true;
|
bool running = true;
|
||||||
@ -137,6 +128,15 @@ BOOL GetWindowRect(HWND hWnd, RECT* Rect)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL GetVersionEx(OSVERSIONINFOA* version)
|
||||||
|
{
|
||||||
|
version->dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
|
||||||
|
version->dwMajorVersion = 5; // Win2k/XP
|
||||||
|
version->dwPlatformId = 2; // NT
|
||||||
|
version->dwBuildNumber = 0x500;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void OutputDebugString(const char* lpOutputString)
|
void OutputDebugString(const char* lpOutputString)
|
||||||
{
|
{
|
||||||
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "%s", lpOutputString);
|
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "%s", lpOutputString);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user