X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=vid_wgl.c;h=7a4840886f0165fae39591890a582419c42a50a7;hb=d8767499b46a431a0dd5de4a744a56a669e9e3ce;hp=b9aadeb387ef4db604146a9c937c41ca3b83158f;hpb=3732b64a7c0a7f5000f00deaabb8fd2d372e9d8a;p=xonotic%2Fdarkplaces.git diff --git a/vid_wgl.c b/vid_wgl.c index b9aadeb3..7a484088 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -321,7 +321,7 @@ void VID_Finish (void) // without this help Sleep(0); - VID_UpdateGamma(false, 256); + VID_UpdateGamma(); } //========================================================================== @@ -429,7 +429,7 @@ ClearAllStates */ static void ClearAllStates (void) { - Key_ClearStates (); + Key_ReleaseAll(); if (vid_usingmouse) mouse_oldbuttonstate = 0; } @@ -498,7 +498,6 @@ void AppActivate(BOOL fActive, BOOL minimize) ChangeDisplaySettings (NULL, CDS_FULLSCREEN); vid_wassuspended = true; } - VID_RestoreSystemGamma(); } } @@ -567,8 +566,8 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case WM_MOVE: - window_x = (int) LOWORD(lParam); - window_y = (int) HIWORD(lParam); + window_x = (short) LOWORD(lParam); + window_y = (short) HIWORD(lParam); VID_SetMouse(false, false, false); break; @@ -711,32 +710,6 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return lRet; } -int VID_SetGamma(unsigned short *ramps, int rampsize) -{ - if (qwglMakeCurrent) - { - HDC hdc = GetDC (NULL); - int i = SetDeviceGammaRamp(hdc, ramps); - ReleaseDC (NULL, hdc); - return i; // return success or failure - } - else - return 0; -} - -int VID_GetGamma(unsigned short *ramps, int rampsize) -{ - if (qwglMakeCurrent) - { - HDC hdc = GetDC (NULL); - int i = GetDeviceGammaRamp(hdc, ramps); - ReleaseDC (NULL, hdc); - return i; // return success or failure - } - else - return 0; -} - static void GL_CloseLibrary(void) { if (gldll) @@ -1328,11 +1301,11 @@ static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_m { int CenterX, CenterY; - rect.top = 0; - rect.left = 0; - rect.right = width; - rect.bottom = height; - AdjustWindowRectEx(&rect, WindowStyle, false, 0); + rect->top = 0; + rect->left = 0; + rect->right = *width; + rect->bottom = *height; + AdjustWindowRectEx(rect, WindowStyle, false, 0); if (fullscreen) { @@ -1349,29 +1322,29 @@ static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_m // if height/width matches physical screen height/width, adjust it to available desktop size // and allow 2 pixels on top for the title bar so the window can be moved const int titleBarPixels = 2; - if (width == GetSystemMetrics(SM_CXSCREEN) && (height == GetSystemMetrics(SM_CYSCREEN) || height == workHeight - titleBarPixels)) + if (*width == GetSystemMetrics(SM_CXSCREEN) && (*height == GetSystemMetrics(SM_CYSCREEN) || *height == workHeight - titleBarPixels)) { - rect.right -= width - workWidth; - width = mode->width = workWidth; - rect.bottom -= height - (workHeight - titleBarPixels); - height = mode->height = workHeight - titleBarPixels; + rect->right -= *width - workWidth; + *width = mode->width = workWidth; + rect->bottom -= *height - (workHeight - titleBarPixels); + *height = mode->height = workHeight - titleBarPixels; CenterX = 0; CenterY = titleBarPixels; } else { - CenterX = max(0, (workWidth - width) / 2); - CenterY = max(0, (workHeight - height) / 2); + CenterX = max(0, (workWidth - *width) / 2); + CenterY = max(0, (workHeight - *height) / 2); } } // x and y may be changed by WM_MOVE messages window_x = CenterX; window_y = CenterY; - rect.left += CenterX; - rect.right += CenterX; - rect.top += CenterY; - rect.bottom += CenterY; + rect->left += CenterX; + rect->right += CenterX; + rect->top += CenterY; + rect->bottom += CenterY; } #ifdef SUPPORTD3D @@ -1870,7 +1843,6 @@ void VID_Shutdown (void) VID_EnableJoystick(false); VID_SetMouse(false, false, false); - VID_RestoreSystemGamma(); vid_initialized = false; isgl = gldll != NULL;