Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Oct 27, 2018
1 parent 044b603 commit 2b11b50
Show file tree
Hide file tree
Showing 71 changed files with 971 additions and 791 deletions.
32 changes: 32 additions & 0 deletions change.log
Expand Up @@ -16,6 +16,38 @@ VGUI: - a VGUI implementation code in xash.dll
Memory: - a memory manager in xash.dll
Physic: - a server physics code in xash.dll

build 4281

GameUI: new gameinfo setting "noskills" 0/1 that disables sub-menu for skill selection
Client: fix some minor bugs with playing Quake demos
Render: reorganize emboss-mapping with single cvar "gl_emboss_scale" instead of separate description from scripts\texfilter.txt
Engine: added new gameinfo setting "mpfilter" for Cry Of Fear filtering single-player maps by name prefix
Engine: added some missed settings while liblist.gam is converted into gameinfo.txt
Engine: always allow console for QWrap.
Server: fix bug with playing cd-track after changing level
Server: command "god" is now work under Cry Of Fear.
Server: commands "changelevel" and "changelevel2" reverted into engine for backward compatibility.
GameUI: allow to delete saved games in menu before game was running
Sound: fixed very old bug with sounds that playing from studiomodel events at server-side
Server: prevent crash while some mods replaced key-value strings with constant values
Physic: filtering MOVETYPE_PUSH method by edict->movetype for accurate moving player's and NPC's and compatible moving items or corpses
GameUI: now keytable color can be replaced with gfx\shell\color.lst->INPUT_TEXT_COLOR
GameUI: empty save image replaced from decals.wad\{GRAF001 with gfx.wad\lambda32
GameUI: fix game switching if game folder have spaces in folder name
GameUI: color of selection in scroll lists can be replaced with gfx\shell\color.lst->SELECT_TEXT_COLOR

build 4260

Sound: implement system for playing in-game videos with positioned sound (e.g. XashXT, Paranoia2)
Engine: RenderAPI added new function AVI_StreamSound for in-game videos with sound (compatibility will not suffer)
Client: net_speeds now show total traffic size while demos is playing back
Client: quake demos now use linear interpolation for all entities and player
Render: fix particle trails during playback quake demos
Client: fix some errors in parsing temp ents in Quake proto (Nehahra)
Client: allow seamless change demos in case where current playing demo issued a next demo during parse network message
Client: fix bugs with remap colors on alias playermodels
Engine: fixed critical bug in modelloader

build 4253

Render: remove flags TF_TEXTURE_1D, TF_TEXTURE_2D_ARRAY it's just not needs
Expand Down
1 change: 1 addition & 0 deletions common/gameinfo.h
Expand Up @@ -17,6 +17,7 @@ GNU General Public License for more details.
#define GAMEINFO_H

#define GFL_NOMODELS (1<<0)
#define GFL_NOSKILLS (1<<1)

/*
========================================================================
Expand Down
6 changes: 3 additions & 3 deletions common/render_api.h
Expand Up @@ -79,7 +79,7 @@ typedef enum
TF_KEEP_SOURCE = (1<<1), // some images keep source
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
TF_EXPAND_SOURCE = (1<<3), // Don't keep source as 8-bit expand to RGBA
// reserved
TF_ALLOW_EMBOSS = (1<<4), // Allow emboss-mapping for this image
TF_RECTANGLE = (1<<5), // this is GL_TEXTURE_RECTANGLE
TF_CUBEMAP = (1<<6), // it's cubemap texture
TF_DEPTHMAP = (1<<7), // custom texture filter used
Expand Down Expand Up @@ -183,16 +183,16 @@ typedef struct render_api_s
void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only)

// AVIkit support
void *(*AVI_LoadVideo)( const char *filename );
void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio );
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
void (*AVI_FreeVideo)( void *Avi );
int (*AVI_IsActive)( void *Avi );
void (*AVI_StreamSound)( void *Avi, int entnum, float fvol, float attn, float synctime );
void (*AVI_Reserved0)( void ); // for potential interface expansion without broken compatibility
void (*AVI_Reserved1)( void );
void (*AVI_Reserved2)( void );

// glState related calls (must use this instead of normal gl-calls to prevent de-synchornize local states between engine and the client)
void (*GL_Bind)( int tmu, unsigned int texnum );
Expand Down
55 changes: 36 additions & 19 deletions engine/client/cl_demo.c
Expand Up @@ -725,7 +725,7 @@ void CL_DemoCompleted( void )

CL_StopPlayback();

if( !CL_NextDemo() && host_developer.value <= DEV_NONE )
if( !CL_NextDemo() && !cls.changedemo )
UI_SetActiveMenu( true );

Cvar_SetValue( "v_dark", 0.0f );
Expand Down Expand Up @@ -795,6 +795,8 @@ qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
}
}

cls.netchan.last_received = host.realtime;
cls.netchan.total_received += msglen;
*length = msglen;

if( cls.state != ca_active )
Expand All @@ -812,6 +814,7 @@ reads demo data and write it to client
*/
qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
{
vec3_t viewangles;
int msglen = 0;
demoangle_t *a;

Expand Down Expand Up @@ -841,10 +844,12 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )

// get the next message
FS_Read( cls.demofile, &msglen, sizeof( int ));
FS_Read( cls.demofile, &cl.viewangles[0], sizeof( float ));
FS_Read( cls.demofile, &cl.viewangles[1], sizeof( float ));
FS_Read( cls.demofile, &cl.viewangles[2], sizeof( float ));
FS_Read( cls.demofile, &viewangles[0], sizeof( float ));
FS_Read( cls.demofile, &viewangles[1], sizeof( float ));
FS_Read( cls.demofile, &viewangles[2], sizeof( float ));
cls.netchan.incoming_sequence++;
demo.timestamp = cl.mtime[0];
cl.skip_interp = false;

// make sure what interp info contain angles from different frames
// or lerping will stop working
Expand All @@ -856,7 +861,7 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )

