10 Sep 2010

This commit is contained in:
g-cont 2010-09-10 00:00:00 +04:00 committed by Alibek Omarov
parent a100005969
commit 195a6c7ea7
32 changed files with 145 additions and 743 deletions

View File

@ -114,13 +114,6 @@
// entity flags
#define EFLAG_SLERP 1 // do studio interpolation of this entity
// classic quake flags (must be not collide with any dll spawnflags - engine uses this)
// please include string "allow_inhibited_entities" into your gameinfo.txt if you want to enable this feature
#define SF_NOT_EASY (1<<8)
#define SF_NOT_MEDIUM (1<<9)
#define SF_NOT_HARD (1<<10)
#define SF_NOT_DEATHMATCH (1<<11)
//
// temp entity events (engine ignore it)

View File

@ -1,250 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: hl - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1731.tmp" with contents
[
/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\dlls" /I "..\common" /I "..\game_shared" /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\hl\!debug/" /Fo"..\temp\hl\!debug/" /Fd"..\temp\hl\!debug/" /FD /c
"D:\Xash3D\src_main\dlls\aflock.cpp"
"D:\Xash3D\src_main\dlls\agrunt.cpp"
"D:\Xash3D\src_main\dlls\airtank.cpp"
"D:\Xash3D\src_main\dlls\animating.cpp"
"D:\Xash3D\src_main\dlls\animation.cpp"
"D:\Xash3D\src_main\dlls\apache.cpp"
"D:\Xash3D\src_main\dlls\barnacle.cpp"
"D:\Xash3D\src_main\dlls\barney.cpp"
"D:\Xash3D\src_main\dlls\bigmomma.cpp"
"D:\Xash3D\src_main\dlls\bloater.cpp"
"D:\Xash3D\src_main\dlls\bmodels.cpp"
"D:\Xash3D\src_main\dlls\bullsquid.cpp"
"D:\Xash3D\src_main\dlls\buttons.cpp"
"D:\Xash3D\src_main\dlls\cbase.cpp"
"D:\Xash3D\src_main\dlls\client.cpp"
"D:\Xash3D\src_main\dlls\combat.cpp"
"D:\Xash3D\src_main\dlls\controller.cpp"
"D:\Xash3D\src_main\dlls\crossbow.cpp"
"D:\Xash3D\src_main\dlls\crowbar.cpp"
"D:\Xash3D\src_main\dlls\defaultai.cpp"
"D:\Xash3D\src_main\dlls\doors.cpp"
"D:\Xash3D\src_main\dlls\effects.cpp"
"D:\Xash3D\src_main\dlls\egon.cpp"
"D:\Xash3D\src_main\dlls\explode.cpp"
"D:\Xash3D\src_main\dlls\flyingmonster.cpp"
"D:\Xash3D\src_main\dlls\func_break.cpp"
"D:\Xash3D\src_main\dlls\func_tank.cpp"
"D:\Xash3D\src_main\dlls\game.cpp"
"D:\Xash3D\src_main\dlls\gamerules.cpp"
"D:\Xash3D\src_main\dlls\gargantua.cpp"
"D:\Xash3D\src_main\dlls\gauss.cpp"
"D:\Xash3D\src_main\dlls\genericmonster.cpp"
"D:\Xash3D\src_main\dlls\ggrenade.cpp"
"D:\Xash3D\src_main\dlls\globals.cpp"
"D:\Xash3D\src_main\dlls\glock.cpp"
"D:\Xash3D\src_main\dlls\gman.cpp"
"D:\Xash3D\src_main\dlls\h_ai.cpp"
"D:\Xash3D\src_main\dlls\h_battery.cpp"
"D:\Xash3D\src_main\dlls\h_cine.cpp"
"D:\Xash3D\src_main\dlls\h_cycler.cpp"
"D:\Xash3D\src_main\dlls\h_export.cpp"
"D:\Xash3D\src_main\dlls\handgrenade.cpp"
"D:\Xash3D\src_main\dlls\hassassin.cpp"
"D:\Xash3D\src_main\dlls\headcrab.cpp"
"D:\Xash3D\src_main\dlls\healthkit.cpp"
"D:\Xash3D\src_main\dlls\hgrunt.cpp"
"D:\Xash3D\src_main\dlls\hornet.cpp"
"D:\Xash3D\src_main\dlls\hornetgun.cpp"
"D:\Xash3D\src_main\dlls\houndeye.cpp"
"D:\Xash3D\src_main\dlls\ichthyosaur.cpp"
"D:\Xash3D\src_main\dlls\islave.cpp"
"D:\Xash3D\src_main\dlls\items.cpp"
"D:\Xash3D\src_main\dlls\leech.cpp"
"D:\Xash3D\src_main\dlls\lights.cpp"
"D:\Xash3D\src_main\dlls\maprules.cpp"
"D:\Xash3D\src_main\dlls\monstermaker.cpp"
"D:\Xash3D\src_main\dlls\monsters.cpp"
"D:\Xash3D\src_main\dlls\monsterstate.cpp"
"D:\Xash3D\src_main\dlls\mortar.cpp"
"D:\Xash3D\src_main\dlls\mp5.cpp"
"D:\Xash3D\src_main\dlls\multiplay_gamerules.cpp"
"D:\Xash3D\src_main\dlls\nihilanth.cpp"
"D:\Xash3D\src_main\dlls\nodes.cpp"
"D:\Xash3D\src_main\dlls\osprey.cpp"
"D:\Xash3D\src_main\dlls\pathcorner.cpp"
"D:\Xash3D\src_main\dlls\plane.cpp"
"D:\Xash3D\src_main\dlls\plats.cpp"
"D:\Xash3D\src_main\dlls\player.cpp"
"D:\Xash3D\src_main\game_shared\pm_debug.cpp"
"D:\Xash3D\src_main\game_shared\pm_math.cpp"
"D:\Xash3D\src_main\game_shared\pm_shared.cpp"
"D:\Xash3D\src_main\dlls\python.cpp"
"D:\Xash3D\src_main\dlls\rat.cpp"
"D:\Xash3D\src_main\dlls\roach.cpp"
"D:\Xash3D\src_main\dlls\rpg.cpp"
"D:\Xash3D\src_main\dlls\satchel.cpp"
"D:\Xash3D\src_main\dlls\schedule.cpp"
"D:\Xash3D\src_main\dlls\scientist.cpp"
"D:\Xash3D\src_main\dlls\scripted.cpp"
"D:\Xash3D\src_main\dlls\shotgun.cpp"
"D:\Xash3D\src_main\dlls\singleplay_gamerules.cpp"
"D:\Xash3D\src_main\dlls\skill.cpp"
"D:\Xash3D\src_main\dlls\sound.cpp"
"D:\Xash3D\src_main\dlls\soundent.cpp"
"D:\Xash3D\src_main\dlls\spectator.cpp"
"D:\Xash3D\src_main\dlls\squadmonster.cpp"
"D:\Xash3D\src_main\dlls\squeakgrenade.cpp"
"D:\Xash3D\src_main\dlls\subs.cpp"
"D:\Xash3D\src_main\dlls\talkmonster.cpp"
"D:\Xash3D\src_main\dlls\teamplay_gamerules.cpp"
"D:\Xash3D\src_main\dlls\tempmonster.cpp"
"D:\Xash3D\src_main\dlls\tentacle.cpp"
"D:\Xash3D\src_main\dlls\triggers.cpp"
"D:\Xash3D\src_main\dlls\tripmine.cpp"
"D:\Xash3D\src_main\dlls\turret.cpp"
"D:\Xash3D\src_main\dlls\util.cpp"
"D:\Xash3D\src_main\dlls\weapons.cpp"
"D:\Xash3D\src_main\dlls\world.cpp"
"D:\Xash3D\src_main\dlls\xen.cpp"
"D:\Xash3D\src_main\dlls\zombie.cpp"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1731.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1732.tmp" with contents
[
msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\hl\!debug/hl.pdb" /debug /machine:I386 /nodefaultlib:"libc.lib" /def:".\hl.def" /out:"..\temp\hl\!debug/hl.dll" /implib:"..\temp\hl\!debug/hl.lib" /pdbtype:sept
"\Xash3D\src_main\temp\hl\!debug\aflock.obj"
"\Xash3D\src_main\temp\hl\!debug\agrunt.obj"
"\Xash3D\src_main\temp\hl\!debug\airtank.obj"
"\Xash3D\src_main\temp\hl\!debug\animating.obj"
"\Xash3D\src_main\temp\hl\!debug\animation.obj"
"\Xash3D\src_main\temp\hl\!debug\apache.obj"
"\Xash3D\src_main\temp\hl\!debug\barnacle.obj"
"\Xash3D\src_main\temp\hl\!debug\barney.obj"
"\Xash3D\src_main\temp\hl\!debug\bigmomma.obj"
"\Xash3D\src_main\temp\hl\!debug\bloater.obj"
"\Xash3D\src_main\temp\hl\!debug\bmodels.obj"
"\Xash3D\src_main\temp\hl\!debug\bullsquid.obj"
"\Xash3D\src_main\temp\hl\!debug\buttons.obj"
"\Xash3D\src_main\temp\hl\!debug\cbase.obj"
"\Xash3D\src_main\temp\hl\!debug\client.obj"
"\Xash3D\src_main\temp\hl\!debug\combat.obj"
"\Xash3D\src_main\temp\hl\!debug\controller.obj"
"\Xash3D\src_main\temp\hl\!debug\crossbow.obj"
"\Xash3D\src_main\temp\hl\!debug\crowbar.obj"
"\Xash3D\src_main\temp\hl\!debug\defaultai.obj"
"\Xash3D\src_main\temp\hl\!debug\doors.obj"
"\Xash3D\src_main\temp\hl\!debug\effects.obj"
"\Xash3D\src_main\temp\hl\!debug\egon.obj"
"\Xash3D\src_main\temp\hl\!debug\explode.obj"
"\Xash3D\src_main\temp\hl\!debug\flyingmonster.obj"
"\Xash3D\src_main\temp\hl\!debug\func_break.obj"
"\Xash3D\src_main\temp\hl\!debug\func_tank.obj"
"\Xash3D\src_main\temp\hl\!debug\game.obj"
"\Xash3D\src_main\temp\hl\!debug\gamerules.obj"
"\Xash3D\src_main\temp\hl\!debug\gargantua.obj"
"\Xash3D\src_main\temp\hl\!debug\gauss.obj"
"\Xash3D\src_main\temp\hl\!debug\genericmonster.obj"
"\Xash3D\src_main\temp\hl\!debug\ggrenade.obj"
"\Xash3D\src_main\temp\hl\!debug\globals.obj"
"\Xash3D\src_main\temp\hl\!debug\glock.obj"
"\Xash3D\src_main\temp\hl\!debug\gman.obj"
"\Xash3D\src_main\temp\hl\!debug\h_ai.obj"
"\Xash3D\src_main\temp\hl\!debug\h_battery.obj"
"\Xash3D\src_main\temp\hl\!debug\h_cine.obj"
"\Xash3D\src_main\temp\hl\!debug\h_cycler.obj"
"\Xash3D\src_main\temp\hl\!debug\h_export.obj"
"\Xash3D\src_main\temp\hl\!debug\handgrenade.obj"
"\Xash3D\src_main\temp\hl\!debug\hassassin.obj"
"\Xash3D\src_main\temp\hl\!debug\headcrab.obj"
"\Xash3D\src_main\temp\hl\!debug\healthkit.obj"
"\Xash3D\src_main\temp\hl\!debug\hgrunt.obj"
"\Xash3D\src_main\temp\hl\!debug\hornet.obj"
"\Xash3D\src_main\temp\hl\!debug\hornetgun.obj"
"\Xash3D\src_main\temp\hl\!debug\houndeye.obj"
"\Xash3D\src_main\temp\hl\!debug\ichthyosaur.obj"
"\Xash3D\src_main\temp\hl\!debug\islave.obj"
"\Xash3D\src_main\temp\hl\!debug\items.obj"
"\Xash3D\src_main\temp\hl\!debug\leech.obj"
"\Xash3D\src_main\temp\hl\!debug\lights.obj"
"\Xash3D\src_main\temp\hl\!debug\maprules.obj"
"\Xash3D\src_main\temp\hl\!debug\monstermaker.obj"
"\Xash3D\src_main\temp\hl\!debug\monsters.obj"
"\Xash3D\src_main\temp\hl\!debug\monsterstate.obj"
"\Xash3D\src_main\temp\hl\!debug\mortar.obj"
"\Xash3D\src_main\temp\hl\!debug\mp5.obj"
"\Xash3D\src_main\temp\hl\!debug\multiplay_gamerules.obj"
"\Xash3D\src_main\temp\hl\!debug\nihilanth.obj"
"\Xash3D\src_main\temp\hl\!debug\nodes.obj"
"\Xash3D\src_main\temp\hl\!debug\osprey.obj"
"\Xash3D\src_main\temp\hl\!debug\pathcorner.obj"
"\Xash3D\src_main\temp\hl\!debug\plane.obj"
"\Xash3D\src_main\temp\hl\!debug\plats.obj"
"\Xash3D\src_main\temp\hl\!debug\player.obj"
"\Xash3D\src_main\temp\hl\!debug\pm_debug.obj"
"\Xash3D\src_main\temp\hl\!debug\pm_math.obj"
"\Xash3D\src_main\temp\hl\!debug\pm_shared.obj"
"\Xash3D\src_main\temp\hl\!debug\python.obj"
"\Xash3D\src_main\temp\hl\!debug\rat.obj"
"\Xash3D\src_main\temp\hl\!debug\roach.obj"
"\Xash3D\src_main\temp\hl\!debug\rpg.obj"
"\Xash3D\src_main\temp\hl\!debug\satchel.obj"
"\Xash3D\src_main\temp\hl\!debug\schedule.obj"
"\Xash3D\src_main\temp\hl\!debug\scientist.obj"
"\Xash3D\src_main\temp\hl\!debug\scripted.obj"
"\Xash3D\src_main\temp\hl\!debug\shotgun.obj"
"\Xash3D\src_main\temp\hl\!debug\singleplay_gamerules.obj"
"\Xash3D\src_main\temp\hl\!debug\skill.obj"
"\Xash3D\src_main\temp\hl\!debug\sound.obj"
"\Xash3D\src_main\temp\hl\!debug\soundent.obj"
"\Xash3D\src_main\temp\hl\!debug\spectator.obj"
"\Xash3D\src_main\temp\hl\!debug\squadmonster.obj"
"\Xash3D\src_main\temp\hl\!debug\squeakgrenade.obj"
"\Xash3D\src_main\temp\hl\!debug\subs.obj"
"\Xash3D\src_main\temp\hl\!debug\talkmonster.obj"
"\Xash3D\src_main\temp\hl\!debug\teamplay_gamerules.obj"
"\Xash3D\src_main\temp\hl\!debug\tempmonster.obj"
"\Xash3D\src_main\temp\hl\!debug\tentacle.obj"
"\Xash3D\src_main\temp\hl\!debug\triggers.obj"
"\Xash3D\src_main\temp\hl\!debug\tripmine.obj"
"\Xash3D\src_main\temp\hl\!debug\turret.obj"
"\Xash3D\src_main\temp\hl\!debug\util.obj"
"\Xash3D\src_main\temp\hl\!debug\weapons.obj"
"\Xash3D\src_main\temp\hl\!debug\world.obj"
"\Xash3D\src_main\temp\hl\!debug\xen.obj"
"\Xash3D\src_main\temp\hl\!debug\zombie.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1732.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1733.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\hl\!debug\hl.dll "D:\Xash3D\valve\bin\server.dll"
]
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSP1733.bat""
Compiling...
aflock.cpp
agrunt.cpp
airtank.cpp
animating.cpp
animation.cpp
apache.cpp
barnacle.cpp
barney.cpp
bigmomma.cpp
bloater.cpp
bmodels.cpp
bullsquid.cpp
buttons.cpp
cbase.cpp
client.cpp
combat.cpp
controller.cpp
crossbow.cpp
crowbar.cpp
defaultai.cpp
cl.exe terminated at user request.
</pre>
</body>
</html>

View File

@ -765,7 +765,7 @@ void CL_PrepSound( void )
{
int i, sndcount;
MsgDev( D_LOAD, "CL_PrepSound: %s\n", cl.configstrings[CS_NAME] );
MsgDev( D_NOTE, "CL_PrepSound: %s\n", cl.configstrings[CS_NAME] );
for( i = 0, sndcount = 0; i < MAX_SOUNDS && cl.configstrings[CS_SOUNDS+i+1][0]; i++ )
sndcount++; // total num sounds
@ -800,7 +800,7 @@ void CL_PrepVideo( void )
return; // no map loaded
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
MsgDev( D_LOAD, "CL_PrepVideo: %s\n", cl.configstrings[CS_NAME] );
MsgDev( D_NOTE, "CL_PrepVideo: %s\n", cl.configstrings[CS_NAME] );
// let the render dll load the map
com.strncpy( mapname, cl.configstrings[CS_MODELS+1], MAX_STRING );

View File

@ -31,7 +31,7 @@
#define MAX_HEARTBEAT -99999 // connection time
#ifdef _DEBUG
void DBG_AssertFunction( BOOL fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage );
void DBG_AssertFunction( bool fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage );
#define Assert( f ) DBG_AssertFunction( f, #f, __FILE__, __LINE__, NULL )
#else
#define Assert( f )

View File

@ -10,7 +10,7 @@
#include "bspfile.h"
#ifdef _DEBUG
void DBG_AssertFunction( BOOL fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage )
void DBG_AssertFunction( bool fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage )
{
if( fExpr ) return;

View File

@ -17,6 +17,7 @@ cvar_t *con_fontsize;
#define CON_TIMES 5 // need for 4 lines
#define COLOR_DEFAULT '7'
#define CON_HISTORY 32
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
#define CON_TEXTSIZE 131072 // 128 kb buffer

View File

@ -392,7 +392,8 @@ void Con_DPrintf( char *szFmt, ... )
char buffer[2048]; // must support > 1k messages
va_list args;
if( !host.developer ) return;
if( host.developer < D_AICONSOLE )
return;
va_start( args, szFmt );
com.vsnprintf( buffer, 2048, szFmt, args );

View File

@ -2174,10 +2174,10 @@ static void pfnAlertMessage( ALERT_TYPE level, char *szFmt, ... )
com.print( buffer );
break;
case at_warning:
com.print( va("^3Warning:^7 %s", buffer ));
com.print( va( "^3Warning:^7 %s", buffer ));
break;
case at_error:
com.print( va("^1Error:^7 %s", buffer ));
com.print( va( "^1Error:^7 %s", buffer ));
break;
}
}
@ -3767,39 +3767,11 @@ void SV_LoadFromFile( script_t *entities )
if( !SV_ParseEdict( entities, ent ))
continue;
// remove things from different skill levels or deathmatch
if( deathmatch )
{
if( ent->v.spawnflags & SF_NOT_DEATHMATCH )
{
SV_FreeEdict( ent );
inhibited++;
continue;
}
}
else if( GI->sp_inhibite_ents && current_skill == 0 && ent->v.spawnflags & SF_NOT_EASY )
{
SV_FreeEdict( ent );
inhibited++;
continue;
}
else if( GI->sp_inhibite_ents && current_skill == 1 && ent->v.spawnflags & SF_NOT_MEDIUM )
{
SV_FreeEdict( ent );
inhibited++;
continue;
}
else if( GI->sp_inhibite_ents && current_skill >= 2 && ent->v.spawnflags & SF_NOT_HARD )
{
SV_FreeEdict( ent );
inhibited++;
continue;
}
if( svgame.dllFuncs.pfnSpawn( ent ) == -1 )
died++;
else spawned++;
}
MsgDev( D_INFO, "%i entities inhibited\n", inhibited );
}

