Change fires to a more visually-appealing red-orange color. Looks *killer*

Add -brighten arg to GL targets, to replace -gamma but still look nice.
"-brighten 2.5" brightens the palette by 2.5 times, to give a similar
effect to the brightness cvar, but without the dithering brightness
gives. This is a palette hack, which means it _can't_ be a cvar.
This commit is contained in:
Jeff Teunissen 2000-10-28 07:11:37 +00:00
parent 718544d190
commit 5bb2a9002c
9 changed files with 54 additions and 10 deletions

View file

@ -289,7 +289,7 @@ void GL_Set2D (void);
//
// gl_rmain.c
//
void GL_CheckGamma (unsigned char *pal);
void GL_CheckBrightness (unsigned char *pal);
//qboolean R_CullBox (vec3_t mins, vec3_t maxs);
void R_RotateForEntity (entity_t *e);

View file

@ -353,7 +353,7 @@ static void CD_f (void)
Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
else if (wasPlaying)
Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
Con_Printf("Volume is %f\n", cdvolume);
Con_Printf("Volume is %g\n", cdvolume);
return;
}
}

View file

@ -81,7 +81,7 @@ cvar_t *Cvar_FindAlias (char *alias_name)
void Cvar_Alias_Get (char *name, cvar_t *cvar)
{
cvar_alias_t *alias;
cvar_t *var;
cvar_t *var;
if (Cmd_Exists (name))
{

View file

@ -662,8 +662,8 @@ void R_DrawParticles (void)
Nifty ball of fire GL effect. Kinda a meshing of the dlight and
particle engine code.
*/
float r_firecolor_flame[3]={0.9,0.7,0.3};
float r_firecolor_light[3]={0.9,0.7,0.3};
float r_firecolor_flame[3]={0.9,0.4,0};
float r_firecolor_light[3]={0.9,0.4,0};
void
R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
@ -835,7 +835,7 @@ R_FireColor_f (void)
int i;
if (Cmd_Argc() == 1) {
Con_Printf ("r_firecolor %f %f %f\n",
Con_Printf ("r_firecolor %g %g %g\n",
r_firecolor_flame[0],
r_firecolor_flame[1],
r_firecolor_flame[2]);

View file

@ -127,6 +127,43 @@ void glrmain_init()
{
};
/*
GL_CheckBrightness
This is something like the brightness cvar, except it hacks the palette
directly instead of brightening the screen afterward.
*/
void
GL_CheckBrightness (unsigned char *pal)
{
int i, inf;
float brightness;
if ((i = COM_CheckParm ("-brighten"))) {
brightness = atof (com_argv[i + 1]);
brightness = bound (1, brightness, 5);
} else {
brightness = 1.0;
}
// Build gamma table
if (brightness == 1.0) { // screw the math
for (i = 0; i < 256; i++) {
gammatable[i] = i;
}
} else {
for (i = 0; i < 256; i++) { // brighten up the palette
inf = (i * brightness);
inf = bound (0, inf, 255);
gammatable[i] = inf;
}
}
// correct the palette
for (i = 0; i < 768; i++) {
pal[i] = gammatable[pal[i]];
}
}
/*
=================

View file

@ -261,6 +261,7 @@ GL_Init_Common (void)
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
CheckMultiTextureExtensions ();
}
/*

View file

@ -198,6 +198,7 @@ VID_Init (unsigned char *palette)
GL_Init ();
GL_CheckBrightness (palette);
VID_SetPalette (palette);
// Check for 8-bit extension and initialize if present

View file

@ -108,7 +108,7 @@ GL_Init (void)
void
GL_EndRendering (void)
{
glFlush();
glFlush ();
SDL_GL_SwapBuffers ();
}
@ -182,12 +182,14 @@ VID_Init (unsigned char *palette)
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
vid.numpages = 2;
#ifndef WIN32
InitSig (); // trap evil signals
#endif
GL_Init();
GL_CheckBrightness (palette);
VID_SetPalette (palette);
// Check for 3DFX Extensions and initialize them.
@ -197,6 +199,7 @@ VID_Init (unsigned char *palette)
scr_width, scr_height);
vid_initialized = true;
#ifdef WIN32
// FIXME: EVIL thing - but needed for win32 until we get
// SDL_sound ready - without this DirectSound fails.
@ -211,9 +214,9 @@ VID_SetCaption (char *text)
{
if (text && *text) {
char *temp = strdup (text);
SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, temp), NULL);
SDL_WM_SetCaption (va ("%s %s: %s", PROGRAM, VERSION, temp), NULL);
free (temp);
} else {
SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL);
SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL);
}
}

View file

@ -705,7 +705,8 @@ void GL_EndRendering (void)
Sbar_Changed();
}
void VID_SetPalette (unsigned char *palette)
void
VID_SetPalette (unsigned char *palette)
{
byte *pal;
unsigned int r,g,b;
@ -1787,6 +1788,7 @@ void VID_Init (unsigned char *palette)
DestroyWindow (hwnd_dialog);
GL_CheckBrightness (palette);
VID_SetPalette (palette);
VID_SetMode (vid_default, palette);