29 May 2010

This commit is contained in:
g-cont 2010-05-29 00:00:00 +04:00 committed by Alibek Omarov
parent fcf5b05e20
commit 6308bf1c6c
24 changed files with 250 additions and 83 deletions

16
baserc/baserc.plg Normal file
View File

@ -0,0 +1,16 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: baserc - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
baserc.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

16
bshift/bshift.plg Normal file
View File

@ -0,0 +1,16 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: bshift - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
server.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

75
client/client.plg Normal file
View File

@ -0,0 +1,75 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: client - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BB.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "../common" /I "global" /I "hud" /I "../game_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\client\!debug/" /Fo"..\temp\client\!debug/" /Fd"..\temp\client\!debug/" /FD /c
"D:\Xash3D\src_main\client\global\view.cpp"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BB.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BC.tmp" with contents
[
msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\client\!debug/client.pdb" /debug /machine:I386 /nodefaultlib:"libc.lib" /def:".\client.def" /out:"..\temp\client\!debug/client.dll" /implib:"..\temp\client\!debug/client.lib" /pdbtype:sept /libpath:"..\common\libs"
"\Xash3D\src_main\temp\client\!debug\aurora.obj"
"\Xash3D\src_main\temp\client\!debug\cl_tent.obj"
"\Xash3D\src_main\temp\client\!debug\dll_int.obj"
"\Xash3D\src_main\temp\client\!debug\ev_common.obj"
"\Xash3D\src_main\temp\client\!debug\ev_hldm.obj"
"\Xash3D\src_main\temp\client\!debug\hud.obj"
"\Xash3D\src_main\temp\client\!debug\hud_ammo.obj"
"\Xash3D\src_main\temp\client\!debug\hud_ammohistory.obj"
"\Xash3D\src_main\temp\client\!debug\hud_battery.obj"
"\Xash3D\src_main\temp\client\!debug\hud_death.obj"
"\Xash3D\src_main\temp\client\!debug\hud_flashlight.obj"
"\Xash3D\src_main\temp\client\!debug\hud_geiger.obj"
"\Xash3D\src_main\temp\client\!debug\hud_health.obj"
"\Xash3D\src_main\temp\client\!debug\hud_icons.obj"
"\Xash3D\src_main\temp\client\!debug\hud_menu.obj"
"\Xash3D\src_main\temp\client\!debug\hud_message.obj"
"\Xash3D\src_main\temp\client\!debug\hud_motd.obj"
"\Xash3D\src_main\temp\client\!debug\hud_msg.obj"
"\Xash3D\src_main\temp\client\!debug\hud_saytext.obj"
"\Xash3D\src_main\temp\client\!debug\hud_scoreboard.obj"
"\Xash3D\src_main\temp\client\!debug\hud_sound.obj"
"\Xash3D\src_main\temp\client\!debug\hud_statusbar.obj"
"\Xash3D\src_main\temp\client\!debug\hud_text.obj"
"\Xash3D\src_main\temp\client\!debug\hud_train.obj"
"\Xash3D\src_main\temp\client\!debug\hud_warhead.obj"
"\Xash3D\src_main\temp\client\!debug\hud_zoom.obj"
"\Xash3D\src_main\temp\client\!debug\input.obj"
"\Xash3D\src_main\temp\client\!debug\pm_shared.obj"
"\Xash3D\src_main\temp\client\!debug\r_beams.obj"
"\Xash3D\src_main\temp\client\!debug\r_particle.obj"
"\Xash3D\src_main\temp\client\!debug\r_tempents.obj"
"\Xash3D\src_main\temp\client\!debug\r_weather.obj"
"\Xash3D\src_main\temp\client\!debug\studio.obj"
"\Xash3D\src_main\temp\client\!debug\triapi.obj"
"\Xash3D\src_main\temp\client\!debug\utils.obj"
"\Xash3D\src_main\temp\client\!debug\view.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BC.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BD.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\client\!debug\client.dll "D:\Xash3D\bin\client.dll"
]
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP19BD.bat""
Compiling...
view.cpp
Linking...
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\client\!debug\client.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.
<h3>Results</h3>
client.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1453,7 +1453,7 @@ void CViewRenderBeams::DrawBeam( Beam_t *pbeam )
if( pbeam->attachment[0] == g_vecZero || pbeam->attachment[1] == g_vecZero )
{
pbeam->m_bCulled = true; // FIXME: hack
// pbeam->m_bCulled = true; // FIXME: hack
}

View File