View File

@ -1343,8 +1343,12 @@ void SV_Physics_Step( edict_t *ent )
speed = com.sqrt( vel[0] * vel[0] + vel[1] * vel[1] );
// add ground speed
if( ent->v.groundentity->v.flags & FL_CONVEYOR )
speed += ent->v.groundentity->v.speed;
if( ent->v.groundentity )
{
if( ent->v.groundentity->v.flags & FL_CONVEYOR )
speed += ent->v.groundentity->v.speed;
}
if( speed )
{

View File

@ -120,6 +120,7 @@ hull_t *SV_HullForEntity( edict_t *ent, int hullNumber, vec3_t mins, vec3_t maxs
if( hullNumber == -1 )
{
#if 1
float curdiff;
float lastdiff = 999;
int i;
@ -138,6 +139,31 @@ hull_t *SV_HullForEntity( edict_t *ent, int hullNumber, vec3_t mins, vec3_t maxs
lastdiff = curdiff;
}
}
#else
if( size[0] < 3 )
{
// point hull
hullNumber = 0;
}
else if( size[0] <= 36 )
{
if( size[2] <= 36 )
{
// head hull (ducked)
hullNumber = 3;
}
else
{
// human hull
hullNumber = 1;
}
}
else
{
// large hull
hullNumber = 2;
}
#endif
}
// TraceHull stuff

View File

@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ID_YES 9
#define ID_NO 10
#define MAX_MODS 128 // engine limit
#define MAX_MODS 512 // engine limit
#define TYPE_LENGTH 16
#define NAME_LENGTH 32+TYPE_LENGTH

View File

@ -280,7 +280,7 @@ void Cmd_Exec_f( void )
return;
}
com.strncpy( cfgpath, Cmd_Argv( 1 ), MAX_STRING );
com.strncpy( cfgpath, Cmd_Argv( 1 ), sizeof( cfgpath ));
FS_DefaultExtension( cfgpath, ".cfg" ); // append as default
f = FS_LoadFile( cfgpath, &len );
@ -328,7 +328,7 @@ typedef struct cmd_function_s
} cmd_function_t;
static int cmd_argc;
static char *cmd_argv[MAX_STRING_TOKENS];
static char *cmd_argv[MAX_CMD_TOKENS];
static char cmd_tokenized[MAX_CMD_BUFFER]; // will have 0 bytes inserted
static cmd_function_t *cmd_functions; // possible commands to execute
@ -400,7 +400,7 @@ void Cmd_TokenizeString( const char *text_in )
while( 1 )
{
// this is usually something malicious
if( cmd_argc == MAX_STRING_TOKENS ) return;
if( cmd_argc == MAX_CMD_TOKENS ) return;
while( 1 )
{

View File

@ -187,7 +187,7 @@ long _stdcall Con_InputLineProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
Msg( ">%s\n", inputBuffer );
// copy line to history buffer
com_strncpy( s_wcd.historyLines[s_wcd.nextHistoryLine % COMMAND_HISTORY], inputBuffer, MAX_STRING );
com.strncpy( s_wcd.historyLines[s_wcd.nextHistoryLine % COMMAND_HISTORY], inputBuffer, MAX_STRING );
s_wcd.nextHistoryLine++;
s_wcd.historyLine = s_wcd.nextHistoryLine;
return 0;
@ -303,7 +303,7 @@ void Con_CreateConsole( void )
rect.right = 536;
rect.top = 0;
rect.bottom = 280;
com.strncpy( FontName, "Arial", MAX_STRING );
com.strncpy( FontName, "Arial", sizeof( FontName ));
fontsize = 16;
}
else if( Sys.con_readonly )
@ -312,7 +312,7 @@ void Con_CreateConsole( void )
rect.right = 536;
rect.top = 0;
rect.bottom = 364;
com.strncpy( FontName, "Fixedsys", MAX_STRING );
com.strncpy( FontName, "Fixedsys", sizeof( FontName ));
fontsize = 8;
}
else // dedicated console
@ -321,11 +321,11 @@ void Con_CreateConsole( void )
rect.right = 640;
rect.top = 0;
rect.bottom = 392;
com.strncpy( FontName, "System", MAX_STRING );
com.strncpy( FontName, "System", sizeof( FontName ));
fontsize = 14;
}
com.strncpy( Title, Sys.caption, MAX_STRING );
com.strncpy( Title, Sys.caption, sizeof( Title ));
AdjustWindowRect( &rect, DEDSTYLE, FALSE );
hDC = GetDC( GetDesktopWindow() );
@ -484,11 +484,11 @@ void Sys_CloseLog( void )
// continue logged
switch( Sys.app_state )
{
case SYS_CRASH: com_strncpy( event_name, "crashed", MAX_STRING ); break;
case SYS_ABORT: com_strncpy( event_name, "aborted by user", MAX_STRING ); break;
case SYS_ERROR: com_strncpy( event_name, "stopped with error", MAX_STRING ); break;
case SYS_RESTART: com_strncpy( event_name, "restarted", MAX_STRING ); break;
default: com_strncpy( event_name, "stopped", MAX_STRING ); break;
case SYS_CRASH: com_strncpy( event_name, "crashed", sizeof( event_name )); break;
case SYS_ABORT: com_strncpy( event_name, "aborted by user", sizeof( event_name )); break;
case SYS_ERROR: com_strncpy( event_name, "stopped with error", sizeof( event_name )); break;
case SYS_RESTART: com_strncpy( event_name, "restarted", sizeof( event_name )); break;
default: com_strncpy( event_name, "stopped", sizeof( event_name )); break;
}
if( Sys.logfile )

