|
@@ -748,14 +748,15 @@ static void FindResolutions()
|
|
|
}
|
|
|
|
|
|
_num_resolutions = n;
|
|
|
SortResolutions(_num_resolutions);
|
|
|
}
|
|
|
|
|
|
static FVideoDriver_Win32 iFVideoDriver_Win32;
|
|
|
|
|
|
static const char *Win32GdiStart(const char * const *parm)
|
|
|
const char *VideoDriver_Win32::Start(const char * const *parm)
|
|
|
{
|
|
|
memset(&_wnd, 0, sizeof(_wnd));
|
|
|
|
|
|
RegisterWndClass();
|
|
|
|
|
|
MakePalette();
|
|
@@ -771,25 +772,25 @@ static const char *Win32GdiStart(const c
|
|
|
|
|
|
MakeWindow(_fullscreen);
|
|
|
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
static void Win32GdiStop()
|
|
|
void VideoDriver_Win32::Stop()
|
|
|
{
|
|
|
DeleteObject(_wnd.gdi_palette);
|
|
|
DeleteObject(_wnd.dib_sect);
|
|
|
DestroyWindow(_wnd.main_wnd);
|
|
|
|
|
|
#if !defined(WINCE)
|
|
|
if (_wnd.fullscreen) ChangeDisplaySettings(NULL, 0);
|
|
|
#endif
|
|
|
MyShowCursor(true);
|
|
|
}
|
|
|
|
|
|
static void Win32GdiMakeDirty(int left, int top, int width, int height)
|
|
|
void VideoDriver_Win32::MakeDirty(int left, int top, int width, int height)
|
|
|
{
|
|
|
RECT r = { left, top, left + width, top + height };
|
|
|
|
|
|
InvalidateRect(_wnd.main_wnd, &r, FALSE);
|
|
|
}
|
|
|
|
|
@@ -797,13 +798,13 @@ static void CheckPaletteAnim()
|
|
|
{
|
|
|
if (_pal_count_dirty == 0)
|
|
|
return;
|
|
|
InvalidateRect(_wnd.main_wnd, NULL, FALSE);
|
|
|
}
|
|
|
|
|
|
static void Win32GdiMainLoop()
|
|
|
void VideoDriver_Win32::MainLoop()
|
|
|
{
|
|
|
MSG mesg;
|
|
|
uint32 cur_ticks = GetTickCount();
|
|
|
uint32 last_cur_ticks = cur_ticks;
|
|
|
uint32 next_tick = cur_ticks + 30;
|
|
|
|
|
@@ -870,29 +871,20 @@ static void Win32GdiMainLoop()
|
|
|
DrawTextMessage();
|
|
|
DrawMouseCursor();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static bool Win32GdiChangeRes(int w, int h)
|
|
|
bool VideoDriver_Win32::ChangeResolution(int w, int h)
|
|
|
{
|
|
|
_wnd.width = _wnd.width_org = w;
|
|
|
_wnd.height = _wnd.height_org = h;
|
|
|
|
|
|
MakeWindow(_fullscreen); // _wnd.fullscreen screws up ingame resolution switching
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
static void Win32GdiFullScreen(bool full_screen)
|
|
|
void VideoDriver_Win32::ToggleFullscreen(bool full_screen)
|
|
|
{
|
|
|
MakeWindow(full_screen);
|
|
|
}
|
|
|
|
|
|
const HalVideoDriver _win32_video_driver = {
|
|
|
Win32GdiStart,
|
|
|
Win32GdiStop,
|
|
|
Win32GdiMakeDirty,
|
|
|
Win32GdiMainLoop,
|
|
|
Win32GdiChangeRes,
|
|
|
Win32GdiFullScreen,
|
|
|
};
|