mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@1114 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1a7365826c
commit
ed4c9d6e01
5 changed files with 43 additions and 31 deletions
|
@ -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();
|
||||
|
|
|
@ -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<validmodecnt; i++)
|
||||
{
|
||||
|
@ -1509,14 +1514,14 @@ int handleevents(void)
|
|||
{
|
||||
SetKey(code, 1);
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[code], 1);
|
||||
keypresscallback(code, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetKey(code, 0);
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[code], 0);
|
||||
keypresscallback(code, 0);
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT:
|
||||
|
@ -1589,14 +1594,14 @@ int handleevents(void)
|
|||
{
|
||||
SetKey(code, 1);
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[code], 1);
|
||||
keypresscallback(code, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetKey(code, 0);
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[code], 0);
|
||||
keypresscallback(code, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -1183,7 +1183,7 @@ void releaseallbuttons(void)
|
|||
//if (OSD_HandleKey(i, 0) != 0) {
|
||||
OSD_HandleScanCode(i, 0);
|
||||
SetKey(i, 0);
|
||||
if (keypresscallback) keypresscallback(remap[i], 0);
|
||||
if (keypresscallback) keypresscallback(i, 0);
|
||||
//}
|
||||
}
|
||||
lastKeyDown = lastKeyTime = 0;
|
||||
|
@ -1721,7 +1721,7 @@ static void ProcessInputDevices(void)
|
|||
SetKey(k, (didod[i].dwData & 0x80) == 0x80);
|
||||
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[k], (didod[i].dwData & 0x80) == 0x80);
|
||||
keypresscallback(k, (didod[i].dwData & 0x80) == 0x80);
|
||||
}
|
||||
|
||||
if (((lastKeyDown & 0x7fffffffl) == k) && !(didod[i].dwData & 0x80))
|
||||
|
@ -2085,7 +2085,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<validmodecnt; i++)
|
||||
{
|
||||
|
@ -4237,7 +4237,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
|||
SetKey(0x59, 1);
|
||||
|
||||
if (keypresscallback)
|
||||
keypresscallback(remap[0x59], 1);
|
||||
keypresscallback(0x59, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -4134,18 +4134,6 @@ void drawbackground(void)
|
|||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64+128,0,windowy2,xdim-1,y2-1);
|
||||
}
|
||||
|
||||
// this is better than the HOM
|
||||
if (getrendermode() == 3 && (ud.camerahoriz > 230 || ud.camerahoriz < -50))
|
||||
{
|
||||
for (y=0; y<(ydim>>2); y+=tilesizy[dapicnum])
|
||||
for (x=0; x<xdim; x+=tilesizx[dapicnum])
|
||||
{
|
||||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64+128,0,0,xdim-1,ydim-1);
|
||||
rotatesprite(x<<16,(ydim-y-tilesizy[dapicnum])<<16,65536L,0,dapicnum,8,0,8+16+64+128,0,0,xdim-1,ydim-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// draw in the bits to the left and right of the non-fullsize status bar
|
||||
if (ud.statusbarscale < 100 && ud.screen_size >= 8 && ud.statusbarmode == 0)
|
||||
{
|
||||
|
|
|
@ -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 },
|
||||
|
|
Loading…
Reference in a new issue