Flares again

This commit is contained in:
Andrei Drexler 2003-09-19 00:54:23 +00:00
parent af614743f9
commit 461277b8b0
7 changed files with 45 additions and 30 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.75 2003/09/19 00:54:23 makro
// Flares again
//
// Revision 1.74 2003/09/17 23:49:29 makro
// Lens flares. Opendoor trigger_multiple fixes
//
@ -2658,6 +2661,5 @@ void CG_DrawActive(stereoFrame_t stereoView)
CG_Draw2D();
//Makro - lens flare
if (cgs.numFlares)
CG_AddLensFlare();
CG_AddLensFlare();
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.143 2003/09/19 00:54:23 makro
// Flares again
//
// Revision 1.142 2003/09/18 19:05:10 makro
// Lens flares
//
@ -2272,7 +2275,7 @@ static void CG_RegisterGraphics(void)
//Makro - lens flare shaders
for (i=0; i<NUM_FLARE_SHADERS; i++)
cgs.media.flareShader[i] = trap_R_RegisterShaderNoMip(va("gfx/2d/flare%.2d", i+1));
cgs.media.flareShader[i] = trap_R_RegisterShaderNoMip(va("gfx/2d/flare%02d", i+1));
cgs.media.sunFlareShader = trap_R_RegisterShaderNoMip("gfx/2d/sunflare");
// register all the server specified models

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.77 2003/09/19 00:54:23 makro
// Flares again
//
// Revision 1.76 2003/09/18 19:05:10 makro
// Lens flares
//
@ -449,7 +452,6 @@ static void CG_ParseWarmup(void)
//Makro - sky portal and lens flare
void CG_ParseSkyPortal(const char *str)
{
int n;
//sky portal
if (str && str[0] && Q_stricmp(str, "none")) {
cgs.skyPortalOrigin[0] = atof(Info_ValueForKey(str, "x"));
@ -460,12 +462,12 @@ void CG_ParseSkyPortal(const char *str)
cgs.skyPortalSet = qfalse;
}
//lens flare
n = atoi(Info_ValueForKey(str, "ln"));
if (n > 0) {
cgs.sunFlareSize = atoi(Info_ValueForKey(str, "lsun"));
cgs.numFlares = atoi(Info_ValueForKey(str, "ln"));
if (cgs.sunFlareSize > 0 || cgs.numFlares > 0) {
float alphamin, alphamax, sizemin, sizemax, dfactor = 0.75f;
int i;
cgs.numFlares = n;
cgs.sunDir[0] = atof(Info_ValueForKey(str, "lx"));
cgs.sunDir[1] = atof(Info_ValueForKey(str, "ly"));
cgs.sunDir[2] = atof(Info_ValueForKey(str, "lz"));
@ -473,7 +475,6 @@ void CG_ParseSkyPortal(const char *str)
alphamax = Com_Clamp(0.0f, 1.0f, atof(Info_ValueForKey(str, "lamax")));
sizemin = atof(Info_ValueForKey(str, "lsmin"));
sizemax = atof(Info_ValueForKey(str, "lsmax"));
cgs.sunFlareSize = atoi(Info_ValueForKey(str, "lsun"));
cgs.sunAlpha = Com_Clamp(0.0f, 1.0f, atof(Info_ValueForKey(str, "lsa")));
//generate flare parms

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.40 2003/09/19 00:54:23 makro
// Flares again
//
// Revision 1.39 2003/09/18 19:05:10 makro
// Lens flares
//
@ -1020,6 +1023,9 @@ void CG_AddLensFlare()
int i, timeDelta = 0;
qboolean visible = qfalse;
if (cgs.numFlares <= 0 && (cgs.sunFlareSize <= 0 || cgs.sunAlpha == 0))
return;
VectorCopy(cgs.sunDir, dir);
dp[0] = DotProduct(dir, cg.refdef.viewaxis[0]);
dp[1] = DotProduct(dir, cg.refdef.viewaxis[1]);
@ -1038,12 +1044,6 @@ void CG_AddLensFlare()
if ((tr.surfaceFlags & SURF_SKY) || tr.fraction == 1.0f)
{
//get the screen co-ordinates of the sun
//cx = (1.0f - (float)(y + hfovx)/cg.refdef.fov_x) * 640;
//cy = (1.0f - (float)(p + hfovy)/cg.refdef.fov_y) * 480;
//cx = 320 * (1 - dp[1] / sin(hfovx * PI180));
//cy = 240 * (1 - dp[2] / sin(hfovy * PI180));
//cx = 320 * (1 - (float)yaw / hfovx);
//cy = 240 * (1 - (float)pitch / hfovy);
cx = 320 * (1.0f - dp[1] / (cos(yaw * PI180) * tan(hfovx * PI180)));
cy = 240 * (1.0f - dp[2] / (cos(pitch * PI180) * tan(hfovy * PI180)));
cgs.lastSunX = cx;
@ -1073,7 +1073,7 @@ void CG_AddLensFlare()
color[3] *= fade;
}
//sun
if (cgs.sunFlareSize > 0) {
if (cgs.sunFlareSize > 0 && cgs.sunAlpha > 0) {
size = cgs.sunFlareSize * fovFactor;
hsize = size/2;
trap_R_SetColor(color);

View file

@ -6,13 +6,16 @@
--------------------Configuration: cgame - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2CC.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP33F.tmp" with contents
[
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"Release/" /Fp"Release/cgame.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
"C:\Games\Quake3\rq3source\reaction\cgame\cg_draw.c"
"C:\Games\Quake3\rq3source\reaction\cgame\cg_main.c"
"C:\Games\Quake3\rq3source\reaction\cgame\cg_servercmds.c"
"C:\Games\Quake3\rq3source\reaction\cgame\cg_view.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2CC.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2CD.tmp" with contents
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP33F.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP340.tmp" with contents
[
/nologo /base:"0x30000000" /subsystem:windows /dll /incremental:no /pdb:"Release/cgamex86.pdb" /map:"Release/cgamex86.map" /machine:I386 /def:".\cgame.def" /out:"../Release/cgamex86.dll" /implib:"Release/cgamex86.lib"
.\Release\bg_misc.obj
@ -43,13 +46,16 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2CD.tmp" with conte
.\Release\q_shared.obj
.\Release\ui_shared.obj
]
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2CD.tmp"
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP340.tmp"
<h3>Output Window</h3>
Compiling...
cg_draw.c
cg_main.c
cg_servercmds.c
cg_view.c
Linking...
Creating library Release/cgamex86.lib and object Release/cgamex86.exp
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2D1.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP344.tmp" with contents
[
/nologo /o"Release/cgame.bsc"
.\Release\bg_misc.sbr
@ -79,7 +85,7 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2D1.tmp" with conte
.\Release\q_math.sbr
.\Release\q_shared.sbr
.\Release\ui_shared.sbr]
Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2D1.tmp"
Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP344.tmp"
Creating browse info file...
<h3>Output Window</h3>

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.80 2003/09/19 00:53:14 makro
// Flares again
//
// Revision 1.79 2003/09/18 19:08:40 makro
// Lens flares
//
@ -462,8 +465,8 @@ void Think_SetupFlare(gentity_t *ent)
void SP_misc_lens_flare(gentity_t *ent)
{
float f;
if (ent->count <= 0) {
G_Printf(S_COLOR_YELLOW"Warning: misc_lens_flare with count <=0 at %s\n", vtos(ent->s.origin));
if (ent->count < 0) {
G_Printf(S_COLOR_YELLOW"Warning: misc_lens_flare with count <0 at %s\n", vtos(ent->s.origin));
ent->count = 4;
}
G_SpawnInt("minsize", "16", &ent->damage);

View file

@ -6,13 +6,13 @@
--------------------Configuration: game - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2E8.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP314.tmp" with contents
[
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"c:\reactionoutput/" /Fp"c:\reactionoutput/game.pch" /YX /Fo"c:\reactionoutput/" /Fd"c:\reactionoutput/" /FD /c
"C:\Games\Quake3\rq3source\reaction\game\g_mover.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2E8.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2E9.tmp" with contents
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP314.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP315.tmp" with contents
[
kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"c:\reactionoutput/qagamex86.pdb" /map:"c:\reactionoutput/qagamex86.map" /machine:I386 /def:".\game.def" /out:"..\Release/qagamex86.dll" /implib:"c:\reactionoutput/qagamex86.lib"
\reactionoutput\ai_chat.obj
@ -56,13 +56,13 @@ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows
\reactionoutput\zcam.obj
\reactionoutput\zcam_target.obj
]
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2E9.tmp"
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP315.tmp"
<h3>Output Window</h3>
Compiling...
g_mover.c
Linking...
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2ED.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP319.tmp" with contents
[
/nologo /o"c:\reactionoutput/game.bsc"
\reactionoutput\ai_chat.sbr
@ -105,7 +105,7 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2ED.tmp" with conte
\reactionoutput\rxn_game.sbr
\reactionoutput\zcam.sbr
\reactionoutput\zcam_target.sbr]
Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2ED.tmp"
Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP319.tmp"
Creating browse info file...
<h3>Output Window</h3>