// record update
a->starttime = demo.timestamp;
VectorCopy( cl.viewangles, a->viewangles );
VectorCopy( viewangles, a->viewangles );
demo.lasttime = demo.timestamp;
}

Expand Down Expand Up @@ -884,6 +889,8 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
}
}

cls.netchan.last_received = host.realtime;
cls.netchan.total_received += msglen;
*length = msglen;

if( cls.state != ca_active )
Expand Down Expand Up @@ -1073,14 +1080,26 @@ but viewangles interpolate here
*/
void CL_DemoInterpolateAngles( void )
{
float curtime = (CL_GetDemoPlaybackClock() - demo.starttime) - host.frametime;
demoangle_t *prev = NULL, *next = NULL;
float frac = 0.0f;
float curtime;

if( curtime > demo.timestamp )
curtime = demo.timestamp; // don't run too far
if( cls.demoplayback == DEMO_QUAKE1 )
{
// manually select next & prev states
next = &demo.cmds[(demo.angle_position - 0) & ANGLE_MASK];
prev = &demo.cmds[(demo.angle_position - 1) & ANGLE_MASK];
if( cl.skip_interp ) *prev = *next; // camera was teleported
frac = cl.lerpFrac;
}
else
{
curtime = (CL_GetDemoPlaybackClock() - demo.starttime) - host.frametime;
if( curtime > demo.timestamp )
curtime = demo.timestamp; // don't run too far

CL_DemoFindInterpolatedViewAngles( curtime, &frac, &prev, &next );
CL_DemoFindInterpolatedViewAngles( curtime, &frac, &prev, &next );
}

if( prev && next )
{
Expand All @@ -1091,7 +1110,7 @@ void CL_DemoInterpolateAngles( void )
QuaternionSlerp( q2, q1, frac, q );
QuaternionAngle( q, cl.viewangles );
}
else if( cls.demoplayback != DEMO_QUAKE1 )
else if( cl.cmd != NULL )
VectorCopy( cl.cmd->viewangles, cl.viewangles );
}

Expand Down Expand Up @@ -1295,6 +1314,7 @@ void CL_CheckStartupDemos( void )

// run demos loop in background mode
Cvar_SetValue( "v_dark", 1.0f );
cls.demos_pending = false;
cls.demonum = 0;
CL_NextDemo ();
}
Expand All @@ -1304,11 +1324,10 @@ void CL_CheckStartupDemos( void )
CL_DemoGetName
==================
*/
void CL_DemoGetName( int lastnum, char *filename )
static void CL_DemoGetName( int lastnum, char *filename )
{
int a, b, c, d;

if( !filename ) return;
if( lastnum < 0 || lastnum > 9999 )
{
// bound
Expand Down Expand Up @@ -1584,17 +1603,15 @@ void CL_Demos_f( void )
return;
}

cls.demonum = cls.olddemonum;
// demos loop are not running
if( cls.olddemonum == -1 )
return;

if( cls.demonum == -1 )
cls.demonum = 0;
cls.demonum = cls.olddemonum;

// run demos loop in background mode
if( !SV_Active() && !cls.demoplayback )
{
// run demos loop in background mode
cls.changedemo = true;
CL_NextDemo ();
}
}