@ -1093,22 +1093,13 @@ void V_CalcFirstPersonRefdef( ref_params_t *pparams )
//==========================
void V_CalcScreenBlend( ref_params_t *pparams )
{
if( !v_dark->integer ) return;
#if 0
// FIXME: get some code from q1
pparams->blend[0] = 0.0f;
pparams->blend[1] = 0.0f;
pparams->blend[2] = 0.0f;
pparams->blend[3] = 1.0f;
if( !pparams->paused && IN_GAME( ))
{
// HACKHACK
v_dark->integer++;
}
// make first 10 frames black then reset
if( v_dark->integer < 100 ) return;
CVAR_SET_FLOAT( "v_dark", 0.0f );
#endif
}
//==========================

View File

@ -148,6 +148,12 @@ int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
m_flStartDist = 0;
m_flEndDist = 0;
if( CVAR_GET_FLOAT( "v_dark" ))
{
SetScreenFade( Vector( 0, 0, 0 ), 255, 4, 4, FFADE_IN );
CVAR_SET_FLOAT( "v_dark", 0.0f );
}
return 1;
}
@ -173,7 +179,6 @@ int CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
pList->p->InitHUDData();
pList = pList->pNext;
}
return 1;
}
@ -444,7 +449,7 @@ int CHud :: MsgFunc_ScreenFade( const char *pszName, int iSize, void *pbuf )
int fadeFlags = READ_SHORT();
Vector m_FadeColor;
m_FadeColor.x = READ_BYTE(); // fade red
m_FadeColor.y = READ_BYTE(); // fade green
m_FadeColor.z = READ_BYTE(); // fade blue

View File

@ -182,6 +182,7 @@ void CM_DrawCollision( cmdraw_t callback );
byte *CM_LeafPVS( int leafnum );
byte *CM_LeafPHS( int leafnum );
int CM_PointLeafnum( const vec3_t p );
cleaf_t *CM_PointInLeaf( const vec3_t p, cnode_t *node );
bool CM_HeadnodeVisible( int nodenum, byte *visbits );
int CM_BoxLeafnums( const vec3_t mins, const vec3_t maxs, short *list, int listsize, int *lastleaf );
model_t CM_TempBoxModel( const vec3_t mins, const vec3_t maxs, bool capsule );

View File

