24 Oct 2009

This commit is contained in:
g-cont 2009-10-24 00:00:00 +04:00 committed by Alibek Omarov
parent 2076b34823
commit 4b0aa699c3
28 changed files with 408 additions and 1437 deletions

66
client/client.plg Normal file
View File

@ -0,0 +1,66 @@
<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\RSP1339.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "../common" /I "global" /I "hud" /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\hud\hud_message.cpp"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1339.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP133A.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\dll_int.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\r_particle.obj"
"\Xash3D\src_main\temp\client\!debug\tempents.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\RSP133A.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP133B.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\RSP133B.bat""
Compiling...
hud_message.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

@ -77,6 +77,8 @@ void HUD_Init( void )
g_engfuncs.pfnAddCommand ("give", NULL, "give specified item or weapon" );
g_engfuncs.pfnAddCommand ("drop", NULL, "drop current/specified item or weapon" );
g_engfuncs.pfnAddCommand ("intermission", NULL, "go to intermission" );
g_engfuncs.pfnAddCommand ("spectate", NULL, "enable spectator mode" );
g_engfuncs.pfnAddCommand ("gametitle", NULL, "show game logo" );
g_engfuncs.pfnAddCommand ("god", NULL, "classic cheat" );
g_engfuncs.pfnAddCommand ("fov", NULL, "set client field of view" );
@ -172,11 +174,20 @@ void HUD_UpdateEntityVars( edict_t *ent, skyportal_t *sky, const entity_state_t
ent->v.aiment = GetEntityByIndex( state->aiment );
else ent->v.aiment = NULL;
switch( ent->v.movetype )
{
case MOVETYPE_NONE:
ent->v.origin = state->origin;
break;
default:
ent->v.origin = LerpPoint( prev->origin, state->origin, m_fLerp );
break;
}
// lerping some fields
for( i = 0; i < 3; i++ )
{
ent->v.angles[i] = LerpAngle( prev->angles[i], state->angles[i], m_fLerp );
ent->v.origin[i] = LerpPoint( prev->origin[i], state->origin[i], m_fLerp );
ent->v.rendercolor[i] = LerpPoint( prev->rendercolor[i], state->rendercolor[i], m_fLerp );
}
@ -278,6 +289,8 @@ void HUD_Shutdown( void )
g_engfuncs.pfnDelCommand ("give" );
g_engfuncs.pfnDelCommand ("drop" );
g_engfuncs.pfnDelCommand ("intermission" );
g_engfuncs.pfnDelCommand ("spectate" );
g_engfuncs.pfnDelCommand ("gametitle" );
g_engfuncs.pfnDelCommand ("god" );
g_engfuncs.pfnDelCommand ("fov" );
}

View File

@ -704,7 +704,6 @@ void ClearPermanentFades( void )
if( pFade->fadeFlags & FFADE_STAYOUT )
{
// remove this Fade from the list
ALERT( at_console, "remove fade %i\n", i );
memset( pFade, 0, sizeof( ScreenFade ));
}
}

View File

