From ed4c9d6e0199cb390f8b19e300120550814ff539 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 24 Oct 2008 09:20:38 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1114 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 25 ++++++++++++++++++++++--- polymer/eduke32/build/src/sdlayer.c | 27 ++++++++++++++++----------- polymer/eduke32/build/src/winlayer.c | 8 ++++---- polymer/eduke32/source/game.c | 12 ------------ polymer/eduke32/source/osdcmds.c | 2 +- 5 files changed, 43 insertions(+), 31 deletions(-) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index f56e9eb2f..cd60fe364 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -896,18 +896,37 @@ void resizeglcheck() if ((glox1 != windowx1) || (gloy1 != windowy1) || (glox2 != windowx2) || (gloy2 != windowy2)) { + double ratio = 1.0; + + if (glwidescreen == 1) + ratio = 1.2f; + else if (glprojectionhacks == 1) + { + if (gshang > 0) + ratio += gshang*0.33f; + if (gshang < 0) + ratio += -gshang*0.33f; + } + else if (glprojectionhacks == 2) + { + if (gshang > 0.7f) + ratio += 4.f*(gshang-0.7f); + if (gshang < -0.7f) + ratio += 4.f*(-gshang-0.7f); + } + glox1 = windowx1; gloy1 = windowy1; glox2 = windowx2; gloy2 = windowy2; - fovcorrect = glprojectionhacks?(glwidescreen?0:(((windowx2-windowx1+1) * 1.2) - (windowx2-windowx1+1))):0; + fovcorrect = glprojectionhacks?(glwidescreen?0:(((windowx2-windowx1+1) * ratio) - (windowx2-windowx1+1))):0; bglViewport(windowx1 - (fovcorrect / 2), yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect, windowy2-windowy1+1); bglMatrixMode(GL_PROJECTION); memset(m,0,sizeof(m)); - m[0][0] = (float)ydimen / (glprojectionhacks?1.2:1); m[0][2] = 1.0; + m[0][0] = (float)ydimen / (glprojectionhacks?ratio:1.f); m[0][2] = 1.0; m[1][1] = (float)xdimen; m[1][2] = 1.0; - m[2][2] = 1.0; m[2][3] = (float)ydimen / (glprojectionhacks?1.2:1); + m[2][2] = 1.0; m[2][3] = (float)ydimen / (glprojectionhacks?ratio:1.f); m[3][2] =-1.0; bglLoadMatrixf(&m[0][0]); //bglLoadIdentity(); diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index ca272a9fe..cd6fe0e15 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -390,9 +390,13 @@ int initinput(void) // force OS X to operate in >1 button mouse mode so that LMB isn't adulterated if (!getenv("SDL_HAS3BUTTONMOUSE")) putenv("SDL_HAS3BUTTONMOUSE=1"); #endif - if (!remapinit)for (i=0;i<256;i++)remap[i]=i;remapinit=1; + if (!remapinit) + for (i=0;i<256;i++) + remap[i]=i; + remapinit=1; - if (SDL_EnableKeyRepeat(250, 30)) initprintf("Error enabling keyboard repeat.\n"); + if (SDL_EnableKeyRepeat(250, 30)) // doesn't do anything in 1.3 + initprintf("Error enabling keyboard repeat.\n"); inputdevices = 1|2; // keyboard (1) and mouse (2) mouseacquired = 0; @@ -791,11 +795,12 @@ void getvalidmodes(void) pf.BitsPerPixel = cdepths[j]; pf.BytesPerPixel = cdepths[j] >> 3; + modes = SDL_ListModes(&pf, SURFACE_FLAGS #if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) - modes = SDL_ListModes(&pf, SURFACE_FLAGS | SDL_FULLSCREEN); -#else - modes = SDL_ListModes(&pf, SURFACE_FLAGS); + | SDL_FULLSCREEN // not implemented/working in SDL 1.3 SDL_compat.c #endif + ); + if (modes == (SDL_Rect **)0) { if (cdepths[j] > 8) cdepths[j] = -1; @@ -806,7 +811,7 @@ void getvalidmodes(void) { for (i=0; defaultres[i][0]; i++) ADDMODE(defaultres[i][0],defaultres[i][1],cdepths[j],1) - } + } else { for (i=0; modes[i]; i++) @@ -872,7 +877,7 @@ int checkvideomode(int *x, int *y, int c, int fs, int forced) if (*y < 200) *y = 200; if (*x > MAXXDIM) *x = MAXXDIM; if (*y > MAXYDIM) *y = MAXYDIM; - *x &= 0xfffffff8l; +// *x &= 0xfffffff8l; for (i=0; i MAXXDIM) *x = MAXXDIM; if (*y > MAXYDIM) *y = MAXYDIM; - *x &= 0xfffffff8l; +// *x &= 0xfffffff8l; for (i=0; i 230 || ud.camerahoriz < -50)) - { - for (y=0; y<(ydim>>2); y+=tilesizy[dapicnum]) - for (x=0; x= 8 && ud.statusbarmode == 0) { diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index da864be7f..96ff6ba45 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -752,7 +752,7 @@ cvarmappings cvar[] = #if defined(POLYMOST) && defined(USE_OPENGL) { "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 0, 1 }, - { "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_BOOL, 0, 0, 1 }, + { "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_INT, 0, 0, 2 }, # ifdef POLYMER // polymer cvars { "pr_occlusionculling", "pr_occlusionculling: insert description that noone will ever read", (void*)&pr_occlusionculling, CVAR_INT, 0, 0, 512 },