summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rwxr-xr-xconfigure2
-rw-r--r--source/cl_demo.c33
-rw-r--r--source/cl_local.h2
-rw-r--r--source/cl_main.c12
-rw-r--r--source/q_shared.h4
6 files changed, 46 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 2cbcccb..3503b60 100644
--- a/Makefile
+++ b/Makefile
@@ -35,18 +35,6 @@ strip:
$(STRIP) $$t ; \
done
-tarball:
- mkdir -p baseq2pro
- mkdir -p openffa
- $(STRIP) q2pro.exe q2proded.exe
- $(STRIP) -o baseq2pro/ref_soft.dll ref_soft.dll
- $(STRIP) -o baseq2pro/ref_gl.dll ref_gl.dll
- $(STRIP) -o baseq2pro/mod_ui.dll mod_ui.dll
- $(STRIP) -o openffa/gamex86.dll gamex86.dll
- zip -9 ../q2pro-r${REVISION}-win32.zip q2pro.exe q2proded.exe baseq2pro/ref_soft.dll baseq2pro/ref_gl.dll baseq2pro/mod_ui.dll openffa/gamex86.dll
- rm -r baseq2pro
- rm -r openffa
-
tags:
ctags $(SRCDIR)/source/*.[ch] $(SRCDIR)/source/openffa/*.[ch]
diff --git a/configure b/configure
index 903005e..a66bf7f 100755
--- a/configure
+++ b/configure
@@ -50,7 +50,7 @@ logfile="console.log"
cfgfile="config.cfg"
defcfg="default.cfg"
autocfg="autoexec.cfg"
-revision="162"
+revision="163"
tmpc="/tmp/q2pro-${RANDOM}.c"
tmpo="/tmp/q2pro-${RANDOM}.o"
diff --git a/source/cl_demo.c b/source/cl_demo.c
index 21e14a3..24c1f9b 100644
--- a/source/cl_demo.c
+++ b/source/cl_demo.c
@@ -135,7 +135,7 @@ void CL_EmitDemoFrame( void ) {
} else {
oldframe = &cl.frames[cl.demoframe & UPDATE_MASK];
oldstate = &oldframe->ps;
- lastframe = cl.demoframe;
+ lastframe = cl.demoframe + cl.demodelta;
if( oldframe->number != cl.demoframe || !oldframe->valid ||
cl.numEntityStates - oldframe->firstEntity > MAX_PARSE_ENTITIES )
{
@@ -146,7 +146,7 @@ void CL_EmitDemoFrame( void ) {
}
MSG_WriteByte( svc_frame );
- MSG_WriteLong( cl.frame.number );
+ MSG_WriteLong( cl.frame.number + cl.demodelta );
MSG_WriteLong( lastframe ); // what we are delta'ing from
MSG_WriteByte( 0 ); // rate dropped packets
@@ -173,6 +173,31 @@ void CL_EmitDemoFrame( void ) {
SZ_Clear( &msg_write );
}
+void CL_EmitZeroFrame( void ) {
+ cl.demodelta++;
+
+ MSG_WriteByte( svc_frame );
+ MSG_WriteLong( cl.frame.number + cl.demodelta );
+ MSG_WriteLong( cl.frame.number + cl.demodelta - 1 ); // what we are delta'ing from
+ MSG_WriteByte( 0 ); // rate dropped packets
+
+ // send over the areabits
+ MSG_WriteByte( cl.frame.areabytes );
+ MSG_WriteData( cl.frame.areabits, cl.frame.areabytes );
+
+ MSG_WriteByte( svc_playerinfo );
+ MSG_WriteShort( 0 );
+ MSG_WriteLong( 0 );
+
+ MSG_WriteByte( svc_packetentities );
+ MSG_WriteShort( 0 );
+
+ CL_WriteDemoMessage( &msg_write );
+
+ SZ_Clear( &msg_write );
+}
+
+
/*
====================
CL_Stop_f
@@ -608,10 +633,6 @@ void CL_DemoFrame( void ) {
return;
}
- if( cls.demorecording && cl_paused->integer == 2 ) {
- // CL_RecordPause();
- }
-
while( cl.serverTime < cl.time ) {
CL_ParseNextDemoMessage();
if( cls.state != ca_active ) {
diff --git a/source/cl_local.h b/source/cl_local.h
index ce13d3e..c9ed33c 100644
--- a/source/cl_local.h
+++ b/source/cl_local.h
@@ -127,6 +127,7 @@ typedef struct client_state_s {
int lastframe;
int demoframe;
+ int demodelta;
// the client maintains its own idea of view angles, which are
// sent to the server each frame. It is cleared to 0 upon entering each level.
@@ -585,6 +586,7 @@ void CL_TrapParticles (entity_t *ent);
//
void CL_InitDemos( void );
void CL_DemoFrame( void );
+void CL_EmitZeroFrame( void );
void CL_WriteDemoMessage( sizebuf_t *buf );
void CL_EmitDemoFrame( void );
void CL_Stop_f( void );
diff --git a/source/cl_main.c b/source/cl_main.c
index 1e62c65..fa31834 100644
--- a/source/cl_main.c
+++ b/source/cl_main.c
@@ -2606,6 +2606,18 @@ void CL_Frame( int msec ) {
// read next demo frame
if( cls.demoplayback ) {
+ if( cls.demorecording && cl_paused->integer == 2 ) {
+ static int demo_extra;
+
+ // XXX: record zero frames when manually paused
+ // for syncing with audio comments, etc
+ demo_extra += main_extra;
+ if( demo_extra > 100 ) {
+ CL_EmitZeroFrame();
+ demo_extra = 0;
+ }
+ }
+
CL_DemoFrame();
}
diff --git a/source/q_shared.h b/source/q_shared.h
index 3edc5af..5611caf 100644
--- a/source/q_shared.h
+++ b/source/q_shared.h
@@ -33,7 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define q_printf( f, a ) __attribute__((format( printf, f, a )))
#define q_noreturn __attribute__((noreturn))
#define q_malloc __attribute__((malloc))
+#if __GNUC__ >= 4
#define q_sentinel __attribute__((sentinel))
+#else
+#define q_sentinel
+#endif
#define q_likely( x ) __builtin_expect( !!(x), 1 )
#define q_unlikely( x ) __builtin_expect( !!(x), 0 )