@ -179,7 +179,7 @@ CM_LeafPVS
*/
byte *CM_LeafPVS( int leafnum )
{
if( !worldmodel || leafnum < 0 || leafnum >= worldmodel->numleafs || !cm.pvs )
if( !worldmodel || leafnum <= 0 || leafnum >= worldmodel->numleafs || !cm.pvs )
return cm.nullrow;
return worldmodel->leafs[leafnum].visdata;
@ -193,7 +193,7 @@ CM_LeafPHS
*/
byte *CM_LeafPHS( int leafnum )
{
if( !worldmodel || leafnum < 0 || leafnum >= worldmodel->numleafs || !cm.phs )
if( !worldmodel || leafnum <= 0 || leafnum >= worldmodel->numleafs || !cm.phs )
return cm.nullrow;
return worldmodel->leafs[leafnum].pasdata;

View File

@ -32,11 +32,11 @@ int CM_BoxOnPlaneSide( const vec3_t emins, const vec3_t emaxs, const cplane_t *p
/*
==================
CM_PointLeafnum_r
CM_PointInLeaf
==================
*/
int CM_PointLeafnum_r( const vec3_t p, cnode_t *node )
cleaf_t *CM_PointInLeaf( const vec3_t p, cnode_t *node )
{
cleaf_t *leaf;
@ -45,14 +45,14 @@ int CM_PointLeafnum_r( const vec3_t p, cnode_t *node )
node = node->children[(node->plane->type < 3 ? p[node->plane->type] : DotProduct(p, node->plane->normal)) < node->plane->dist];
leaf = (cleaf_t *)node;
return leaf - worldmodel->leafs - 1;
return leaf;
}
int CM_PointLeafnum( const vec3_t p )
{
// map not loaded
if ( !worldmodel ) return 0;
return CM_PointLeafnum_r( p, worldmodel->nodes );
return CM_PointInLeaf( p, worldmodel->nodes ) - worldmodel->leafs;
}
@ -259,6 +259,6 @@ void CM_AmbientLevels( const vec3_t p, byte *pvolumes )
if( !worldmodel || !p || !pvolumes )
return;
leaf = worldmodel->leafs + CM_PointLeafnum( p );
leaf = CM_PointInLeaf( p, worldmodel->nodes );
*(int *)pvolumes = *(int *)leaf->ambient_sound_level;
}

View File

@ -375,10 +375,17 @@ const char *CM_TraceTexture( const vec3_t start, trace_t trace )
csurface_t **mark, *surf, *hitface = NULL;
float d1, d2, min_diff = 9999.9f;
vec3_t vecPos1, vecPos2;
cmodel_t *bmodel;
cleaf_t *endleaf;
cplane_t *plane;
int i;
if( !trace.pHit ) return NULL; // trace entity must be valid
bmodel = CM_ClipHandleToModel( trace.pHit->v.modelindex );
if( !bmodel || bmodel->type != mod_brush && bmodel->type != mod_world )
return NULL;
VectorSubtract( trace.vecEndPos, start, forward );
VectorNormalize( forward );
@ -386,7 +393,7 @@ const char *CM_TraceTexture( const vec3_t start, trace_t trace )
VectorMA( trace.vecEndPos, -1.0f, trace.vecPlaneNormal, vecPos1 );
VectorCopy( trace.vecEndPos, vecPos2 );
endleaf = worldmodel->leafs + CM_PointLeafnum( trace.vecEndPos );
endleaf = CM_PointInLeaf( trace.vecEndPos, bmodel->nodes + bmodel->hulls[0].firstclipnode );
mark = endleaf->firstMarkSurface;
// find a plane with endpos on one side and hitpos on the other side...

View File

@ -249,16 +249,10 @@ PM_TraceModel
*/
static TraceResult PM_TraceModel( edict_t *pEnt, const vec3_t start, const vec3_t end )
{
float *mins, *maxs;
if( VectorIsNAN( start ) || VectorIsNAN( end ))
Host_Error( "TraceModel: NAN errors detected ('%f %f %f', '%f %f %f'\n", start[0], start[1], start[2], end[0], end[1], end[2] );
clgame.pmove->usehull = bound( 0, clgame.pmove->usehull, 3 );
mins = clgame.pmove->player_mins[clgame.pmove->usehull];
maxs = clgame.pmove->player_maxs[clgame.pmove->usehull];
return CM_ClipMove( pEnt, start, mins, maxs, end, FMOVE_SIMPLEBOX );
return CM_ClipMove( pEnt, start, vec3_origin, vec3_origin, end, FMOVE_SIMPLEBOX );
}
/*
@ -306,6 +300,10 @@ static int PM_PointContents( const vec3_t p, int *truecontents )
static void PM_SetupMove( playermove_t *pmove, edict_t *clent, usercmd_t *ucmd, const char *physinfo )
{
edict_t *hit, *touch[MAX_EDICTS];
vec3_t absmin, absmax;
int i, count;
// setup playermove globals
pmove->multiplayer = (clgame.globals->maxClients > 1) ? true : false;
pmove->serverflags = clgame.globals->serverflags; // shared serverflags
@ -315,6 +313,37 @@ static void PM_SetupMove( playermove_t *pmove, edict_t *clent, usercmd_t *ucmd,
pmove->clientmaxspeed = clent->v.maxspeed;
pmove->cmd = *ucmd; // setup current cmds
pmove->player = clent; // ptr to client state
pmove->numladders = 0;
VectorCopy( clent->v.absmin, absmin );
VectorCopy( clent->v.absmax, absmax );
for( i = 0; i < 3; i++ )
{
absmin[i] = clent->v.origin[i] - 256;
absmax[i] = clent->v.origin[i] + 256;
}
count = CL_AreaEdicts( absmin, absmax, touch, MAX_EDICTS, AREA_CUSTOM );
// build list of ladders around player
for( i = 0; i < count; i++ )
{
if( pmove->numladders >= MAX_LADDERS )
{
MsgDev( D_ERROR, "PM_PlayerMove: too many ladders in PVS\n" );
break;
}
hit = touch[i];
if( hit == clent ) continue;
if( hit->v.solid != SOLID_NOT || hit->v.skin != CONTENTS_LADDER )
continue; // not ladder
// store ladder
pmove->ladders[pmove->numladders++] = hit;
}
}
static void PM_FinishMove( playermove_t *pmove, edict_t *clent )

16
engine/engine.plg Normal file
View File

@ -0,0 +1,16 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: engine - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
engine.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -875,7 +875,7 @@ edict_t* pfnFindEntityByString( edict_t *pStartEdict, const char *pszField, cons
const char *t;
if( pStartEdict ) e = NUM_FOR_EDICT( pStartEdict );
if( !pszValue || !*pszValue ) return NULL;
if( !pszValue || !*pszValue ) return svgame.edicts;
while(( desc = svgame.dllFuncs.pfnGetEntvarsDescirption( index++ )) != NULL )
{
@ -886,7 +886,7 @@ edict_t* pfnFindEntityByString( edict_t *pStartEdict, const char *pszField, cons
if( desc == NULL )
{
MsgDev( D_ERROR, "SV_FindEntityByString: field %s not found\n", pszField );
return NULL;
return svgame.edicts;
}
for( e++; e < svgame.globals->numEntities; e++ )
@ -938,7 +938,7 @@ edict_t* pfnFindEntityByString( edict_t *pStartEdict, const char *pszField, cons
break;
}
}
return NULL;
return svgame.edicts;
}
/*
@ -3114,6 +3114,14 @@ int pfnCheckVisibility( const edict_t *entity, byte *pset )
if( i == entity->pvServerData->num_leafs )
return 0; // not visible
}
// run additional check for BoxVisible
if( pe && CM_GetModelType( entity->v.modelindex ) == mod_brush )
{
if( !pe->BoxVisible( entity->v.absmin, entity->v.absmax, pset ))
return 0;
}
return 1;
}

View File

@ -385,7 +385,6 @@ bool SV_SpawnServer( const char *mapname, const char *startspot )
// precache and static commands can be issued during map initialization
sv.state = ss_loading;
sv.paused = false;
Host_SetServerState( sv.state );

View File

@ -395,15 +395,8 @@ PM_TraceModel
*/
static TraceResult PM_TraceModel( edict_t *pEnt, const vec3_t start, const vec3_t end )
{
float *mins, *maxs;
if( VectorIsNAN( start ) || VectorIsNAN( end ))
Host_Error( "TraceModel: NAN errors detected ('%f %f %f', '%f %f %f'\n", start[0], start[1], start[2], end[0], end[1], end[2] );
svgame.pmove->usehull = bound( 0, svgame.pmove->usehull, 3 );
mins = svgame.pmove->player_mins[svgame.pmove->usehull];
maxs = svgame.pmove->player_maxs[svgame.pmove->usehull];
return CM_ClipMove( pEnt, start, vec3_origin, vec3_origin, end, FMOVE_SIMPLEBOX );
}
@ -495,8 +488,8 @@ static void PM_SetupMove( playermove_t *pmove, edict_t *clent, usercmd_t *ucmd,
for( i = 0; i < 3; i++ )
{
absmin[i] = clent->v.origin[i] - 128;
absmax[i] = clent->v.origin[i] + 128;
absmin[i] = clent->v.origin[i] - 256;
absmax[i] = clent->v.origin[i] + 256;
}
count = SV_AreaEdicts( absmin, absmax, touch, MAX_EDICTS, AREA_CUSTOM );
@ -612,6 +605,7 @@ void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd )
return;
}
clent = cl->edict;
if( !SV_IsValidEdict( clent )) return;
@ -649,7 +643,7 @@ void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd )
VectorCopy( clent->v.basevelocity, clent->v.clbasevelocity );
}
if(( sv_maxclients->integer <= 1 ) && !CL_IsInGame( ) || ( clent->v.flags & FL_FROZEN ))
if(( sv_maxclients->integer <= 1 ) && !CL_IsInGame( ) || ( clent->v.flags & FL_FROZEN ) || ( sv.framenum < 2 ))
ucmd->msec = 0; // pause
svgame.globals->time = (sv.time * 0.001f);