@ -124,6 +124,11 @@ inline float LerpPoint( float oldpoint, float curpoint, float frac )
return oldpoint + frac * (curpoint - oldpoint);
}
inline Vector LerpPoint( Vector oldpoint, Vector curpoint, float frac )
{
return oldpoint + frac * (curpoint - oldpoint);
}
inline byte LerpByte( byte oldpoint, byte curpoint, float frac )
{
return bound( 0, oldpoint + frac * (curpoint - oldpoint), 255 );

View File

@ -314,10 +314,14 @@ int CHudMessage :: Draw( float fTime )
if( m_gameTitleTime > gHUD.m_flTime )
m_gameTitleTime = gHUD.m_flTime;
if( localTime > (m_pGameTitle->fadein + m_pGameTitle->holdtime + m_pGameTitle->fadeout) )
if( localTime > ( m_pGameTitle->fadein + m_pGameTitle->holdtime + m_pGameTitle->fadeout ))
{
ALERT( at_console, "Game Logo faded\n" );
m_gameTitleTime = 0;
}
else
{
ALERT( at_console, "Draw Game Logo\n" );
brightness = FadeBlend( m_pGameTitle->fadein, m_pGameTitle->fadeout, m_pGameTitle->holdtime, localTime );
int fullWidth = gHUD.GetSpriteRect(HUD_Logo).right - gHUD.GetSpriteRect(HUD_Logo).left;
@ -326,7 +330,7 @@ int CHudMessage :: Draw( float fTime )
int x = XPosition( m_pGameTitle->x, fullWidth, fullWidth );
int y = YPosition( m_pGameTitle->y, fullHeight);
SPR_Set( gHUD.GetSprite(HUD_Logo), brightness * m_pGameTitle->r1, brightness * m_pGameTitle->g1, brightness * m_pGameTitle->b1 );
SPR_Set( gHUD.GetSprite( HUD_Logo ), brightness * m_pGameTitle->r1, brightness * m_pGameTitle->g1, brightness * m_pGameTitle->b1 );
SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect( HUD_Logo ));
drawn = 1;

View File

@ -417,15 +417,16 @@ int CHud :: MsgFunc_ScreenFade( const char *pszName, int iSize, void *pbuf )
{
BEGIN_READ( pszName, iSize, pbuf );
float fadeTime = READ_SHORT() / (1<<12);
float holdTime = READ_SHORT() / (1<<12);
float fadeTime = fabs( READ_SHORT() / (1<<12));
float holdTime = fabs( READ_SHORT() / (1<<12));
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
m_FadeColor.x = READ_BYTE(); // fade red
m_FadeColor.y = READ_BYTE(); // fade green
m_FadeColor.z = READ_BYTE(); // fade blue
float alpha = READ_BYTE(); // fade alpha
SetScreenFade( m_FadeColor, alpha, fadeTime, holdTime, fadeFlags );

View File

@ -128,6 +128,130 @@ prevframe_t *CL_GetPrevFrame( int entityIndex )
return &pEnt->pvClientData->latched;
}
/*
====================
CL_InitTitles
parse all messages that declared in titles.txt
and hold them into permament memory pool
====================
*/
static void CL_InitTitles( const char *filename )
{
token_t token;
client_textmessage_t state;
char *pName = NULL;
char *pMessage = NULL;
script_t *script;
Mem_Set( &state, 0, sizeof( state ));
Mem_Set( &clgame.titles, 0, sizeof( clgame.titles ));
clgame.numTitles = 0;
script = Com_OpenScript( filename, NULL, 0 );
if( !script ) return;
while( script )
{
if( !Com_ReadToken( script, SC_ALLOW_NEWLINES, &token ))
break;
if( !com.stricmp( token.string, "$" )) // skip dollar
Com_ReadToken( script, false, &token );
if( !com.stricmp( token.string, "position" ))
{
Com_ReadFloat( script, false, &state.x );
Com_ReadFloat( script, false, &state.y );
}
else if( !com.stricmp( token.string, "effect" ))
{
Com_ReadUlong( script, false, &state.effect );
}
else if( !com.stricmp( token.string, "fadein" ))
{
Com_ReadFloat( script, false, &state.fadein );
}
else if( !com.stricmp( token.string, "fadeout" ))
{
Com_ReadFloat( script, false, &state.fadeout );
}
else if( !com.stricmp( token.string, "fxtime" ))
{
Com_ReadFloat( script, false, &state.fxtime );
}
else if( !com.stricmp( token.string, "holdtime" ))
{
Com_ReadFloat( script, false, &state.holdtime );
}
else if( !com.strnicmp( token.string, "color2", 6 ))
{
uint temp;
Com_ReadUlong( script, false, &temp );
state.r2 = temp;
Com_ReadUlong( script, false, &temp );
state.g2 = temp;
Com_ReadUlong( script, false, &temp );
state.b2 = temp;
if( Com_ReadUlong( script, false, &temp ))
state.a2 = temp; // optional, nevers used in Half-Life
else state.a2 = 255;
}
else if( !com.stricmp( token.string, "color" ))
{
uint temp;
Com_ReadUlong( script, false, &temp );
state.r1 = temp;
Com_ReadUlong( script, false, &temp );
state.g1 = temp;
Com_ReadUlong( script, false, &temp );
state.b1 = temp;
if( Com_ReadUlong( script, false, &temp ))
state.a1 = temp; // optional, nevers used in Half-Life
else state.a1 = 255;
}
else if( !com.stricmp( token.string, "{" ))
{
client_textmessage_t *newmsg;
const char *buffer, *end;
size_t size;
Com_SaveToken( script, &token );
// parse the message
buffer = script->text;
Com_SkipBracedSection( script, 0 );
end = script->text - 1; // skip '}'
if( !buffer ) buffer = script->buffer; // missing body ?
if( !end ) end = script->buffer + script->size; // EOF ?
size = end - buffer;
pMessage = Mem_Alloc( cls.mempool, size + 1 );
Mem_Copy( pMessage, buffer, size );
pMessage[size] = 0; // terminator
// create new client textmessage
newmsg = &clgame.titles[clgame.numTitles];
Mem_Copy( newmsg, &state, sizeof( *newmsg ));
newmsg->pName = pName;
newmsg->pMessage = pMessage;
clgame.numTitles++; // registered
}
else
{
// begin message declaration
pName = com.stralloc( cls.mempool, token.string, __FILE__, __LINE__ );
}
}
Com_CloseScript( script );
}
static trace_t CL_TraceToss( edict_t *tossent, edict_t *ignore)
{
int i;
@ -749,10 +873,15 @@ pfnTextMessageGet
*/
client_textmessage_t *pfnTextMessageGet( const char *pName )
{
// FIXME: implement or move to client.dll
static client_textmessage_t null_msg;
int i;
return &null_msg;
// find desired message
for( i = 0; i < clgame.numTitles; i++ )
{
if( !com.strcmp( pName, clgame.titles[i].pName ))
return clgame.titles + i;
}
return NULL; // found nothing
}
/*
@ -1805,6 +1934,8 @@ bool CL_LoadProgs( const char *name )
CL_InitEdict( &clgame.playermodel );
clgame.playermodel.serialnumber = MAX_EDICTS - 1;
CL_InitTitles( "scripts/titles.txt" );
// initialize game
clgame.dllFuncs.pfnInit();

View File

@ -346,9 +346,10 @@ void SCR_DrawFPS( void )
else
{
com.snprintf( fpsstring, sizeof( fpsstring ), "%4i fps", (int)(calc + 0.5));
color = g_color_table[3];
color = g_color_table[7];
}
SCR_DrawBigStringColor( SCREEN_WIDTH - 146, SCREEN_HEIGHT - 32, fpsstring, color );
SCR_DrawStringExt( SCREEN_WIDTH - 68, 4, 8, 12, fpsstring, color, true );
}
/*

View File

@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_EDIT_LINE 256
#define COMMAND_HISTORY 32
#define MAX_SERVERS 64
#define MAX_GAME_TITLES 1024
#define ColorIndex(c) (((c) - '0') & 7)
#define NUM_FOR_EDICT(e) ((int)((edict_t *)(e) - clgame.edicts))
@ -289,6 +290,9 @@ typedef struct
tri_state_t *pTri;
client_textmessage_t titles[MAX_GAME_TITLES];
int numTitles;
edict_t viewent; // viewmodel or playermodel in UI_PlayerSetup
edict_t playermodel; // uiPlayerSetup latched vars

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,85 @@
--------------------Configuration: engine - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134B.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "common" /I "server" /I "client" /I "uimenu" /I "../public" /I "../common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\engine\!debug/" /Fo"..\temp\engine\!debug/" /Fd"..\temp\engine\!debug/" /FD /c
"D:\Xash3D\src_main\engine\client\cl_game.c"
]
Creating command line "cl.exe @"C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134B.tmp""
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134C.tmp" with contents
[
user32.lib msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\engine\!debug/engine.pdb" /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\temp\engine\!debug/engine.dll" /implib:"..\temp\engine\!debug/engine.lib" /pdbtype:sept
"\Xash3D\src_main\temp\engine\!debug\cinematic.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_cmds.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_demo.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_effects.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_frame.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_game.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_input.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_main.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_parse.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_phys.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_scrn.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_view.obj"
"\Xash3D\src_main\temp\engine\!debug\com_library.obj"
"\Xash3D\src_main\temp\engine\!debug\con_keys.obj"
"\Xash3D\src_main\temp\engine\!debug\con_main.obj"
"\Xash3D\src_main\temp\engine\!debug\con_utils.obj"
"\Xash3D\src_main\temp\engine\!debug\engfuncs.obj"
"\Xash3D\src_main\temp\engine\!debug\engine.obj"
"\Xash3D\src_main\temp\engine\!debug\host.obj"
"\Xash3D\src_main\temp\engine\!debug\infostring.obj"
"\Xash3D\src_main\temp\engine\!debug\input.obj"
"\Xash3D\src_main\temp\engine\!debug\net_chan.obj"
"\Xash3D\src_main\temp\engine\!debug\net_huff.obj"
"\Xash3D\src_main\temp\engine\!debug\net_msg.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_client.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_cmds.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_frame.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_game.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_init.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_main.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_move.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_phys.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_save.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_world.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_advanced.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_audio.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_controls.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_credits.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_defaults.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_demos.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_gameoptions.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_gotosite.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_loadgame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_main.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_menu.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_mods.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_multiplayer.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_network.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_newgame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_options.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_performance.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_playersetup.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_qmenu.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_savegame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_saveload.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_video.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134C.tmp""
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134D.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\engine\!debug\engine.dll "D:\Xash3D\bin\engine.dll"
]
Creating command line ""C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSP134D.bat""
Compiling...
cl_game.c
Linking...
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\engine\!debug\engine.dll
‘Ş®Ż¨ŕ®˘ ­® ä ©«®˘: 1.

View File

@ -349,7 +349,7 @@ void SV_WriteFrameToClient( sv_client_t *cl, sizebuf_t *msg )
// the snapshot's entities may still have rolled off the buffer, though
if( oldframe->first_entity <= svs.next_client_entities - svs.num_client_entities )
{
MsgDev( D_WARN, "%s: delta request from out of date entities.\n", cl->name );
MsgDev( D_WARN, "%s: ^7delta request from out of date entities.\n", cl->name );
oldframe = NULL;
lastframe = 0;
}

View File

@ -1390,9 +1390,10 @@ static bool FS_ParseGameInfo( const char *filename, gameinfo_t *GameInfo )
if( !com.stricmp( gs_basedir, filename ) && !FS_FileExists( filepath ))
FS_CreateGameInfo( filepath );
if( !GameInfo ) return false; // no dest
script = PS_LoadScript( filepath, NULL, 0 );
if( !script ) return false;
if( !GameInfo ) return false; // no dest
// setup default values
com.strncpy( GameInfo->gamefolder, filename, MAX_STRING );

16
launch/launch.plg Normal file
View File

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

View File

@ -329,22 +329,22 @@ LINK_ENTITY_TO_CLASS( env_fade, CFade );
void CFade::KeyValue( KeyValueData *pkvd )
{
if (FStrEq(pkvd->szKeyName, "duration"))
if (FStrEq( pkvd->szKeyName, "duration" ))
{
pev->dmg_take = atof(pkvd->szValue);
pev->dmg_take = atof( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "holdtime"))
else if (FStrEq( pkvd->szKeyName, "holdtime" ))
{
pev->dmg_save = atoi(pkvd->szValue);
pev->dmg_save = atof( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else CBaseEntity::KeyValue( pkvd );
else CBaseEntity::KeyValue( pkvd );
}
void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if(useType == USE_SHOWINFO)
if ( useType == USE_SHOWINFO )
{
DEBUGHEAD;
Msg( "Fadecolor: %g %g %g, Fadealpha: %g, Fadetime: %g\n", pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, pev->renderamt, pev->dmg_take );
@ -352,13 +352,15 @@ void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType
}
else
{
//setup fade flags
// setup fade flags
int fadeFlags = 0;
if(!(pev->spawnflags & SF_FADE_IN)) fadeFlags |= FFADE_OUT;
if ( pev->spawnflags & SF_FADE_IN )
fadeFlags |= FFADE_IN;
else fadeFlags |= FFADE_OUT;
if ( pev->spawnflags & SF_FADE_MODULATE ) fadeFlags |= FFADE_MODULATE;
if ( pev->spawnflags & SF_FADE_CAMERA ) fadeFlags |= FFADE_CUSTOMVIEW;
//apply fade
// apply fade
if ( pev->spawnflags & SF_FADE_ALL ) UTIL_ScreenFadeAll( pev->rendercolor, pev->dmg_take, pev->dmg_save, pev->renderamt, fadeFlags );
else UTIL_ScreenFade( pev->rendercolor, pev->dmg_take, pev->dmg_save, pev->renderamt, fadeFlags );
}

View File

@ -53,8 +53,10 @@ void CEnvShower::Touch( CBaseEntity *pOther )
{
if ( pev->flags & FL_ONGROUND )
pev->velocity = pev->velocity * 0.1;
else pev->velocity = pev->velocity * 0.6;
if ( (pev->velocity.x*pev->velocity.x+pev->velocity.y*pev->velocity.y) < 10.0 ) pev->speed = 0;
else pev->velocity = pev->velocity * 0.6;
if ( (pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ) < 10.0 )
pev->speed = 0;
}
//====================================================================
@ -168,7 +170,7 @@ class CFloorEnt:public CPointEntity
{
void Think( void );
void PostActivate( void );
CBasePlatform *pElevator; //no need to save - PostActivate will be restore this
CBasePlatform *pElevator; // no need to save - PostActivate will be restore this
};
void CFloorEnt::PostActivate( void )
@ -215,7 +217,7 @@ void CLaserSpot::Spawn( void )
SetObjectClass( ED_NORMAL );
// laser dot settings
pev->movetype = MOVETYPE_NOCLIP;
pev->movetype = MOVETYPE_NONE;
pev->solid = SOLID_NOT;
pev->scale = 1.0;
pev->rendermode = kRenderGlow;

View File

@ -1172,16 +1172,16 @@ int CBasePlayerWeapon :: PlayCurrentAttack( int action, int firemode )
else if(action == LASER_DOT)
{
m_iSpot = !m_iSpot;
if(!m_iSpot && m_pSpot)//disable laser dot
if( !m_iSpot && m_pSpot ) // disable laser dot
{
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/spot_off.wav", 1, ATTN_NORM);
EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/spot_off.wav", 1, ATTN_NORM );
m_pSpot->Killed();
m_pSpot = NULL;
m_iSkin = 0; //disable screen
m_iSkin = 0; // disable screen
}
iResult = 1;
}
else if(action == FLASHLIGHT)
else if ( action == FLASHLIGHT )
{
if(FBitSet(m_pPlayer->pev->effects, EF_DIMLIGHT))
{

View File

@ -536,7 +536,6 @@ void ClientCommand( edict_t *pEntity )
else if( FStrEq( pcmd, "gametitle" ))
{
MESSAGE_BEGIN( MSG_ONE, gmsg.ShowGameTitle, NULL, ENT( pev ));
WRITE_BYTE( 0 );
MESSAGE_END();
}
else if( FStrEq( pcmd, "intermission" ))
@ -575,7 +574,7 @@ void ClientCommand( edict_t *pEntity )
}
else if ( FStrEq(pcmd, "use" ) )
{
GetClassPtr((CBasePlayer *)pev)->SelectItem((char *)CMD_ARGV(1));
GetClassPtr((CBasePlayer *)pev)->SelectItem((char *)CMD_ARGV( 1 ));
}
else if (((pstr = strstr(pcmd, "weapon_")) != NULL) && (pstr == pcmd))
{
@ -592,7 +591,7 @@ void ClientCommand( edict_t *pEntity )
edict_t *pentSpawnSpot = g_pGameRules->GetPlayerSpawnSpot( pPlayer );
pPlayer->StartObserver( pev->origin, VARS(pentSpawnSpot)->angles);
}
else if ( g_pGameRules->ClientCommand( GetClassPtr((CBasePlayer *)pev), pcmd ) )
else if ( g_pGameRules->ClientCommand( GetClassPtr((CBasePlayer *)pev), pcmd ))
{
// MenuSelect returns true only if the command is properly handled, so don't print a warning
}
@ -1309,8 +1308,8 @@ void LinkUserMessages( void )
gmsg.HideWeapon = REG_USER_MSG( "HideWeapon", 1 );
gmsg.WeaponAnim = REG_USER_MSG( "WeaponAnim", 3 );
gmsg.ShowMenu = REG_USER_MSG( "ShowMenu", -1 );
gmsg.Shake = REG_USER_MSG("ScreenShake", 13 );
gmsg.Fade = REG_USER_MSG("ScreenFade", sizeof(ScreenFade));
gmsg.Shake = REG_USER_MSG( "ScreenShake", 13 );
gmsg.Fade = REG_USER_MSG( "ScreenFade", sizeof( ScreenFade ));
gmsg.AmmoX = REG_USER_MSG("AmmoX", 2);
gmsg.TeamNames = REG_USER_MSG( "TeamNames", -1 );
gmsg.StatusText = REG_USER_MSG("StatusText", -1);
@ -1328,7 +1327,7 @@ void LinkUserMessages( void )
gmsg.AddScreen = REG_USER_MSG( "AddScreen", 2);
gmsg.AddPortal = REG_USER_MSG( "AddPortal", 2);
gmsg.HudText = REG_USER_MSG( "HudText", -1 );
gmsg.ShowGameTitle = REG_USER_MSG("GameTitle", 1);
gmsg.ShowGameTitle = REG_USER_MSG("GameTitle", 0 );
gmsg.TempEntity = REG_USER_MSG( "TempEntity", -1);
gmsg.SetFog = REG_USER_MSG("SetFog", 7 );
gmsg.SetSky = REG_USER_MSG( "SetSky", 13 );

View File

@ -2075,16 +2075,19 @@ void UTIL_ScreenFadeAll( const Vector &color, float fadeTime, float fadeHold, in
void UTIL_ScreenFade( const Vector &color, float fadeTime, float fadeHold, int alpha, int flags, int playernum )
{
CBasePlayer *pPlayer = (CBasePlayer*)UTIL_PlayerByIndex( playernum );
if ( pPlayer )
{
if(flags & FFADE_CUSTOMVIEW)
if ( flags & FFADE_CUSTOMVIEW )
{
if(pPlayer->viewFlags == 0) return;
ClearBits( flags, FFADE_CUSTOMVIEW ); //don't send this flag to engine!!!
if ( pPlayer->viewFlags == 0 ) return;
ClearBits( flags, FFADE_CUSTOMVIEW ); // don't send this flag to engine!!!
}
if(flags & FFADE_OUT && fadeHold == 0) SetBits( flags, FFADE_STAYOUT );
if ( flags & FFADE_OUT && fadeHold == 0 )
SetBits( flags, FFADE_STAYOUT );
else ClearBits( flags, FFADE_STAYOUT );
pPlayer->m_FadeColor = color;
pPlayer->m_FadeAlpha = alpha;
pPlayer->m_iFadeFlags = flags;

View File

@ -400,7 +400,7 @@ void CBasePlayer :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector
break;
}
if(bitsDamageType & DMG_NUCLEAR)
if( bitsDamageType & DMG_NUCLEAR )
{
m_FadeColor = Vector( 255, 255, 255 );
m_FadeAlpha = 240;

View File

@ -6,13 +6,13 @@
--------------------Configuration: server - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE49.tmp" with contents
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124B.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "ents" /I "game" /I "global" /I "monsters" /I "../common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\server\!debug/" /Fo"..\temp\server\!debug/" /Fd"..\temp\server\!debug/" /FD /c
"D:\Xash3D\src_main\server\ents\basefx.cpp"
"D:\Xash3D\src_main\server\global\client.cpp"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE49.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE4A.tmp" with contents
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124B.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124C.tmp" with contents
[
msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\server\!debug/server.pdb" /debug /machine:I386 /nodefaultlib:"libc.lib" /def:".\server.def" /out:"..\temp\server\!debug/server.dll" /implib:"..\temp\server\!debug/server.lib" /pdbtype:sept
"\Xash3D\src_main\temp\server\!debug\ai_sound.obj"
@ -78,15 +78,15 @@ msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\serve
"\Xash3D\src_main\temp\server\!debug\weapon_generic.obj"
"\Xash3D\src_main\temp\server\!debug\zombie.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE4A.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE4B.bat" with contents
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124C.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124D.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\server\!debug\server.dll "D:\Xash3D\bin\server.dll"
]
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE4B.bat""
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP124D.bat""
Compiling...
basefx.cpp
client.cpp
Linking...
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\server\!debug\server.dll

View File

@ -164,4 +164,4 @@ Beta 13.12.09
137. complete rewriting physic.dll
138. implement hashtable for loaded sounds
139. finalize client API's
140. net_msg is buggly!!!!
140. net_msg is buggly!!!! OK

View File

@ -1390,7 +1390,7 @@ static void R_ShaderpassRenderMode( ref_stage_t *pass )
case mod_studio:
break;
case mod_sprite:
pass->glState = (GLSTATE_SRCBLEND_ONE_MINUS_SRC_ALPHA|GLSTATE_DSTBLEND_ONE|GLSTATE_NO_DEPTH_TEST);
pass->glState = (GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE|GLSTATE_NO_DEPTH_TEST);
pass->rgbGen.type = RGBGEN_VERTEX;
pass->alphaGen.type = ALPHAGEN_VERTEX;
break;
@ -3026,7 +3026,7 @@ R_DrawTriangles
*/
static void R_DrawTriangles( void )
{
if( r_showtris->integer == 2 )
if( gl_wireframe->integer == 2 )
R_SetColorForOutlines();
if( GL_Support( R_DRAW_RANGEELEMENTS_EXT ))

View File

@ -384,7 +384,7 @@ extern cvar_t *r_coronascale;
extern cvar_t *r_detailtextures;
extern cvar_t *r_subdivisions;
extern cvar_t *r_faceplanecull;
extern cvar_t *r_showtris;
extern cvar_t *gl_wireframe;
extern cvar_t *r_shownormals;
extern cvar_t *r_showtextures;
extern cvar_t *r_draworder;

View File

@ -582,6 +582,8 @@ static void R_PushFlareSurf( const meshbuffer_t *mb )
msurface_t *surf = &bmodel->surfaces[mb->infokey - 1];
ref_shader_t *shader;
if( !r_flares->integer ) return;
if( RI.currentmodel != r_worldmodel )
{
Matrix3x3_Transform( RI.currententity->axis, surf->origin, origin );
@ -1565,7 +1567,7 @@ void R_RenderDebugSurface( void )
VectorMA( start, 4096, forward, end );
r_debug_surface = R_TraceLine( &tr, start, end, 0 );
if( r_debug_surface && r_debug_surface->mesh && !r_showtris->integer )
if( r_debug_surface && r_debug_surface->mesh && !gl_wireframe->integer )
{
RI.previousentity = NULL;
RI.currententity = (ref_entity_t *)tr.gp;
@ -1672,7 +1674,7 @@ void R_RenderView( const ref_params_t *fd )
R_BackendCleanUpTextureUnits();
R_DrawTriangleOutlines( r_showtris->integer ? true : false, r_shownormals->integer ? true : false );
R_DrawTriangleOutlines( gl_wireframe->integer ? true : false, r_shownormals->integer ? true : false );
R_RenderDebugSurface ();

View File

@ -51,7 +51,7 @@ cvar_t *r_coronascale;
cvar_t *r_detailtextures;
cvar_t *r_subdivisions;
cvar_t *r_faceplanecull;
cvar_t *r_showtris;
cvar_t *gl_wireframe;
cvar_t *r_shownormals;
cvar_t *r_showtextures;
cvar_t *r_draworder;
@ -501,7 +501,7 @@ void GL_InitCommands( void )
r_lerpmodels = Cvar_Get( "r_lerpmodels", "1", 0, "use lerping for alias and studio models" );
r_speeds = Cvar_Get( "r_speeds", "0", CVAR_ARCHIVE, "shows r_speeds" );
r_drawelements = Cvar_Get( "r_drawelements", "1", 0, "use gldrawElements or glDrawRangeElements" );
r_showtris = Cvar_Get( "r_showtris", "0", CVAR_CHEAT, "show mesh triangles" );
gl_wireframe = Cvar_Get( "gl_wireframe", "0", CVAR_CHEAT, "show mesh triangles" );
r_lockpvs = Cvar_Get( "r_lockpvs", "0", CVAR_CHEAT, "lockpvs area at current point (pvs test)" );
r_clear = Cvar_Get( "r_clear", "0", CVAR_ARCHIVE, "clearing screen after each frame" );
r_mode = Cvar_Get( "r_mode", VID_DEFAULTMODE, CVAR_ARCHIVE|CVAR_LATCH_VIDEO, "display resolution mode" );

View File

@ -472,7 +472,7 @@ static float R_GlowSightDistance( vec3_t glowOrigin )
VectorSubtract( glowOrigin, RI.viewOrigin, glowDist );
dist = VectorLength( glowDist );
R_TraceLine( &tr, glowOrigin, RI.viewOrigin, MASK_OPAQUE );
R_TraceLine( &tr, RI.viewOrigin, glowOrigin, MASK_OPAQUE );
if(( 1.0 - tr.fraction ) * dist > 8 )
return -1;
return dist;
@ -507,12 +507,20 @@ bool R_SpriteOccluded( ref_entity_t *e )
if( e->rendermode == kRenderGlow )
{
float blend = 1.0f;
vec3_t v;
R_TransformToScreen_Vec3( e->origin, v );
if( v[0] < RI.refdef.viewport[0] || v[0] > RI.refdef.viewport[0] + RI.refdef.viewport[2] )
return true; // do scissor
if( v[1] < RI.refdef.viewport[1] || v[1] > RI.refdef.viewport[1] + RI.refdef.viewport[3] )
return true; // do scissor
blend *= R_SpriteGlowBlend( e );
e->renderamt *= blend;
if( blend <= 0.0f )
return true; // occluded
if( blend <= 0.05f )
return true; // faded
}
return false;
}

View File

@ -6,13 +6,13 @@
--------------------Configuration: vid_gl - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE86.tmp" with contents
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP118E.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "../public" /I "../common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\vid_gl\!debug/" /Fo"..\temp\vid_gl\!debug/" /Fd"..\temp\vid_gl\!debug/" /FD /c
"D:\Xash3D\src_main\vid_gl\r_backend.c"
"D:\Xash3D\src_main\vid_gl\r_sprite.c"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE86.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE87.tmp" with contents
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP118E.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP118F.tmp" with contents
[
msvcrtd.lib user32.lib gdi32.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\vid_gl\!debug/vid_gl.pdb" /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\temp\vid_gl\!debug/vid_gl.dll" /implib:"..\temp\vid_gl\!debug/vid_gl.lib" /pdbtype:sept
"\Xash3D\src_main\temp\vid_gl\!debug\cin.obj"
@ -39,17 +39,16 @@ msvcrtd.lib user32.lib gdi32.lib /nologo /subsystem:windows /dll /incremental:ye
"\Xash3D\src_main\temp\vid_gl\!debug\r_studio.obj"
"\Xash3D\src_main\temp\vid_gl\!debug\r_surf.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE87.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE88.bat" with contents
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP118F.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1190.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\vid_gl\!debug\vid_gl.dll "D:\Xash3D\bin\vid_gl.dll"
]
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPE88.bat""
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1190.bat""
Compiling...
r_backend.c
r_sprite.c
Linking...
Creating library ..\temp\vid_gl\!debug/vid_gl.lib and object ..\temp\vid_gl\!debug/vid_gl.exp
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\vid_gl\!debug\vid_gl.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.