mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Die
This commit is contained in:
parent
7f58002e12
commit
c6769e7220
10 changed files with 17 additions and 84 deletions
|
@ -863,14 +863,7 @@ void HWR_LoadTextures(size_t pnumtextures)
|
|||
|
||||
void HWR_SetPalette(RGBA_t *palette)
|
||||
{
|
||||
//Hudler: 16/10/99: added for OpenGL gamma correction
|
||||
RGBA_t gamma_correction = {0x7F7F7F7F};
|
||||
|
||||
//Hurdler 16/10/99: added for OpenGL gamma correction
|
||||
gamma_correction.s.red = (UINT8)cv_grgammared.value;
|
||||
gamma_correction.s.green = (UINT8)cv_grgammagreen.value;
|
||||
gamma_correction.s.blue = (UINT8)cv_grgammablue.value;
|
||||
HWD.pfnSetPalette(palette, &gamma_correction);
|
||||
HWD.pfnSetPalette(palette);
|
||||
|
||||
// hardware driver will flush there own cache if cache is non paletized
|
||||
// now flush data texture cache so 32 bit texture are recomputed
|
||||
|
|
|
@ -40,9 +40,9 @@ EXPORT void HWRAPI(Shutdown) (void);
|
|||
EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes);
|
||||
#endif
|
||||
#if defined (PURESDL) || defined (macintosh)
|
||||
EXPORT void HWRAPI(SetPalette) (INT32 *, RGBA_t *gamma);
|
||||
EXPORT void HWRAPI(SetPalette) (INT32 *);
|
||||
#else
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal);
|
||||
#endif
|
||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
||||
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||
|
|
|
@ -89,9 +89,6 @@ extern consvar_t cv_grfog;
|
|||
extern consvar_t cv_grfogcolor;
|
||||
extern consvar_t cv_grfogdensity;
|
||||
extern consvar_t cv_grsoftwarefog;
|
||||
extern consvar_t cv_grgammared;
|
||||
extern consvar_t cv_grgammagreen;
|
||||
extern consvar_t cv_grgammablue;
|
||||
extern consvar_t cv_grfiltermode;
|
||||
extern consvar_t cv_granisotropicmode;
|
||||
extern consvar_t cv_grcorrecttricks;
|
||||
|
|
|
@ -564,15 +564,15 @@ EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl)
|
|||
// : in OpenGL, we store values for conversion of paletted graphics when
|
||||
// : they are downloaded to the 3D card.
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *pal, RGBA_t *gamma)
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *pal)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
myPaletteData[i].s.red = (UINT8)MIN((pal[i].s.red*gamma->s.red)/127, 255);
|
||||
myPaletteData[i].s.green = (UINT8)MIN((pal[i].s.green*gamma->s.green)/127, 255);
|
||||
myPaletteData[i].s.blue = (UINT8)MIN((pal[i].s.blue*gamma->s.blue)/127, 255);
|
||||
myPaletteData[i].s.red = pal[i].s.red;
|
||||
myPaletteData[i].s.green = pal[i].s.green;
|
||||
myPaletteData[i].s.blue = pal[i].s.blue;
|
||||
myPaletteData[i].s.alpha = pal[i].s.alpha;
|
||||
}
|
||||
|
||||
|
|
37
src/m_menu.c
37
src/m_menu.c
|
@ -309,7 +309,7 @@ static void M_ChangeControl(INT32 choice);
|
|||
// Video & Sound
|
||||
menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef;
|
||||
#ifdef HWRENDER
|
||||
menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef;
|
||||
menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef;
|
||||
#endif
|
||||
menu_t OP_SoundOptionsDef;
|
||||
menu_t OP_SoundAdvancedDef;
|
||||
|
@ -355,7 +355,6 @@ static void M_DrawScreenshotMenu(void);
|
|||
static void M_DrawMonitorToggles(void);
|
||||
#ifdef HWRENDER
|
||||
static void M_OGL_DrawFogMenu(void);
|
||||
static void M_OGL_DrawColorMenu(void);
|
||||
#endif
|
||||
#ifndef NONET
|
||||
static void M_DrawScreenshotMenu(void);
|
||||
|
@ -1314,7 +1313,6 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
|
|||
{IT_SUBMENU|IT_STRING, NULL, "Lighting...", &OP_OpenGLLightingDef, 100},
|
||||
#endif
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 110},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 120},
|
||||
};
|
||||
|
||||
#ifdef ALAM_LIGHTING
|
||||
|
@ -1334,13 +1332,6 @@ static menuitem_t OP_OpenGLFogMenu[] =
|
|||
{IT_STRING|IT_CVAR, NULL, "Fog density", &cv_grfogdensity, 30},
|
||||
{IT_STRING|IT_CVAR, NULL, "Software Fog",&cv_grsoftwarefog,40},
|
||||
};
|
||||
|
||||
static menuitem_t OP_OpenGLColorMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "red", &cv_grgammared, 10},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "green", &cv_grgammagreen, 20},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "blue", &cv_grgammablue, 30},
|
||||
};
|
||||
#endif
|
||||
|
||||
static menuitem_t OP_SoundOptionsMenu[] =
|
||||
|
@ -2027,18 +2018,6 @@ menu_t OP_OpenGLFogDef =
|
|||
0,
|
||||
NULL
|
||||
};
|
||||
menu_t OP_OpenGLColorDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12) + (MN_OP_OPENGL_COLOR << 18),
|
||||
"M_VIDEO",
|
||||
sizeof (OP_OpenGLColorMenu)/sizeof (menuitem_t),
|
||||
&OP_OpenGLOptionsDef,
|
||||
OP_OpenGLColorMenu,
|
||||
M_OGL_DrawColorMenu,
|
||||
60, 40,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6),
|
||||
|
@ -11931,20 +11910,6 @@ static void M_OGL_DrawFogMenu(void)
|
|||
my + currentMenu->menuitems[FOG_COLOR_ITEM].alphaKey, '_' | 0x80,false);
|
||||
}
|
||||
|
||||
// =====================
|
||||
// M_OGL_DrawColorMenu()
|
||||
// =====================
|
||||
static void M_OGL_DrawColorMenu(void)
|
||||
{
|
||||
INT32 mx, my;
|
||||
|
||||
mx = currentMenu->x;
|
||||
my = currentMenu->y;
|
||||
M_DrawGenericMenu(); // use generic drawer for cursor, items and title
|
||||
V_DrawString(mx, my + currentMenu->menuitems[0].alphaKey - 10,
|
||||
V_YELLOWMAP, "Gamma correction");
|
||||
}
|
||||
|
||||
//===================
|
||||
// M_HandleFogColor()
|
||||
//===================
|
||||
|
|
|
@ -1211,9 +1211,6 @@ void R_RegisterEngineStuff(void)
|
|||
|
||||
#ifdef HWRENDER
|
||||
// GL-specific Commands
|
||||
CV_RegisterVar(&cv_grgammablue);
|
||||
CV_RegisterVar(&cv_grgammagreen);
|
||||
CV_RegisterVar(&cv_grgammared);
|
||||
CV_RegisterVar(&cv_grfovchange);
|
||||
CV_RegisterVar(&cv_grfog);
|
||||
CV_RegisterVar(&cv_grfogcolor);
|
||||
|
|
|
@ -222,17 +222,15 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
|||
HWR_DrawScreenFinalTexture(realwidth, realheight);
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette, RGBA_t *pgamma)
|
||||
EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette)
|
||||
{
|
||||
INT32 i = -1;
|
||||
UINT32 redgamma = pgamma->s.red, greengamma = pgamma->s.green,
|
||||
bluegamma = pgamma->s.blue;
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
myPaletteData[i].s.red = (UINT8)MIN((palette[i].s.red * redgamma) /127, 255);
|
||||
myPaletteData[i].s.green = (UINT8)MIN((palette[i].s.green * greengamma)/127, 255);
|
||||
myPaletteData[i].s.blue = (UINT8)MIN((palette[i].s.blue * bluegamma) /127, 255);
|
||||
myPaletteData[i].s.red = palette[i].s.red;
|
||||
myPaletteData[i].s.green = palette[i].s.green;
|
||||
myPaletteData[i].s.blue = palette[i].s.blue;
|
||||
myPaletteData[i].s.alpha = palette[i].s.alpha;
|
||||
}
|
||||
Flush();
|
||||
|
|
|
@ -31,5 +31,5 @@ extern Uint16 realwidth;
|
|||
extern Uint16 realheight;
|
||||
|
||||
#ifdef _CREATE_DLL_
|
||||
EXPORT void HWRAPI( OglSdlSetPalette ) (RGBA_t *palette, RGBA_t *pgamma);
|
||||
EXPORT void HWRAPI( OglSdlSetPalette ) (RGBA_t *palette);
|
||||
#endif
|
||||
|
|
|
@ -85,11 +85,9 @@ static void CV_constextsize_OnChange(void);
|
|||
consvar_t cv_constextsize = {"con_textsize", "Medium", CV_SAVE|CV_CALL, constextsize_cons_t, CV_constextsize_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef HWRENDER
|
||||
static void CV_Gammaxxx_ONChange(void);
|
||||
// Saved hardware mode variables
|
||||
// - You can change them in software,
|
||||
// but they won't do anything.
|
||||
static CV_PossibleValue_t grgamma_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t grsoftwarefog_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "LightPlanes"}, {0, NULL}};
|
||||
static CV_PossibleValue_t grmodelinterpolation_cons_t[] = {{0, "Off"}, {1, "Sometimes"}, {2, "Always"}, {0, NULL}};
|
||||
|
||||
|
@ -97,12 +95,7 @@ consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, N
|
|||
consvar_t cv_grfog = {"gr_fog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grfogcolor = {"gr_fogcolor", "AAAAAA", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grsoftwarefog = {"gr_softwarefog", "Off", CV_SAVE, grsoftwarefog_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grgammared = {"gr_gammared", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grgammagreen = {"gr_gammagreen", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grgammablue = {"gr_gammablue", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef ALAM_LIGHTING
|
||||
consvar_t cv_grdynamiclighting = {"gr_dynamiclighting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grstaticlighting = {"gr_staticlighting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -473,16 +466,6 @@ static void CV_palette_OnChange(void)
|
|||
V_SetPalette(0);
|
||||
}
|
||||
|
||||
// change the palette directly to see the change
|
||||
#ifdef HWRENDER
|
||||
static void CV_Gammaxxx_ONChange(void)
|
||||
{
|
||||
if (rendermode != render_soft && rendermode != render_none)
|
||||
V_SetPalette(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (__GNUC__) && defined (__i386__) && !defined (NOASM) && !defined (__APPLE__) && !defined (NORUSEASM)
|
||||
void VID_BlitLinearScreen_ASM(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT32 height, size_t srcrowbytes,
|
||||
size_t destrowbytes);
|
||||
|
|
|
@ -98,7 +98,7 @@ static loadfunc_t hwdFuncTable[] = {
|
|||
{"Init@4", &hwdriver.pfnInit},
|
||||
{"Shutdown@0", &hwdriver.pfnShutdown},
|
||||
{"GetModeList@8", &hwdriver.pfnGetModeList},
|
||||
{"SetPalette@8", &hwdriver.pfnSetPalette},
|
||||
{"SetPalette@4", &hwdriver.pfnSetPalette},
|
||||
{"FinishUpdate@4", &hwdriver.pfnFinishUpdate},
|
||||
{"Draw2DLine@12", &hwdriver.pfnDraw2DLine},
|
||||
{"DrawPolygon@16", &hwdriver.pfnDrawPolygon},
|
||||
|
@ -110,7 +110,7 @@ static loadfunc_t hwdFuncTable[] = {
|
|||
{"GClipRect@20", &hwdriver.pfnGClipRect},
|
||||
{"ClearMipMapCache@0", &hwdriver.pfnClearMipMapCache},
|
||||
{"SetSpecialState@8", &hwdriver.pfnSetSpecialState},
|
||||
{"DrawModel@16", &hwdriver.pfnDrawModel},
|
||||
{"DrawModel@16", &hwdriver.pfnDrawModel},
|
||||
{"SetTransform@4", &hwdriver.pfnSetTransform},
|
||||
{"GetTextureUsed@0", &hwdriver.pfnGetTextureUsed},
|
||||
{"GetRenderVersion@0", &hwdriver.pfnGetRenderVersion},
|
||||
|
|
Loading…
Reference in a new issue