View File

@ -1152,8 +1152,8 @@ const char *FS_FileExtension( const char *in )
{
const char *separator, *backslash, *colon, *dot;
separator = com.strrchr(in, '/');
backslash = com.strrchr(in, '\\');
separator = com.strrchr( in, '/' );
backslash = com.strrchr( in, '\\' );
if( !separator || separator < backslash ) separator = backslash;
colon = com.strrchr( in, ':' );
if( !separator || separator < colon ) separator = colon;

View File

@ -272,7 +272,7 @@ bool Image_SaveBMP( const char *name, rgbdata_t *pix )
}
// make last color is 0 0 255, xwad expect this (but ignore decals)
if( com.strchr( name, '{' ) && pix->flags & IMAGE_HAS_ALPHA && !(pix->flags & IMAGE_COLORINDEX))
if( com.strrchr( name, '{' ) && pix->flags & IMAGE_HAS_ALPHA && !( pix->flags & IMAGE_COLORINDEX ))
{
rgrgbPalette[255].rgbRed = 0x00;
rgrgbPalette[255].rgbGreen = 0x00;

View File

@ -500,18 +500,26 @@ bool Image_LoadMIP( const char *name, const byte *buffer, size_t filesize )
else pal += sizeof( short ); // skip colorsize
// detect rendermode
if( com.strchr( name, '{' ))
if( com.strrchr( name, '{' ))
{
rendermode = LUMP_TRANSPARENT;
color24 *col = (color24 *)pal;
// check for grayscale palette
for( i = 0; i < 255; i++, col++ )
{
if( col->r != col->g || col->g != col->b )
break;
}
if( i != 255 )
{
rendermode = LUMP_TRANSPARENT;
// qlumpy used this color for transparent textures, otherwise it's decals
if( pal[255*3+0] == 0 && pal[255*3+1] == 0 && pal[255*3+2] == 255 )
{
// make transparent color is black, blue color looks ugly
if( Sys.app_name == HOST_NORMAL )
pal[255*3+0] = pal[255*3+1] = pal[255*3+2] = 0;
}
else if(!( image.cmd_flags & IL_KEEP_8BIT ))
}
else
{
// apply decal palette immediately
image.flags |= IMAGE_COLORINDEX;

View File

@ -346,9 +346,9 @@ find one charcster in string
*/
char *com_strchr( const char *s, char c )
{
int len = com_strlen(s);
int len = com_strlen( s );
while(len--) if(*++s == c) return(char *)s;
while( len-- ) if( *++s == c ) return(char *)s;
return 0;
}
@ -361,13 +361,13 @@ find one charcster in string
*/
char *com_strrchr( const char *s, char c )
{
int len = com_strlen(s);
int len = com_strlen( s );
s += len;
while(len--) if(*--s == c) return (char *)s;
while( len-- ) if( *--s == c ) return (char *)s;
return 0;
}
int com_strnicmp(const char *s1, const char *s2, int n)
int com_strnicmp( const char *s1, const char *s2, int n )
{
int c1, c2;

View File

@ -5142,6 +5142,9 @@ IMPLEMENT_SAVERESTORE(CTriggerCamera,CBaseDelay);
void CTriggerCamera::Spawn( void )
{
// force camera to send on client
SetObjectClass( ED_NORMAL );
pev->movetype = MOVETYPE_NOCLIP;
pev->solid = SOLID_NOT; // Remove model & collisions
pev->renderamt = 0; // The engine won't draw this model if this is set to 0 and blending is on

View File

@ -1326,6 +1326,9 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
if( RI.currentmodel && !glState.in2DMode && !triState.fActive )
mod_type = RI.currentmodel->type;
// completely ignore rendermodes for worldbrushes
if( mod_type == mod_world ) return;
switch( tr.iRenderMode )
{
case kRenderNormal:
@ -1360,26 +1363,20 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
break;
case mod_world:
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA);
pass->flags = SHADERSTAGE_BLEND_MODULATE;
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_ENTITY;
break;
case mod_brush:
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA);
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA|GLSTATE_DEPTHWRITE);
pass->flags = SHADERSTAGE_BLEND_MODULATE;
pass->rgbGen.type = RGBGEN_VERTEX;
pass->rgbGen.type = RGBGEN_IDENTITY_LIGHTING;
pass->alphaGen.type = ALPHAGEN_ENTITY;
break;
case mod_studio:
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA);
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA|GLSTATE_DEPTHWRITE);
pass->flags = SHADERSTAGE_BLEND_MODULATE;
pass->rgbGen.type = RGBGEN_LIGHTING_DIFFUSE;
pass->alphaGen.type = ALPHAGEN_ENTITY;
break;
case mod_sprite:
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA);
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA|GLSTATE_DEPTHWRITE);
pass->flags = SHADERSTAGE_BLEND_MODULATE;
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
@ -1395,7 +1392,6 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
break;
case mod_world:
case mod_brush:
case mod_studio:
break;
@ -1414,8 +1410,10 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
break;
case mod_world:
case mod_brush:
pass->flags = SHADERSTAGE_BLEND_MODULATE;
pass->glState = GLSTATE_AFUNC_GE128|GLSTATE_DEPTHWRITE;
break;
case mod_studio:
break;
case mod_sprite:
@ -1435,7 +1433,6 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
break;
case mod_world:
case mod_brush:
pass->flags = SHADERSTAGE_BLEND_ADD;
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE);