Expand Down
62 changes: 55 additions & 7 deletions engine/client/cl_frame.c
Expand Up @@ -96,7 +96,7 @@ we don't want interpolate this
*/
qboolean CL_EntityTeleported( cl_entity_t *ent )
{
int len, maxlen;
float len, maxlen;
vec3_t delta;

VectorSubtract( ent->curstate.origin, ent->prevstate.origin, delta );
Expand Down Expand Up @@ -407,7 +407,21 @@ int CL_InterpolateModel( cl_entity_t *e )
VectorCopy( e->curstate.origin, e->origin );
VectorCopy( e->curstate.angles, e->angles );

if( cls.timedemo || !e->model || cl.maxclients <= 1 )
if( cls.timedemo || !e->model )
return 1;

if( cls.demoplayback == DEMO_QUAKE1 )
{
// quake lerping is easy
VectorLerp( e->prevstate.origin, cl.lerpFrac, e->curstate.origin, e->origin );
AngleQuaternion( e->prevstate.angles, q1, false );
AngleQuaternion( e->curstate.angles, q2, false );
QuaternionSlerp( q1, q2, cl.lerpFrac, q );
QuaternionAngle( q, e->angles );
return 1;
}

if( cl.maxclients <= 1 )
return 1;

if( e->model->type == mod_brush && !cl_bmodelinterp->value )
Expand Down Expand Up @@ -474,12 +488,24 @@ interpolate non-local clients
void CL_ComputePlayerOrigin( cl_entity_t *ent )
{
float targettime;
vec4_t q, q1, q2;
vec3_t origin;
vec3_t angles;

if( !ent->player || ent->index == ( cl.playernum + 1 ))
return;

if( cls.demoplayback == DEMO_QUAKE1 )
{
// quake lerping is easy
VectorLerp( ent->prevstate.origin, cl.lerpFrac, ent->curstate.origin, ent->origin );
AngleQuaternion( ent->prevstate.angles, q1, false );
AngleQuaternion( ent->curstate.angles, q2, false );
QuaternionSlerp( q1, q2, cl.lerpFrac, q );
QuaternionAngle( q, ent->angles );
return;
}

targettime = cl.time - cl_interp->value;
CL_PureOrigin( ent, targettime, origin, angles );

Expand Down Expand Up @@ -985,9 +1011,12 @@ void CL_LinkPlayers( frame_t *frame )

if( i == cl.playernum )
{
VectorCopy( state->origin, ent->origin );
VectorCopy( state->origin, ent->prevstate.origin );
VectorCopy( state->origin, ent->curstate.origin );
if( cls.demoplayback != DEMO_QUAKE1 )
{
VectorCopy( state->origin, ent->origin );
VectorCopy( state->origin, ent->prevstate.origin );
VectorCopy( state->origin, ent->curstate.origin );
}
VectorCopy( ent->curstate.angles, ent->angles );
}

Expand All @@ -1003,6 +1032,8 @@ void CL_LinkPlayers( frame_t *frame )

if ( i == cl.playernum )
{
if( cls.demoplayback == DEMO_QUAKE1 )
VectorLerp( ent->prevstate.origin, cl.lerpFrac, ent->curstate.origin, cl.simorg );
VectorCopy( cl.simorg, ent->origin );
}
else
Expand Down Expand Up @@ -1321,8 +1352,25 @@ qboolean CL_GetEntitySpatialization( channel_t *ch )

qboolean CL_GetMovieSpatialization( rawchan_t *ch )
{
// UNDONE
return false;
cl_entity_t *ent;
qboolean valid_origin;

valid_origin = VectorIsNull( ch->origin ) ? false : true;
ent = CL_GetEntityByIndex( ch->entnum );

// entity is not present on the client but has valid origin
if( !ent || !ent->index || ent->curstate.messagenum == 0 )
return valid_origin;

// setup origin
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );

// setup radius
if( ent->model != NULL && ent->model->radius ) ch->radius = ent->model->radius;
else ch->radius = RadiusFromBounds( ent->curstate.mins, ent->curstate.maxs );

return true;
}

void CL_ExtraUpdate( void )
Expand Down
4 changes: 3 additions & 1 deletion engine/client/cl_gameui.c
Expand Up @@ -260,6 +260,8 @@ static void UI_ConvertGameInfo( GAMEINFO *out, gameinfo_t *in )

if( in->nomodels )
out->flags |= GFL_NOMODELS;
if( in->noskills )
out->flags |= GFL_NOSKILLS;
}

static qboolean PIC_Scissor( float *x, float *y, float *width, float *height, float *u0, float *v0, float *u1, float *v1 )
Expand Down Expand Up @@ -386,7 +388,7 @@ static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, long im
SetBits( flags, TF_IMAGE );

Image_SetForceFlags( IL_LOAD_DECAL ); // allow decal images for menu
tx = GL_LoadTexture( szPicName, image_buf, image_size, flags, NULL );
tx = GL_LoadTexture( szPicName, image_buf, image_size, flags );
Image_ClearForceFlags();

return tx;
Expand Down

0 comments on commit 2b11b50

Please sign in to comment.