mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
Partially fixes bug #3034382 and a few other ones.
git-svn-id: https://svn.eduke32.com/eduke32@1679 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c825727234
commit
a1a5f9cb5a
6 changed files with 70 additions and 23 deletions
|
@ -47,6 +47,8 @@ extern char somethingintab;
|
||||||
|
|
||||||
extern uint8_t buildkeys[NUMBUILDKEYS];
|
extern uint8_t buildkeys[NUMBUILDKEYS];
|
||||||
|
|
||||||
|
extern double vid_gamma_3d, vid_contrast_3d, vid_brightness_3d;
|
||||||
|
|
||||||
extern int32_t ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
extern int32_t ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
||||||
extern int32_t unrealedlook, quickmapcycling;
|
extern int32_t unrealedlook, quickmapcycling;
|
||||||
extern int32_t pk_turnaccel,pk_turndecel,pk_uedaccel;
|
extern int32_t pk_turnaccel,pk_turndecel,pk_uedaccel;
|
||||||
|
|
|
@ -80,6 +80,10 @@ extern int32_t totalclocklock;
|
||||||
|
|
||||||
int32_t synctics = 0, lockclock = 0;
|
int32_t synctics = 0, lockclock = 0;
|
||||||
|
|
||||||
|
// those ones save the respective 3d video vars while in 2d mode
|
||||||
|
// so that exiting from mapster32 in 2d mode saves the correct ones
|
||||||
|
double vid_gamma_3d=-1, vid_contrast_3d=-1, vid_brightness_3d=-1;
|
||||||
|
|
||||||
extern char vgacompatible;
|
extern char vgacompatible;
|
||||||
|
|
||||||
extern char picsiz[MAXTILES];
|
extern char picsiz[MAXTILES];
|
||||||
|
@ -486,7 +490,10 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
if (cursectnum == -1)
|
if (cursectnum == -1)
|
||||||
{
|
{
|
||||||
double gamma = vid_gamma, brightness = vid_brightness, contrast = vid_contrast;
|
vid_gamma_3d = vid_gamma;
|
||||||
|
vid_brightness_3d = vid_brightness;
|
||||||
|
vid_contrast_3d = vid_contrast;
|
||||||
|
|
||||||
vid_gamma = vid_contrast = 1.0;
|
vid_gamma = vid_contrast = 1.0;
|
||||||
vid_brightness = 0.0;
|
vid_brightness = 0.0;
|
||||||
|
|
||||||
|
@ -500,9 +507,12 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
overheadeditor();
|
overheadeditor();
|
||||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||||
vid_gamma = gamma;
|
|
||||||
vid_contrast = contrast;
|
vid_gamma = vid_gamma_3d;
|
||||||
vid_brightness = brightness;
|
vid_contrast = vid_contrast_3d;
|
||||||
|
vid_brightness = vid_brightness_3d;
|
||||||
|
|
||||||
|
vid_gamma_3d = vid_contrast_3d = vid_brightness_3d = -1;
|
||||||
|
|
||||||
setbrightness(GAMMA_CALC,palette,0);
|
setbrightness(GAMMA_CALC,palette,0);
|
||||||
}
|
}
|
||||||
|
@ -1186,17 +1196,24 @@ void editinput(void)
|
||||||
if (keystatus[buildkeys[BK_MODE2D_3D]]) // Enter
|
if (keystatus[buildkeys[BK_MODE2D_3D]]) // Enter
|
||||||
{
|
{
|
||||||
|
|
||||||
double gamma = vid_gamma, contrast = vid_contrast, brightness = vid_brightness;
|
vid_gamma_3d = vid_gamma;
|
||||||
|
vid_contrast_3d = vid_contrast;
|
||||||
|
vid_brightness_3d = vid_brightness;
|
||||||
|
|
||||||
vid_gamma = vid_contrast = 1.0;
|
vid_gamma = vid_contrast = 1.0;
|
||||||
vid_brightness = 0.0;
|
vid_brightness = 0.0;
|
||||||
|
|
||||||
setbrightness(0,palette,0);
|
setbrightness(0,palette,0);
|
||||||
|
|
||||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||||
overheadeditor();
|
overheadeditor();
|
||||||
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
keystatus[buildkeys[BK_MODE2D_3D]] = 0;
|
||||||
vid_gamma = gamma;
|
|
||||||
vid_contrast = contrast;
|
vid_gamma = vid_gamma_3d;
|
||||||
vid_brightness = brightness;
|
vid_contrast = vid_contrast_3d;
|
||||||
|
vid_brightness = vid_brightness_3d;
|
||||||
|
|
||||||
|
vid_gamma_3d = vid_contrast_3d = vid_brightness_3d = -1;
|
||||||
|
|
||||||
setbrightness(GAMMA_CALC,palette,0);
|
setbrightness(GAMMA_CALC,palette,0);
|
||||||
}
|
}
|
||||||
|
@ -1338,7 +1355,9 @@ void overheadeditor(void)
|
||||||
while ((keystatus[buildkeys[BK_MODE2D_3D]]>>1) == 0)
|
while ((keystatus[buildkeys[BK_MODE2D_3D]]>>1) == 0)
|
||||||
{
|
{
|
||||||
if (!((vel|angvel|svel) //DOWN_BK(MOVEFORWARD) || DOWN_BK(MOVEBACKWARD) || DOWN_BK(TURNLEFT) || DOWN_BK(TURNRIGHT)
|
if (!((vel|angvel|svel) //DOWN_BK(MOVEFORWARD) || DOWN_BK(MOVEBACKWARD) || DOWN_BK(TURNLEFT) || DOWN_BK(TURNRIGHT)
|
||||||
|| DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN) || bstatus || OSD_IsMoving()))
|
|| DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN)
|
||||||
|
|| keystatus[0x48] || keystatus[0x4b] || keystatus[0x4d] || keystatus[0x50] // keypad keys
|
||||||
|
|| bstatus || OSD_IsMoving()))
|
||||||
{
|
{
|
||||||
if (totalclock > waitdelay)
|
if (totalclock > waitdelay)
|
||||||
{
|
{
|
||||||
|
@ -1454,8 +1473,9 @@ void overheadeditor(void)
|
||||||
numwalls = newnumwalls;
|
numwalls = newnumwalls;
|
||||||
if (numwalls < 0) numwalls = tempint;
|
if (numwalls < 0) numwalls = tempint;
|
||||||
|
|
||||||
if ((getticks() - lastdraw) >= 5 || (vel|angvel|svel) || DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN) || mousx || mousy || bstatus ||
|
if ((getticks() - lastdraw) >= 5 || (vel|angvel|svel) || DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN)
|
||||||
newnumwalls>=0 || OSD_IsMoving())
|
|| mousx || mousy || bstatus
|
||||||
|
|| newnumwalls>=0 || OSD_IsMoving())
|
||||||
{
|
{
|
||||||
lastdraw = getticks();
|
lastdraw = getticks();
|
||||||
|
|
||||||
|
@ -2659,6 +2679,8 @@ SKIP:
|
||||||
pos.y = mousyplc;
|
pos.y = mousyplc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((oldmousebstatus&6) > 0)
|
||||||
|
updatesector(pos.x,pos.y,&cursectnum);
|
||||||
|
|
||||||
if (circlewall != -1 && (keystatus[0x4a] || ((bstatus&32) && !eitherCTRL))) // -
|
if (circlewall != -1 && (keystatus[0x4a] || ((bstatus&32) && !eitherCTRL))) // -
|
||||||
{
|
{
|
||||||
|
|
|
@ -490,7 +490,10 @@ int32_t writesetup(const char *fn)
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
maxrefreshfreq, windowpos, windowx, windowy,
|
maxrefreshfreq, windowpos, windowx, windowy,
|
||||||
#endif
|
#endif
|
||||||
vid_gamma, vid_brightness, vid_contrast, game_executable,
|
vid_gamma_3d>=0?vid_gamma_3d:vid_gamma,
|
||||||
|
vid_brightness_3d>=0?vid_brightness_3d:vid_brightness,
|
||||||
|
vid_contrast_3d>=0?vid_contrast_3d:vid_contrast,
|
||||||
|
game_executable,
|
||||||
#if 0
|
#if 0
|
||||||
option[7]>>4, option[2],
|
option[7]>>4, option[2],
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1332,11 +1332,18 @@ int32_t trytexcache(char *fn, int32_t len, int32_t dameth, char effect, texcache
|
||||||
if (i > -1)
|
if (i > -1)
|
||||||
{
|
{
|
||||||
texcacheindex *t = cacheptrs[i];
|
texcacheindex *t = cacheptrs[i];
|
||||||
len = t->len;
|
if (!t)
|
||||||
offset = t->offset;
|
i = -1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = t->len;
|
||||||
|
offset = t->offset;
|
||||||
|
}
|
||||||
/*initprintf("%s %d got a match for %s offset %d\n",__FILE__, __LINE__, cachefn,offset);*/
|
/*initprintf("%s %d got a match for %s offset %d\n",__FILE__, __LINE__, cachefn,offset);*/
|
||||||
}
|
}
|
||||||
else return -1; // didn't find it
|
|
||||||
|
if (i < 0)
|
||||||
|
return -1; // didn't find it
|
||||||
|
|
||||||
cachepos = offset;
|
cachepos = offset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,8 @@ definequote 30 PARALLAX BIAS: %f
|
||||||
definequote 31 SPECULAR FACTOR: %f
|
definequote 31 SPECULAR FACTOR: %f
|
||||||
definequote 32 SPECULAR POWER: %f
|
definequote 32 SPECULAR POWER: %f
|
||||||
|
|
||||||
|
definequote 33 PAL: %d
|
||||||
|
|
||||||
define PRSCALE 1000
|
define PRSCALE 1000
|
||||||
// NOTE: inline constants >=32768 are sometimes broken ATM (when loading a second time?).
|
// NOTE: inline constants >=32768 are sometimes broken ATM (when loading a second time?).
|
||||||
// This should always work
|
// This should always work
|
||||||
|
@ -649,16 +651,24 @@ onevent EVENT_ANALYZESPRITES
|
||||||
state tduprot
|
state tduprot
|
||||||
state tduplin
|
state tduplin
|
||||||
/*
|
/*
|
||||||
|
ife searchstat 3
|
||||||
for i drawnsprites
|
for i drawnsprites
|
||||||
{
|
{
|
||||||
set j tsprite[i].owner
|
ife tsprite[i].owner searchwall
|
||||||
switch sprite[j].picnum
|
{
|
||||||
case LIZTROOP spritepal 1 break
|
qsprintf TQUOTE 33 tsprite[i].pal
|
||||||
case PIGCOP spritepal 2 break
|
quote TQUOTE
|
||||||
case BOSS1 spritepal 6 break
|
break
|
||||||
endswitch
|
}
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// switch sprite[j].picnum
|
||||||
|
// case LIZTROOP spritepal 1 break
|
||||||
|
// case PIGCOP spritepal 2 break
|
||||||
|
// case BOSS1 spritepal 6 break
|
||||||
|
// endswitch
|
||||||
|
}
|
||||||
endevent
|
endevent
|
||||||
|
|
||||||
onevent EVENT_KEYS3D
|
onevent EVENT_KEYS3D
|
||||||
|
|
|
@ -5825,7 +5825,10 @@ static void Keys3d(void)
|
||||||
|
|
||||||
if (PRESSED_KEYSC(F11)) //F11 - brightness
|
if (PRESSED_KEYSC(F11)) //F11 - brightness
|
||||||
{
|
{
|
||||||
static int16_t brightness;
|
static int16_t brightness = -1;
|
||||||
|
|
||||||
|
if (brightness==-1)
|
||||||
|
brightness = ((int16_t)((vid_gamma-1.0)*10.0))&15;
|
||||||
|
|
||||||
brightness = brightness + (1-2*eitherSHIFT);
|
brightness = brightness + (1-2*eitherSHIFT);
|
||||||
brightness &= 15;
|
brightness &= 15;
|
||||||
|
|
Loading…
Reference in a new issue