View File

@ -249,7 +249,7 @@ static void Tri_DrawPolygon( void )
tri_mesh.colorsArray = tri_colors;
tri_mesh.elems = tri_elems;
if( tri_mbuffer.shaderkey != (int)shader->sortkey || -tri_mbuffer.infokey-1+32 > MAX_ARRAY_VERTS )
if( tri_mbuffer.shaderkey != (int)shader->sortkey || -tri_mbuffer.infokey-1+256 > MAX_ARRAY_VERTS )
{
if( tri_mbuffer.shaderkey )
{
@ -381,7 +381,14 @@ void Tri_Vertex3f( const float x, const float y, const float z )
// This is a strip that's too big for us to buffer.
// (We can't just flush the buffer because we have to keep
// track of the last two vertices.
Host_Error( "Tri_SetVertex: overflow: %i > MAX_TRIVERTS\n", triState.numVertex + triState.vertexState );
Host_Error( "Tri_Vertex3f: overflow: %i > MAX_TRIVERTS\n", triState.numVertex + triState.vertexState );
}
if( triState.numIndex > MAX_TRIELEMS )
{
// This is a strip that's too big for us to buffer.
// (We can't just flush the buffer because we have to keep
// track of the last two vertices.
Host_Error( "Tri_Vertex3f: overflow: %i > MAX_TRIELEMS\n", triState.numIndex );
}
if( triState.vertexState++ < 3 )
{

View File

@ -371,6 +371,7 @@ void R_TranslateForEntity( ref_entity_t *e )
if( e->movetype == MOVETYPE_FOLLOW && e->parent && !VectorIsNull( e->origin2 ))
Matrix4x4_SetOrigin( RI.objectMatrix, e->origin2[0], e->origin2[1], e->origin2[2] );
else Matrix4x4_SetOrigin( RI.objectMatrix, e->origin[0], e->origin[1], e->origin[2] );
Matrix4x4_ConcatScale( RI.objectMatrix, e->scale );
Matrix4x4_ConcatTransforms( RI.modelviewMatrix, RI.worldviewMatrix, RI.objectMatrix );
GL_LoadMatrix( RI.modelviewMatrix );
tr.modelviewIdentity = false;
@ -426,8 +427,8 @@ bool R_CompletelyFogged( mfog_t *fog, vec3_t origin, float radius )
// globalfog is not NULL and we're inside the world boundaries
if( fog && fog->shader && RI.fog_dist_to_eye[fog-r_worldbrushmodel->fogs] < 0 )
{
float vpnDist = ( ( RI.viewOrigin[0] - origin[0] ) * RI.vpn[0] + ( RI.viewOrigin[1] - origin[1] ) * RI.vpn[1] + ( RI.viewOrigin[2] - origin[2] ) * RI.vpn[2] );
return ( ( vpnDist + radius ) / fog->shader->fog_dist ) < -1;
float vpnDist = (( RI.viewOrigin[0] - origin[0] ) * RI.vpn[0] + ( RI.viewOrigin[1] - origin[1] ) * RI.vpn[1] + ( RI.viewOrigin[2] - origin[2] ) * RI.vpn[2] );
return (( vpnDist + radius ) / fog->shader->fog_dist ) < -1;
}
return false;
}
@ -550,12 +551,6 @@ bool R_PushSprite( const meshbuffer_t *mb, int type, float right, float left, fl
VectorMA( point, -left, v_right, spr_xyz[1] );
VectorMA( point, -right, v_right, spr_xyz[2] );
if( e->scale != 1.0f )
{
for( i = 0; i < 4; i++ )
VectorScale( spr_xyz[i], e->scale, spr_xyz[i] );
}
MB_NUM2SHADER( mb->shaderkey, shader );
// the code below is disgusting, but some q3a shaders use 'rgbgen vertex'

View File

@ -3400,7 +3400,7 @@ static ref_shader_t *Shader_CreateDefault( ref_shader_t *shader, int type, int a
shader->stages = ( ref_stage_t * )(( byte * )shader->name + length + 1 );
pass = &shader->stages[0];
pass->flags = SHADERSTAGE_BLEND_DECAL;
pass->glState = GLSTATE_SRCBLEND_DST_COLOR|GLSTATE_DSTBLEND_ZERO;
pass->glState = GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA;
pass->tcgen = TCGEN_BASE;
pass->textures[0] = Shader_FindImage( shader, shortname, addFlags );
pass->rgbGen.type = RGBGEN_IDENTITY_LIGHTING;