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