int main( int argc, char **argv ) { if( argc < 2 ) { Com_Error( ERR_FATAL, "Usage: dm68 [demofile]\n" ); } if( !(demo.demofile=fopen( argv[1], "rb" )) ) { Com_Error( ERR_FATAL, "Couldn't open demofile" ); } Huff_Init(); Com_Printf("---\n"); while( !demo.gameStatesParsed ) { if( !Parse_NextDemoMessage() ) { break; } } GameStateParsed(); Com_Printf("prints:\n"); while( 1 ) { if( !Parse_NextDemoMessage() ) { break; } NewFrameParsed(); } fclose( demo.demofile ); return EXIT_SUCCESS; }
void MSG_initHuffman() { int i,j; msgInit = qtrue; Huff_Init(&msgHuff); for(i=0;i<256;i++) { for (j=0;j<msg_hData[i];j++) { Huff_addRef(&msgHuff.compressor, (byte)i); // Do update Huff_addRef(&msgHuff.decompressor, (byte)i); // Do update } } }
/* =============== Netchan_Init =============== */ void Netchan_Init( void ) { int port; // pick a port value that should be nice and random port = Com_RandomLong( 1, 65535 ); net_showpackets = Cvar_Get ("net_showpackets", "0", 0, "show network packets" ); net_chokeloopback = Cvar_Get( "net_chokeloop", "0", 0, "apply bandwidth choke to loopback packets" ); net_drawslider = Cvar_Get( "net_drawslider", "0", CVAR_ARCHIVE, "draw completion slider during signon" ); net_blocksize = Cvar_Get( "net_blocksize", "1024", 0, "network file fragmentation block size" ); net_showdrop = Cvar_Get( "net_showdrop", "0", 0, "show packets that are dropped" ); net_speeds = Cvar_Get( "net_speeds", "0", CVAR_ARCHIVE, "show network packets" ); net_qport = Cvar_Get( "net_qport", va( "%i", port ), CVAR_INIT, "current quake netport" ); net_mempool = Mem_AllocPool( "Network Pool" ); Huff_Init (); // initialize huffman compression BF_InitMasks (); // initialize bit-masks }