From e11f4c9afb9f18cb342668addf8e8444df708564 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 8 Dec 2006 16:45:12 +0000 Subject: [PATCH] Better alt-tab support for fullscreen OpenGL on win32 git-svn-id: https://svn.eduke32.com/eduke32@391 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/winlayer.c | 24 ++++++++++++++++++++++-- polymer/eduke32/source/anim.c | 10 +++------- polymer/eduke32/source/game.c | 4 ++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/polymer/build/src/winlayer.c b/polymer/build/src/winlayer.c index 04d942ac8..5115ad9aa 100644 --- a/polymer/build/src/winlayer.c +++ b/polymer/build/src/winlayer.c @@ -114,7 +114,7 @@ char videomodereset = 0; // input and events char inputdevices=0; -char quitevent=0, appactive=1; +char quitevent=0, appactive=1, realfs=0; long mousex=0, mousey=0, mouseb=0; static unsigned long mousewheel[2] = { 0,0 }; #define MouseWheelFakePressTime (25) // getticks() is a 1000Hz timer, and the button press is faked for 100ms @@ -3504,12 +3504,32 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA break; case WM_ACTIVATEAPP: + { appactive = wParam; +#if defined(POLYMOST) && defined(USE_OPENGL) + if (hGLWindow) + { + if (!appactive && fullscreen) + { + realfs = fullscreen; + setvideomode(xdim,ydim,bpp,!fullscreen); + ShowWindow(hWindow, SW_MINIMIZE); + } + else if (appactive && realfs) + { + ShowWindow(hWindow, SW_SHOWNORMAL); + SetForegroundWindow(hWindow); + SetFocus(hWindow); + setvideomode(xdim,ydim,bpp,realfs); + realfs = 0; + } + } +#endif if (backgroundidle) SetPriorityClass( GetCurrentProcess(), appactive ? NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS ); break; - + } case WM_ACTIVATE: if (desktopbpp <= 8) { if (appactive) { diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index deeb8fbc5..8c4f88dc9 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -235,13 +235,6 @@ void playanm(char *fn,char t) palptr = ANIM_GetPalette(); for (i=0;i<256;i++) { - /* - j = (i<<2); k = j-i; - tempbuf[j+0] = (palptr[k+2]>>2); - tempbuf[j+1] = (palptr[k+1]>>2); - tempbuf[j+2] = (palptr[k+0]>>2); - tempbuf[j+3] = 0; - */ j = i*3; animpal[j+0] = (palptr[j+0]>>2); animpal[j+1] = (palptr[j+1]>>2); @@ -264,7 +257,10 @@ void playanm(char *fn,char t) handleevents(); getpackets(); if (restorepalette == 1) + { setgamepalette(&ps[myconnectindex],animpal,2); + restorepalette = 0; + } } if (t == 10) ototalclock += 14; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index dfb7c7129..9f1084d4b 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9603,6 +9603,10 @@ void app_main(int argc,char **argv) } #endif +#ifdef RENDERTYPEWIN + backgroundidle = 0; +#endif + OSD_SetLogFile("eduke32.log"); wm_setapptitle(HEAD2);