View File

@ -195,10 +195,6 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags, const
Mem_Free( var->reset_string );
var->reset_string = copystring( var_value );
}
else if( var_value[0] && com.strcmp( var->reset_string, var_value ))
{
MsgDev( D_STRING, "cvar \"%s\" given initial values: \"%s\" and \"%s\"\n", var_name, var->reset_string, var_value );
}
// if we have a latched string, take that value now
if( var->latched_string )
@ -711,7 +707,7 @@ weren't declared in C code.
void Cvar_Set_f( void )
{
int i, c, l = 0, len;
char combined[MAX_STRING_TOKENS];
char combined[MAX_CMD_TOKENS];
c = Cmd_Argc();
if( c < 3 )
@ -724,7 +720,7 @@ void Cvar_Set_f( void )
for( i = 2; i < c; i++ )
{
len = com.strlen( Cmd_Argv(i) + 1 );
if ( l + len >= MAX_STRING_TOKENS - 2 )
if ( l + len >= MAX_CMD_TOKENS - 2 )
break;
com.strcat( combined, Cmd_Argv(i));
if ( i != c-1 ) com.strcat( combined, " " );

View File

@ -349,7 +349,7 @@ pack_t *FS_LoadPackPK3( const char *packfile )
return NULL;
}
MsgDev( D_LOAD, "Adding packfile %s (%i files)\n", packfile, real_nb_files );
MsgDev( D_NOTE, "Adding packfile %s (%i files)\n", packfile, real_nb_files );
return pack;
}
@ -782,7 +782,7 @@ pack_t *FS_LoadPackPAK( const char *packfile )
}
Mem_Free( info );
MsgDev( D_LOAD, "Adding packfile: %s (%i files)\n", packfile, numpackfiles );
MsgDev( D_NOTE, "Adding packfile: %s (%i files)\n", packfile, numpackfiles );
return pack;
}
@ -857,7 +857,7 @@ pack_t *FS_LoadPackPK2(const char *packfile)
}
Mem_Free( info );
MsgDev( D_LOAD, "Adding packfile %s (%i files)\n", packfile, numpackfiles );
MsgDev( D_NOTE, "Adding packfile %s (%i files)\n", packfile, numpackfiles );
return pack;
}
@ -1016,7 +1016,7 @@ static bool FS_AddWad_Fullpath( const char *wadfile, bool *already_loaded, bool
search->next = fs_searchpaths;
fs_searchpaths = search;
}
MsgDev( D_LOAD, "Adding wadfile %s (%i files)\n", wadfile, wad->numlumps );
MsgDev( D_NOTE, "Adding wadfile %s (%i files)\n", wadfile, wad->numlumps );
return true;
}
else
@ -1026,39 +1026,6 @@ static bool FS_AddWad_Fullpath( const char *wadfile, bool *already_loaded, bool
}
}
/*
================
FS_AddPack
Adds the given pack to the search path and searches for it in the game path.
The pack type is autodetected by the file extension.
Returns true if the file was successfully added to the
search path or if it was already included.
If keep_plain_dirs is set, the pack will be added AFTER the first sequence of
plain directories.
================
*/
bool FS_AddPack( const char *pakfile, bool *already_loaded, bool keep_plain_dirs )
{
char fullpath[ MAX_STRING ];
searchpath_t *search;
int index;
if( already_loaded ) *already_loaded = false;
// then find the real name...
search = FS_FindFile( pakfile, &index, true, false );
if( !search || search->pack )
{
MsgDev( D_WARN, "FS_AddPack: could not find pak \"%s\"\n", pakfile );
return false;
}
com.sprintf( fullpath, "%s%s", search->filename, pakfile );
return FS_AddPack_Fullpath( fullpath, already_loaded, keep_plain_dirs, 0 );
}
/*
================
FS_AddGameDirectory
@ -1417,26 +1384,15 @@ static bool FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
case 2: FS_Print( f, "gamemode\t\t\"multiplayer_only\"\n" ); break;
}
switch( GameInfo->viewmode )
{
case 1: FS_Print( f, "viewmode\t\t\"firstperson\"\n" ); break;
case 2: FS_Print( f, "viewmode\t\t\"thirdperson\"\n" ); break;
}
if( com.strlen( GameInfo->sp_entity ))
FS_Printf( f, "sp_spawn\t\t\"%s\"\n", GameInfo->sp_entity );
if( com.strlen( GameInfo->dm_entity ))
FS_Printf( f, "dm_spawn\t\t\"%s\"\n", GameInfo->dm_entity );
if( com.strlen( GameInfo->ctf_entity ))
FS_Printf( f, "ctf_spawn\t\t\"%s\"\n", GameInfo->sp_entity );
if( com.strlen( GameInfo->coop_entity ))
FS_Printf( f, "coop_spawn\t\"%s\"\n", GameInfo->coop_entity );
if( com.strlen( GameInfo->team_entity ))
FS_Printf( f, "team_spawn\t\"%s\"\n", GameInfo->team_entity );
if( GameInfo->sp_inhibite_ents )
FS_Print( f, "allow_inhibited_entities\n" );
for( i = 0; i < 4; i++ )
{
float *min, *max;
@ -1449,12 +1405,6 @@ static bool FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
FS_Printf( f, "hull%i\t\t( %g %g %g ) ( %g %g %g )\n", i, min[0], min[1], min[2], max[0], max[1], max[2] );
}
for( i = 0; i < 4; i++ )
{
if( GameInfo->viewheight[i] == 0.0f ) continue;
FS_Printf( f, "viewheight%i\t%g\n", i, GameInfo->viewheight[i] );
}
if( GameInfo->max_edicts > 0 )
FS_Printf( f, "max_edicts\t%i\n", GameInfo->max_edicts );
@ -1478,20 +1428,16 @@ void FS_CreateDefaultGameInfo( const char *filename )
// setup default values
defGI.max_edicts = 1024; // default value if not specified
defGI.version = 1.0;
defGI.viewheight[0] = 28.0f;
defGI.viewheight[1] = 12.0f;
defGI.sp_inhibite_ents = false;
com.strncpy( defGI.gameHint, "Half-Life", MAX_STRING );
com.strncpy( defGI.title, "New Game", MAX_STRING );
com.strncpy( defGI.gamedir, gs_basedir, MAX_STRING );
com.strncpy( defGI.basedir, fs_defaultdir->string, MAX_STRING );
com.strncpy( defGI.sp_entity, "info_player_start", MAX_STRING );
com.strncpy( defGI.dm_entity, "info_player_deathmatch", MAX_STRING );
com.strncpy( defGI.ctf_entity, "info_player_ctf", MAX_STRING );
com.strncpy( defGI.coop_entity, "info_player_coop", MAX_STRING );
com.strncpy( defGI.team_entity, "info_player_team", MAX_STRING );
com.strncpy( defGI.startmap, "newmap", MAX_STRING );
com.strncpy( defGI.gameHint, "Half-Life", sizeof( defGI.gameHint ));
com.strncpy( defGI.title, "New Game", sizeof( defGI.title ));
com.strncpy( defGI.gamedir, gs_basedir, sizeof( defGI.gamedir ));
com.strncpy( defGI.basedir, fs_defaultdir->string, sizeof( defGI.basedir ));
com.strncpy( defGI.sp_entity, "info_player_start", sizeof( defGI.sp_entity ));
com.strncpy( defGI.dm_entity, "info_player_deathmatch", sizeof( defGI.dm_entity ));
com.strncpy( defGI.coop_entity, "info_player_coop", sizeof( defGI.coop_entity ));
com.strncpy( defGI.team_entity, "info_player_team", sizeof( defGI.team_entity ));
com.strncpy( defGI.startmap, "newmap", sizeof( defGI.startmap ));
VectorSet( defGI.client_mins[0], 0, 0, 0 );
VectorSet( defGI.client_maxs[0], 0, 0, 0 );
@ -1517,21 +1463,17 @@ static bool FS_ParseLiblistGam( const char *filename, const char *gamedir, gamei
// setup default values
GameInfo->max_edicts = 1024; // default value if not specified
GameInfo->version = 1.0;
GameInfo->viewheight[0] = 28.0f;
GameInfo->viewheight[1] = 12.0f;
GameInfo->sp_inhibite_ents = false;
GameInfo->version = 1.0f;
com.strncpy( GameInfo->gameHint, "Half-Life", MAX_STRING );
com.strncpy( GameInfo->title, "New Game", MAX_STRING );
com.strncpy( GameInfo->gamedir, gamedir, MAX_STRING );
com.strncpy( GameInfo->basedir, "valve", MAX_STRING ); // all liblist.gam have 'valve' as basedir
com.strncpy( GameInfo->sp_entity, "info_player_start", MAX_STRING );
com.strncpy( GameInfo->dm_entity, "info_player_deathmatch", MAX_STRING );
com.strncpy( GameInfo->ctf_entity, "info_player_ctf", MAX_STRING );
com.strncpy( GameInfo->coop_entity, "info_player_coop", MAX_STRING );
com.strncpy( GameInfo->team_entity, "info_player_team", MAX_STRING );
com.strncpy( GameInfo->startmap, "newmap", MAX_STRING );
com.strncpy( GameInfo->gameHint, "Half-Life", sizeof( GameInfo->gameHint ));
com.strncpy( GameInfo->title, "New Game", sizeof( GameInfo->title ));
com.strncpy( GameInfo->gamedir, gamedir, sizeof( GameInfo->gamedir ));
com.strncpy( GameInfo->basedir, "valve", sizeof( GameInfo->basedir )); // all liblist.gam have 'valve' as basedir
com.strncpy( GameInfo->sp_entity, "info_player_start", sizeof( GameInfo->sp_entity ));
com.strncpy( GameInfo->dm_entity, "info_player_deathmatch", sizeof( GameInfo->dm_entity ));
com.strncpy( GameInfo->coop_entity, "info_player_coop", sizeof( GameInfo->coop_entity ));
com.strncpy( GameInfo->team_entity, "info_player_team", sizeof( GameInfo->team_entity ));
com.strncpy( GameInfo->startmap, "newmap", sizeof( GameInfo->startmap ));
VectorSet( GameInfo->client_mins[0], 0, 0, 0 );
VectorSet( GameInfo->client_maxs[0], 0, 0, 0 );
@ -1658,21 +1600,17 @@ static bool FS_ParseGameInfo( const char *gamedir, gameinfo_t *GameInfo )
if( !script ) return false;
// setup default values
com.strncpy( GameInfo->gamefolder, gamedir, MAX_STRING );
com.strncpy( GameInfo->gamefolder, gamedir, sizeof( GameInfo->gamefolder ));
GameInfo->max_edicts = 1024; // default value if not specified
GameInfo->version = 1.0;
GameInfo->viewheight[0] = 28.0f;
GameInfo->viewheight[1] = 12.0f;
GameInfo->sp_inhibite_ents = false;
GameInfo->version = 1.0f;
com.strncpy( GameInfo->gameHint, "Half-Life", MAX_STRING );
com.strncpy( GameInfo->title, "New Game", MAX_STRING );
com.strncpy( GameInfo->sp_entity, "info_player_start", MAX_STRING );
com.strncpy( GameInfo->dm_entity, "info_player_deathmatch", MAX_STRING );
com.strncpy( GameInfo->ctf_entity, "info_player_ctf", MAX_STRING );
com.strncpy( GameInfo->coop_entity, "info_player_coop", MAX_STRING );
com.strncpy( GameInfo->team_entity, "info_player_team", MAX_STRING );
com.strncpy( GameInfo->startmap, "", MAX_STRING );
com.strncpy( GameInfo->gameHint, "Half-Life", sizeof( GameInfo->gameHint ));
com.strncpy( GameInfo->title, "New Game", sizeof( GameInfo->title ));
com.strncpy( GameInfo->sp_entity, "info_player_start", sizeof( GameInfo->sp_entity ));
com.strncpy( GameInfo->dm_entity, "info_player_deathmatch", sizeof( GameInfo->dm_entity ));
com.strncpy( GameInfo->coop_entity, "info_player_coop", sizeof( GameInfo->coop_entity ));
com.strncpy( GameInfo->team_entity, "info_player_team", sizeof( GameInfo->team_entity ));
com.strncpy( GameInfo->startmap, "", sizeof( GameInfo->startmap ));
VectorSet( GameInfo->client_mins[0], 0, 0, 0 );
VectorSet( GameInfo->client_maxs[0], 0, 0, 0 );
@ -1690,15 +1628,15 @@ static bool FS_ParseGameInfo( const char *gamedir, gameinfo_t *GameInfo )
if( !com.stricmp( token.string, "basedir" ))
{
PS_GetString( script, false, fs_path, MAX_STRING );
PS_GetString( script, false, fs_path, sizeof( fs_path ));
if( com.stricmp( fs_path, GameInfo->basedir ) || com.stricmp( fs_path, GameInfo->gamedir ))
com.strncpy( GameInfo->basedir, fs_path, MAX_STRING );
com.strncpy( GameInfo->basedir, fs_path, sizeof( GameInfo->basedir ));
}
else if( !com.stricmp( token.string, "gamedir" ))
{
PS_GetString( script, false, fs_path, MAX_STRING );
PS_GetString( script, false, fs_path, sizeof( fs_path ));
if( com.stricmp( fs_path, GameInfo->basedir ) || com.stricmp( fs_path, GameInfo->gamedir ))
com.strncpy( GameInfo->gamedir, fs_path, MAX_STRING );
com.strncpy( GameInfo->gamedir, fs_path, sizeof( GameInfo->gamedir ));
}
else if( !com.stricmp( token.string, "title" ))
{
@ -1716,10 +1654,6 @@ static bool FS_ParseGameInfo( const char *gamedir, gameinfo_t *GameInfo )
{
PS_GetString( script, false, GameInfo->dm_entity, sizeof( GameInfo->dm_entity ));
}
else if( !com.stricmp( token.string, "ctf_spawn" ))
{
PS_GetString( script, false, GameInfo->ctf_entity, sizeof( GameInfo->ctf_entity ));
}
else if( !com.stricmp( token.string, "coop_spawn" ))
{
PS_GetString( script, false, GameInfo->coop_entity, sizeof( GameInfo->coop_entity ));
@ -1765,24 +1699,11 @@ static bool FS_ParseGameInfo( const char *gamedir, gameinfo_t *GameInfo )
PS_ReadToken( script, 0, &token );
GameInfo->size = com.atoi( token.string );
}
else if( !com.stricmp( token.string, "allow_inhibited_entities" ))
{
MsgDev( D_INFO, "GameInfo: Q1-like inhibite entities mode enabled\n" );
GameInfo->sp_inhibite_ents = true;
}
else if( !com.stricmp( token.string, "max_edicts" ))
{
PS_GetInteger( script, false, &GameInfo->max_edicts );
GameInfo->max_edicts = bound( 600, GameInfo->max_edicts, 32000 ); // reserve some edicts for tempents
}
else if( !com.stricmp( token.string, "viewmode" ))
{
PS_ReadToken( script, 0, &token );
if( !com.stricmp( token.string, "firstperson" ))
GameInfo->viewmode = 1;
else if( !com.stricmp( token.string, "thirdperson" ))
GameInfo->viewmode = 2;
}
else if( !com.stricmp( token.string, "gamemode" ))
{
PS_ReadToken( script, 0, &token );
@ -1806,22 +1727,6 @@ static bool FS_ParseGameInfo( const char *gamedir, gameinfo_t *GameInfo )
FS_ParseVector( script, GameInfo->client_maxs[hullNum], 3 );
}
}
else if( !com.strnicmp( token.string, "viewheight", 10 ))
{
int hullNum = com.atoi( token.string + 10 );
float value;
if( hullNum < 0 || hullNum > 3 )
{
MsgDev( D_ERROR, "FS_ParseGameInfo: Invalid hull number %i. Ignored.\n", hullNum );
PS_SkipRestOfLine( script );
}
else
{
if( PS_GetFloat( script, false, &value ))
GameInfo->viewheight[hullNum] = value;
}
}
}
PS_FreeScript( script );

View File

@ -366,7 +366,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
// this name will be used only for tell user about problems
if( format->loadfunc( path, f, filesize ))
{
com.snprintf( sidename, MAX_STRING, "%s%s.%s", loadname, cmap->type[i].suf, format->ext );
com.snprintf( sidename, sizeof( sidename ), "%s%s.%s", loadname, cmap->type[i].suf, format->ext );
if( FS_AddSideToPack( sidename, cmap->type[i].flags )) // process flags to flip some sides
{
Mem_Free( f );

View File

@ -22,7 +22,7 @@
#define XASH_VERSION 0.72f // current version will be shared across gameinfo struct
#define MAX_NUM_ARGVS 128
#define MAX_STRING_TOKENS 80
#define MAX_CMD_TOKENS 80
#define LOG_QUEUE_SIZE 131072 // 128 kb intermediate buffer
// just for last chanse to view message (debug only)
@ -219,8 +219,6 @@ bool com_stricmpext( const char *s1, const char *s2 );
const char* com_timestamp( int format );
char *com_stristr( const char *string, const char *string2 );
char *com_strstr( const char *string, const char *string2 );
size_t com_strpack( byte *buffer, size_t pos, char *string, int n );
size_t com_strunpack( byte *buffer, size_t pos, char *string );
int com_vsnprintf(char *buffer, size_t buffersize, const char *format, va_list args);
int com_vsprintf(char *buffer, const char *format, va_list args);
int com_snprintf(char *buffer, size_t buffersize, const char *format, ...);
@ -273,12 +271,6 @@ byte *_mem_allocpool(const char *name, const char *filename, int fileline);
void _mem_freepool(byte **poolptr, const char *filename, int fileline);
void _mem_emptypool(byte *poolptr, const char *filename, int fileline);
void _mem_free(void *data, const char *filename, int fileline);
byte *_mem_alloc_array( byte *poolptr, size_t recordsize, int count, const char *filename, int fileline );
void _mem_free_array( byte *arrayptr, const char *filename, int fileline );
void *_mem_alloc_array_element( byte *arrayptr, const char *filename, int fileline );
void _mem_free_array_element( byte *arrayptr, void *element, const char *filename, int fileline );
void *_mem_get_array_element( byte *arrayptr, size_t index );
size_t _mem_array_size( byte *arrayptr );
void _mem_check(const char *filename, int fileline);
bool _is_allocated( byte *poolptr, void *data );
@ -291,12 +283,6 @@ bool _is_allocated( byte *poolptr, void *data );
#define Mem_Move(pool, dest, src, size ) _mem_move(pool, dest, src, size, __FILE__, __LINE__)
#define Mem_Copy(dest, src, size ) com.memcpy(dest, src, size, __FILE__, __LINE__)
#define Mem_Set(dest, val, size ) com.memset(dest, val, size, __FILE__, __LINE__)
#define Mem_CreateArray( p, s, n ) _mem_alloc_array( p, s, n, __FILE__, __LINE__)
#define Mem_RemoveArray( array ) _mem_free_array( array, __FILE__, __LINE__)
#define Mem_AllocElement( array ) _mem_alloc_array_element( array, __FILE__, __LINE__)
#define Mem_FreeElement( array, el ) _mem_free_array_element( array, el, __FILE__, __LINE__ )
#define Mem_GetElement( array, idx ) _mem_get_array_element( array, idx )
#define Mem_ArraySize( array ) _mem_array_size( array )
#define Mem_IsAllocated( mem ) _is_allocated( NULL, mem )
#define Mem_Check() _mem_check(__FILE__, __LINE__)
#define Mem_Pretify( x ) com_pretifymem(x, 3)

View File

@ -352,7 +352,7 @@ void *MemoryLoadLibrary( const char *name )
DWORD locationDelta;
DllEntryProc DllEntry;
string errorstring;
BOOL successfull;
bool successfull;
void *data = NULL;
data = FS_LoadFile( name, NULL );

View File

@ -74,17 +74,6 @@ typedef struct memcluster_s
size_t numflaggedrecords;
} memcluster_t;
typedef struct memarray_s
{
byte *mempool;
size_t recordsize;
size_t count;
size_t numarrays;
size_t maxarrays;
memcluster_t *arrays;
} memarray_t;
mempool_t *poolchain = NULL; // critical stuff
// crt safe version
@ -968,8 +957,6 @@ choseclump:
if (mem->next) mem->next->prev = mem;
com.memset((void *)((byte *) mem + sizeof(memheader_t)), 0, mem->size, filename, fileline );
MsgDev( D_MEMORY, "Mem_Alloc: \"%s\"[%s], at (%s:%i)\n", pool->name, com_pretifymem( size, 1 ), filename, fileline );
return (void *)((byte *) mem + sizeof(memheader_t));
}
@ -1012,7 +999,6 @@ static void _mem_freeblock(memheader_t *mem, const char *filename, int fileline)
// memheader has been unlinked, do the actual free now
pool->totalsize -= mem->size;
MsgDev( D_MEMORY, "Mem_Free: \"%s\"[%s], at (%s:%i)\n", pool->name, com_pretifymem( mem->size, 1 ), filename, fileline );
if((clump = mem->clump))
{
if (clump->sentinel1 != MEMCLUMP_SENTINEL)
@ -1134,7 +1120,6 @@ byte *_mem_allocpool(const char *name, const char *filename, int fileline)
pool->next = poolchain;
poolchain = pool;
MsgDev( D_MEMORY, "Create pool: \"%s\", at (%s:%i)\n", pool->name, filename, fileline );
return (byte *)((mempool_t *)pool);
}
@ -1152,8 +1137,6 @@ void _mem_freepool(byte **poolptr, const char *filename, int fileline)
if (pool->sentinel2 != MEMHEADER_SENTINEL1) Sys_Error("Mem_FreePool: trashed pool sentinel 2 (allocpool at %s:%i, freepool at %s:%i)\n", pool->filename, pool->fileline, filename, fileline);
*chainaddress = pool->next;
MsgDev(D_MEMORY, "Free pool: \"%s\", at (%s:%i)\n", pool->name, filename, fileline );
// free memory owned by the pool
while (pool->chain) _mem_freeblock( pool->chain, filename, fileline );
// free the pool itself
@ -1210,131 +1193,6 @@ bool _is_allocated( byte *poolptr, void *data )
return _mem_allocated( pool, data );
}
byte *_mem_alloc_array( byte *poolptr, size_t recordsize, int count, const char *filename, int fileline )
{
memarray_t *l = _mem_alloc( poolptr, sizeof(memarray_t), filename, fileline);
l->mempool = poolptr;
l->recordsize = recordsize;
l->count = count;
return (byte *)((memarray_t *)l);
}
void _mem_free_array( byte *arrayptr, const char *filename, int fileline )
{
memarray_t *l = (memarray_t *)((byte *)arrayptr);
size_t i;
if(l == NULL) Sys_Error("Mem_RemoveArray: array == NULL (called at %s:%i)\n", filename, fileline );
if (l->maxarrays)
{
for (i = 0; i != l->numarrays; i++)
_mem_free(l->arrays[i].data, filename, fileline );
_mem_free(l->arrays, filename, fileline );
}
_mem_free( l, filename, fileline); // himself
}
void *_mem_alloc_array_element( byte *arrayptr, const char *filename, int fileline )
{
memarray_t *l = (memarray_t *)((byte *)arrayptr);
size_t i, j;
if(l == NULL) Sys_Error("Mem_AllocElement: array == NULL (called at %s:%i)\n", filename, fileline );
for(i = 0; ; i++)
{
if(i == l->numarrays)
{
if (l->numarrays == l->maxarrays)
{
memcluster_t *oldarrays = l->arrays;
l->maxarrays = max(l->maxarrays * 2, 128);
l->arrays = _mem_alloc( l->mempool, l->maxarrays * sizeof(*l->arrays), filename, fileline);
if (oldarrays)
{
com.memcpy(l->arrays, oldarrays, l->numarrays * sizeof(*l->arrays), filename, fileline);
_mem_free(oldarrays, filename, fileline);
}
}
l->arrays[i].numflaggedrecords = 0;
l->arrays[i].data = _mem_alloc(l->mempool, (l->recordsize + 1) * l->count, filename, fileline);
l->arrays[i].allocflags = l->arrays[i].data + l->recordsize * l->count;
l->numarrays++;
}
if(l->arrays[i].numflaggedrecords < l->count)
{
for (j = 0; j < l->count; j++)
{
if(!l->arrays[i].allocflags[j])
{
l->arrays[i].allocflags[j] = true;
l->arrays[i].numflaggedrecords++;
return (void *)(l->arrays[i].data + l->recordsize * j);
}
}
}
}
}
void _mem_free_array_element( byte *arrayptr, void *element, const char *filename, int fileline )
{
size_t i, j;
byte *p = (byte *)element;
memarray_t *l = (memarray_t *)((byte *)arrayptr);
if(l == NULL) Sys_Error("Mem_FreeElement: array == NULL (called at %s:%i)\n", filename, fileline );
for (i = 0; i != l->numarrays; i++)
{
if(p >= l->arrays[i].data && p < (l->arrays[i].data + l->recordsize * l->count))
{
j = (p - l->arrays[i].data) / l->recordsize;
if (p != l->arrays[i].data + j * l->recordsize)
Sys_Error("Mem_FreeArrayElement: no such element %p\n", p);
if (!l->arrays[i].allocflags[j])
Sys_Error("Mem_FreeArrayElement: element %p is already free!\n", p);
l->arrays[i].allocflags[j] = false;
l->arrays[i].numflaggedrecords--;
return;
}
}
}
size_t _mem_array_size( byte *arrayptr )
{
size_t i, j, k;
memarray_t *l = (memarray_t *)((byte *)arrayptr);
if(l && l->numarrays)
{
i = l->numarrays - 1;
for (j = 0, k = 0; k < l->arrays[i].numflaggedrecords; j++)
if (l->arrays[i].allocflags[j]) k++;
return l->count * i + j;
}
return 0;
}
void *_mem_get_array_element( byte *arrayptr, size_t index )
{
size_t i, j;
memarray_t *l = (memarray_t *)((byte *)arrayptr);
if(!l) return NULL;
i = index / l->count;
j = index % l->count;
if (i >= l->numarrays || !l->arrays[i].allocflags[j])
return NULL;
return (void *)(l->arrays[i].data + j * l->recordsize);
}
void _mem_checkheadersentinels( void *data, const char *filename, int fileline )
{
memheader_t *mem;

View File

@ -1336,10 +1336,11 @@ void PS_ScriptError( script_t *script, scFlags_t flags, const char *fmt, ... )
string errorstring;
va_list argPtr;
if(!(flags & SC_PRINT_ERRORS)) return;
if(!( flags & SC_PRINT_ERRORS ))
return;
va_start( argPtr, fmt );
com_vsnprintf( errorstring, MAX_STRING, fmt, argPtr );
com_vsnprintf( errorstring, sizeof( errorstring ), fmt, argPtr );
va_end( argPtr );
MsgDev( D_ERROR, "source '%s', line %i: %s\n", script->name, script->line, errorstring );
@ -1355,10 +1356,11 @@ void PS_ScriptWarning( script_t *script, scFlags_t flags, const char *fmt, ... )
string warnstring;
va_list argPtr;
if(!(flags & SC_PRINT_WARNINGS)) return;
if(!( flags & SC_PRINT_WARNINGS ))
return;
va_start( argPtr, fmt );
com.vsnprintf( warnstring, MAX_STRING, fmt, argPtr );
com.vsnprintf( warnstring, sizeof( warnstring ), fmt, argPtr );
va_end( argPtr );
MsgDev( D_WARN, "source '%s', line %i: %s\n", script->name, script->line, warnstring );

View File

@ -209,7 +209,6 @@ char *com_stralloc( byte *mempool, const char *s, const char *filename, int file
if( !s ) return NULL;
if( !mempool ) mempool = Sys.stringpool;
MsgDev( D_STRING, "new system string %p\n", s );
b = _mem_alloc( mempool, com_strlen(s) + 1, filename, fileline );
com_strcpy( b, s );
@ -328,7 +327,7 @@ void com_atov( float *vec, const char *str, size_t siz )
char *pstr, *pfront;
int j;
com.strncpy( buffer, str, MAX_STRING );
com.strncpy( buffer, str, sizeof( buffer ));
Mem_Set( vec, 0, sizeof(vec_t) * siz );
pstr = pfront = buffer;
@ -540,7 +539,7 @@ const char* com_timestamp( int format )
default: return NULL;
}
com.strncpy( timestamp, timestring, MAX_STRING );
com.strncpy( timestamp, timestring, sizeof( timestamp ));
return timestamp;
}
@ -586,30 +585,6 @@ char *com_stristr( const char *string, const char *string2 )
return (char *)string;
}
size_t com_strpack( byte *buffer, size_t pos, char *string, int n )
{
if(!buffer || !string) return 0;
n++; // get space for terminator
com_strncpy(buffer + pos, string, n );
return pos + n;
}
size_t com_strunpack( byte *buffer, size_t pos, char *string )
{
int n = 0;
char *in;
if(!buffer || !string) return 0;
in = buffer + pos;
do { in++, n++; } while(*in != '\0' && in != NULL );
com_strncpy( string, in - (n - 1), n );
return pos + n;
}
int com_vsnprintf(char *buffer, size_t buffersize, const char *format, va_list args)
{
int result;

View File

@ -73,12 +73,6 @@ void Sys_GetStdAPI( void )
com.freepool = _mem_freepool;
com.clearpool = _mem_emptypool;
com.memcheck = _mem_check;
com.newarray = _mem_alloc_array;
com.delarray = _mem_free_array;
com.newelement = _mem_alloc_array_element;
com.delelement = _mem_free_array_element;
com.getelement = _mem_get_array_element;
com.arraysize = _mem_array_size;
// network.c funcs
com.NET_Init = NET_Init;
@ -271,8 +265,6 @@ void Sys_GetStdAPI( void )
com.strcmp = com_strcmp;
com.stristr = com_stristr;
com.strstr = com_strstr;
com.strpack = com_strpack;
com.strunpack = com_strunpack;
com.vsprintf = com_vsprintf;
com.sprintf = com_sprintf;
com.va = va;
@ -642,9 +634,7 @@ void Sys_Print( const char *pMsg )
Sys_PrintLog( logbuf );
// don't flood system console with memory allocation messages or another
if( Sys.Con_Print && Sys.printlevel < D_MEMORY )
Sys.Con_Print( buffer );
Sys.Con_Print( buffer );
Sys.printlevel = 0; // reset before next message
}
@ -682,27 +672,17 @@ void Sys_MsgDev( int level, const char *pMsg, ... )
switch( level )
{
case D_INFO:
Sys_Print( text );
break;
case D_WARN:
Sys_Print(va("^3Warning:^7 %s", text));
Sys_Print( va( "^3Warning:^7 %s", text ));
break;
case D_ERROR:
Sys_Print(va("^1Error:^7 %s", text));
break;
case D_LOAD:
Sys_Print(va("^2Loading: ^7%s", text));
Sys_Print( va( "^1Error:^7 %s", text ));
break;
case D_INFO:
case D_NOTE:
case D_AICONSOLE:
Sys_Print( text );
break;
case D_MEMORY:
Sys_Print( text );
break;
case D_STRING:
Sys_Print(va("^6AllocString: ^7%s", text));
break;
}
}

View File

@ -216,7 +216,7 @@ int StringTable_CreateNewSystem( const char *name, size_t max_strings )
// found free slot
dstring[i] = Mem_Alloc( Sys.basepool, sizeof( stringtable_t ));
dstring[i]->mempool = Mem_AllocPool( va( "StringTable_%s", name ));
com.strncpy( dstring[i]->name, name, MAX_STRING );
com.strncpy( dstring[i]->name, name, sizeof( dstring[i]->name ));
dstring[i]->maxdatasize = max_strings * 8;
dstring[i]->maxstrings = max_strings;
#ifdef ST_STATIC_ALLOCATE

View File

@ -16,8 +16,7 @@
#define MAX_INFO_STRING 256 // infostrings are transmitted across network
#define MAX_SYSPATH 1024 // system filepath
#define bound(min, num, max) ((num) >= (min) ? ((num) < (max) ? (num) : (max)) : (min))
#define MAX_MODS 128 // environment games that engine can keep visible
#define MAP_DEFAULT_SHADER "*black" // engine built-in default shader
#define MAX_MODS 512 // environment games that engine can keep visible
#define MAX_STRING_TABLES 8 // seperately stringsystems
#define DLLEXPORT __declspec( dllexport )
#define BIT( n ) (1<<( n ))
@ -25,7 +24,6 @@
#define NULL ((void *)0)
// color strings
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
#define IsColorString( p ) ( p && *( p ) == '^' && *(( p ) + 1) && *(( p ) + 1) >= '0' && *(( p ) + 1 ) <= '9' )
#ifndef __cplusplus
@ -35,7 +33,6 @@
#include "const.h"
typedef int BOOL;
typedef int func_t;
typedef int sound_t;
typedef int shader_t;
typedef vec_t vec2_t[2];
@ -69,10 +66,8 @@ enum dev_level
D_INFO = 1, // "-dev 1", shows various system messages
D_WARN, // "-dev 2", shows not critical system warnings
D_ERROR, // "-dev 3", shows critical warnings
D_LOAD, // "-dev 4", show messages about loading resources
D_NOTE, // "-dev 5", show system notifications for engine develeopers
D_MEMORY, // "-dev 6", writes to log memory allocation
D_STRING, // "-dev 7", writes to log tempstrings allocation
D_AICONSOLE, // "-dev 4", special case for game aiconsole
D_NOTE, // "-dev 5", show system notifications for engine developers
};
typedef long fs_offset_t;
@ -83,7 +78,6 @@ typedef struct script_s script_t; // script machine
typedef struct stream_s stream_t; // sound stream for background music playing
typedef struct { const char *name; void **func; } dllfunc_t; // Sys_LoadLibrary stuff
typedef struct { int numfilenames; char **filenames; char *filenamesbuffer; } search_t;
typedef void ( *cmsave_t )( void* handle, const void* buffer, size_t size );
typedef void ( *cmdraw_t )( int color, int numpoints, const float *points );
typedef void ( *setpair_t )( const char *key, const char *value, void *buffer, void *numpairs );
typedef enum { NS_CLIENT, NS_SERVER } netsrc_t;
@ -210,13 +204,13 @@ internal shared gameinfo structure (readonly for engine parts)
typedef struct gameinfo_s
{
// filesystem info
string gamefolder; // used for change game '-game x'
string basedir; // main game directory (like 'id1' for Quake or 'valve' for Half-Life)
string gamedir; // game directory (can be match with basedir, used as primary dir and as write path
string startmap; // map to start singleplayer game
string trainmap; // map to start hazard course (if specified)
string title; // Game Main Title
string gameHint; // hint to configure ImageLib and SoundLib
char gamefolder[64]; // used for change game '-game x'
char basedir[64]; // main game directory (like 'id1' for Quake or 'valve' for Half-Life)
char gamedir[64]; // game directory (can be match with basedir, used as primary dir and as write path
char startmap[64]; // map to start singleplayer game
char trainmap[64]; // map to start hazard course (if specified)
char title[64]; // Game Main Title
char gameHint[32]; // hint to configure ImageLib and SoundLib
float version; // game version (optional)
// path info
@ -225,25 +219,22 @@ typedef struct gameinfo_s
// about mod info
string game_url; // link to a developer's site
string update_url; // link to updates page
string type; // single, toolkit, multiplayer etc
string date;
char type[64]; // single, toolkit, multiplayer etc
char date[64];
size_t size;
int viewmode;
int gamemode;
int sp_inhibite_ents; // allows spawnflags to inhibite entities like in q1
string sp_entity; // e.g. info_player_start
string dm_entity; // e.g. info_player_deathmatch
string coop_entity; // e.g. info_player_coop
string ctf_entity; // e.g. info_player_ctf
string team_entity; // e.g. info_player_team
char sp_entity[32]; // e.g. info_player_start
char dm_entity[32]; // e.g. info_player_deathmatch
char coop_entity[32]; // e.g. info_player_coop
char team_entity[32]; // e.g. info_player_team
vec3_t client_mins[4]; // 4 hulls allowed
vec3_t client_maxs[4]; // 4 hulls allowed
float viewheight[4]; // client viewheight (from hull center)
int max_edicts; // min edicts is 600, max edicts is 32000
int max_edicts; // min edicts is 600, max edicts is 4096
} gameinfo_t;
typedef struct sysinfo_s
@ -423,9 +414,9 @@ typedef enum
// imagelib global settings
typedef enum
{
SL_USE_LERPING = BIT(0), // lerping sounds during resample
SL_KEEP_8BIT = BIT(1), // don't expand 8bit sounds automatically up to 16 bit
SL_ALLOW_OVERWRITE = BIT(2), // allow to overwrite stored sounds
SL_USE_LERPING = BIT(0), // lerping sounds during resample
SL_KEEP_8BIT = BIT(1), // don't expand 8bit sounds automatically up to 16 bit
SL_ALLOW_OVERWRITE = BIT(2), // allow to overwrite stored sounds
} slFlags_t;
// wavdata output flags
@ -471,7 +462,7 @@ typedef struct stdilib_api_s
size_t api_size; // must matched with sizeof(launch_exp_t)
size_t com_size; // must matched with sizeof(stdlib_api_t)
sysinfo_t *SysInfo; // engine sysinfo (filled by engine)
sysinfo_t *SysInfo; // engine sysinfo (filled by launcher)
// base events
void (*instance)( const char *name, const char *fmsg ); // restart engine with new instance
@ -505,22 +496,12 @@ typedef struct stdilib_api_s
void (*move)(byte *pool, void **dest, void *src, size_t size, const char *file, int line); // not a memmove
void *(*malloc)(byte *pool, size_t size, const char *file, int line);
void (*free)(void *data, const char *file, int line);
// xash memlib extension - memory pools
byte *(*mallocpool)(const char *name, const char *file, int line);
void (*freepool)(byte **poolptr, const char *file, int line);
void (*clearpool)(byte *poolptr, const char *file, int line);
void (*memcheck)(const char *file, int line); // check memory pools for consistensy
bool (*is_allocated)( byte *poolptr, void *data ); // return true is memory is allocated
// xash memlib extension - memory arrays
byte *(*newarray)( byte *pool, size_t elementsize, int count, const char *file, int line );
void (*delarray)( byte *array, const char *file, int line );
void *(*newelement)( byte *array, const char *file, int line );
void (*delelement)( byte *array, void *element, const char *file, int line );
void *(*getelement)( byte *array, size_t index );
size_t (*arraysize)( byte *arrayptr );
// network.c funcs
void (*NET_Init)( void );
void (*NET_Shutdown)( void );
@ -547,7 +528,7 @@ typedef struct stdilib_api_s
long (*Com_FileSize)(const char *filename); // same as Com_FileExists but return filesize
long (*Com_FileTime)(const char *filename); // same as Com_FileExists but return filetime
const char *(*Com_FileExtension)(const char *in); // return extension of file
const char *(*Com_RemovePath)(const char *in); // return file without path
const char *(*Com_RemovePath)(const char *in); // return filename without path
void (*Com_StripExtension)(char *path); // remove extension if present
void (*Com_StripFilePath)(const char* const src, char* dst);// get file path without filename.ext
void (*Com_DefaultExtension)(char *path, const char *ext ); // append extension if not present
@ -602,9 +583,9 @@ typedef struct stdilib_api_s
char *(*Cmd_Args)( void );
char *(*Cmd_Argv)( uint arg );
void (*Cmd_LookupCmds)( char *buffer, void *ptr, setpair_t callback );
void (*Cmd_AddCommand)(const char *name, xcommand_t function, const char *desc);
void (*Cmd_TokenizeString)(const char *text_in);
void (*Cmd_DelCommand)(const char *name);
void (*Cmd_AddCommand)( const char *name, xcommand_t function, const char *desc );
void (*Cmd_TokenizeString)( const char *text_in );
void (*Cmd_DelCommand)( const char *name );
// real filesystem
file_t *(*fopen)(const char* path, const char* mode); // same as fopen
@ -643,7 +624,7 @@ typedef struct stdilib_api_s
long (*wfwrite)( wfile_t *wad, const char *lump, const void* data, size_t size, char type, char cmp );
byte *(*wfread)( wfile_t *wad, const char *lump, size_t *lumpsizeptr, const char type );
// filesystem simply user interface
// filesystem simple user interface
byte *(*Com_LoadFile)(const char *path, long *filesize ); // load file into heap
bool (*Com_WriteFile)(const char *path, const void *data, long len ); // write file into disk
bool (*Com_LoadLibrary)( const char *name, dll_info_t *dll ); // load library
@ -714,8 +695,6 @@ typedef struct stdilib_api_s
int (*strcmp)(const char *s1, const char *s2); // compare strings with case sensative
char *(*stristr)( const char *s1, const char *s2 ); // find s2 in s1 with case insensative
char *(*strstr)( const char *s1, const char *s2 ); // find s2 in s1 with case sensative
size_t (*strpack)( byte *buf, size_t pos, char *s1, int n ); // put string at end ofbuffer
size_t (*strunpack)( byte *buf, size_t pos, char *s1 ); // extract string from buffer
int (*vsprintf)(char *buf, const char *fmt, va_list args); // format message
int (*sprintf)(char *buffer, const char *format, ...); // print into buffer
char *(*va)(const char *format, ...); // print into temp buffer
@ -781,12 +760,6 @@ typedef struct script_s
#define Mem_Set(dest, val, size ) com.memset(dest, val, size, __FILE__, __LINE__)
#define Mem_Check() com.memcheck(__FILE__, __LINE__)
#define Mem_IsAllocated( pool, ptr ) com.is_allocated( pool, ptr )
#define Mem_CreateArray( p, s, n ) com.newarray( p, s, n, __FILE__, __LINE__)
#define Mem_RemoveArray( array ) com.delarray( array, __FILE__, __LINE__)
#define Mem_AllocElement( array ) com.newelement( array, __FILE__, __LINE__)
#define Mem_FreeElement( array, el ) com.delelement( array, el, __FILE__, __LINE__ )
#define Mem_GetElement( array, idx ) com.getelement( array, idx )
#define Mem_ArraySize( array ) com.arraysize( array )
/*
==========================================

View File

@ -7,6 +7,8 @@
#include "ref_params.h"
#define MAP_DEFAULT_SHADER "*black" // engine built-in default shader
// shader types used for shader loading
#define SHADER_SKY 1 // sky box shader
#define SHADER_NOMIP 2 // 2d images

View File

@ -3019,7 +3019,6 @@ texture_t *R_LoadTexture( const char *name, rgbdata_t *pic, int samples, texFlag
R_UploadTexture( pic, texture );
GL_TexFilter( texture ); // update texture filter, wrap etc
MsgDev( D_LOAD, "%s [%s] \n", name, PFDesc( image_desc.format )->name );
// add to hash table
hash = Com_HashKey( texture->name, TEXTURES_HASH_SIZE );

View File

@ -131,7 +131,7 @@ enum
#define LIGHTMAP_TEXTURE_WIDTH 256
#define LIGHTMAP_TEXTURE_HEIGHT 256
#define VID_DEFAULTMODE "0"
#define VID_DEFAULTMODE "3"
#define SHADOW_PLANAR 1
#define SHADOW_MAPPING 2

View File

@ -1317,7 +1317,7 @@ static void Mod_LoadTextures( const dlump_t *l )
if( altanims[j] ) altmax = j + 1;
}
MsgDev( D_LOAD, "linking animation %s ( %i:%i frames )\n", tx1->name, max, altmax );
MsgDev( D_NOTE, "linking animation %s ( %i:%i frames )\n", tx1->name, max, altmax );
incomplete = false;
for( j = 0; j < max; j++ )

View File

@ -127,45 +127,27 @@ static int R_ChoosePFD( int colorBits, int depthBits, int stencilBits )
// check acceleration
if(( current->dwFlags & PFD_GENERIC_FORMAT ) && !r_allow_software->integer )
{
MsgDev( D_MEMORY, "PFD %i rejected, software acceleration\n", i );
continue;
}
// check flags
if(( current->dwFlags & flags ) != flags )
{
MsgDev( D_MEMORY, "PFD %i rejected, improper flags (0x%x instead of 0x%x)\n", i, current->dwFlags, flags );
continue;
}
// Check pixel type
// check pixel type
if( current->iPixelType != PFD_TYPE_RGBA )
{
MsgDev( D_MEMORY, "PFD %i rejected, not RGBA\n", i );
continue;
}
// check color bits
if( current->cColorBits < colorBits )
{
MsgDev( D_MEMORY, "PFD %i rejected, insufficient color bits (%i < %i)\n", i, current->cColorBits, colorBits );
continue;
}
// check depth bits
if( current->cDepthBits < depthBits )
{
MsgDev( D_MEMORY, "PFD %i rejected, insufficient depth bits (%i < %i)\n", i, current->cDepthBits, depthBits );
continue;
}
// check stencil bits
if( current->cStencilBits < stencilBits )
{
MsgDev( D_MEMORY, "PFD %i rejected, insufficient stencil bits (%i < %i)\n", i, current->cStencilBits, stencilBits );
continue;
}
// if we don't have a selected PFD yet, then use it
if( !pixelFormat )
@ -230,7 +212,7 @@ static int R_ChoosePFD( int colorBits, int depthBits, int stencilBits )
MsgDev( D_NOTE, "using hardware acceleration\n");
glw_state.software = false;
}
MsgDev( D_LOAD, "R_ChoosePFD: PIXELFORMAT %i selected\n", pixelFormat );
MsgDev( D_NOTE, "R_ChoosePFD: PIXELFORMAT %i selected\n", pixelFormat );
return pixelFormat;
}

View File

@ -2643,7 +2643,6 @@ void R_InitShaders( void )
}
// parse this file
MsgDev( D_LOAD, "%s\n", t->filenames[i] );
Shader_ParseFile( script, t->filenames[i] );
Com_CloseScript( script );
}

View File

@ -264,7 +264,6 @@ void Mod_SpriteLoadModel( ref_model_t *mod, const void *buffer )
return;
}
MsgDev( D_LOAD, "%s, rendermode %d\n", mod->name, psprite->rendermode );
mod->touchFrame = tr.registration_sequence;
frames = NULL; // invalidate pointer
sp_name[0] = 0;
@ -395,7 +394,6 @@ ref_shader_t *CL_LoadSprite( const char *szSpriteName )
return NULL;
}
MsgDev( D_LOAD, "%s, rendermode %d\n", szSpriteName, LittleLong( pin->texFormat ));
com.strncpy( frame_prefix, "one", MAX_STRING );
tex_flags = TF_CLAMP|TF_NOMIPMAP|TF_NOPICMIP;
frames = NULL; // invalidate pointer

View File

@ -1081,7 +1081,7 @@ mstudioanim_t *R_StudioGetAnim( ref_model_t *m_pRefModel, mstudioseqdesc_t *pseq
if( IDSEQGRPHEADER != LittleLong(*(uint *)buf ))
Host_Error( "R_StudioGetAnim: %s is corrupted\n", filepath );
MsgDev( D_LOAD, "R_StudioGetAnim: %s\n", filepath );
MsgDev( D_NOTE, "R_StudioGetAnim: %s\n", filepath );
paSequences[pseqdesc->seqgroup].data = Mem_Alloc( m_pRefModel->mempool, filesize );
Mem_Copy( paSequences[pseqdesc->seqgroup].data, buf, filesize );