Lot of changes

This commit is contained in:
Ley0k 2016-08-13 18:32:13 +02:00
parent db1cfb675c
commit 3436b47544
43 changed files with 1249 additions and 123 deletions

View file

@ -345,8 +345,8 @@ typedef struct refImport_s
int ( *Milliseconds )( );
char * ( *LV_ConvertString )( const char *string );
void ( *Hunk_Clear )( );
void * ( *Hunk_Alloc )( int size );
void * ( *Hunk_AllocateTempMemory )( int size );
void * ( *Hunk_Alloc )( size_t size );
void * ( *Hunk_AllocateTempMemory )( size_t size );
void ( *Hunk_FreeTempMemory )( void *buffer );
void * ( *Malloc )( size_t size );
void ( *Free )( void *ptr );

View file

@ -37,6 +37,8 @@ void Skel_DPrintf( const char *fmt, ... )
Com_DPrintf( "%s", msg );
}
#ifndef _DEBUG_MEM
void Skel_Free( void *ptr )
{
Z_Free( ptr );
@ -47,6 +49,8 @@ void *Skel_Alloc( size_t size )
return Z_TagMalloc( size, TAG_SKEL );
}
#endif
void Skel_FreeFile( void *buffer )
{
FS_FreeFile( buffer );

View file

@ -126,4 +126,9 @@ int main( int argc, char **argv )
MainEvent( conev );
conev.FreeObjectList();
L_ShutdownEvents();
Com_Shutdown();
FS_Shutdown( qtrue );
}

View file

@ -221,7 +221,7 @@ void *Class::operator new( size_t s )
if ( s == 0 )
return 0;
s += sizeof( unsigned int );
s += sizeof( size_t );
#ifdef GAME_DLL
p = ( size_t * )gi.Malloc( s );
@ -247,7 +247,7 @@ void *Class::operator new( size_t s )
void Class::operator delete( void *ptr )
{
unsigned int *p = ( ( unsigned int * )ptr ) - 1;
size_t *p = ( ( size_t * )ptr ) - 1;
totalmemallocated -= *p;
numclassesallocated--;

View file

@ -143,7 +143,7 @@ bool ConsoleInput::Execute
const char *com_token;
str sCommand;
buffer = ( char * )bi.Malloc( strlen( data ) + 1 );
buffer = ( char * )malloc( strlen( data ) + 1 );
strcpy( buffer, data );
com_token = COM_Parse( &buffer );
@ -151,6 +151,7 @@ bool ConsoleInput::Execute
if( !com_token )
{
Com_Printf( "Enter a valid command.\n" );
free( buffer );
return false;
}
@ -177,15 +178,18 @@ bool ConsoleInput::Execute
else
{
Com_Printf( "Command '%s' not available from console.\n", sCommand.c_str() );
free( buffer );
return false;
}
}
else
{
Com_Printf( "Command '%s' is not valid. Type help for more info.\n", sCommand.c_str() );
free( buffer );
return false;
}
free( buffer );
return true;
}
@ -210,7 +214,7 @@ bool ConsoleInput::Execute
return false;
}
data = ( char * )bi.Malloc( iLength + 1 );
data = ( char * )malloc( iLength + 1 );
memset( data, 0, iLength + 1 );
@ -220,7 +224,10 @@ bool ConsoleInput::Execute
strcat( data, " " );
}
return Execute( data );
bool bResult = Execute( data );
free( data );
return bResult;
}
void ConsoleInput::Input_Idle
@ -229,7 +236,7 @@ void ConsoleInput::Input_Idle
)
{
char *szBuffer = ( char * )bi.Malloc( 255 );
char *szBuffer = ( char * )malloc( 255 );
int i;
while( 1 )

View file

@ -136,6 +136,8 @@ void DbgHeap::ReferencePointer
)
{
return;
refptr_t *ref = FindReference( ptr );
refptr_t **rootptr;
@ -174,6 +176,8 @@ void DbgHeap::DereferencePointer
)
{
return;
refptr_t *ref = FindReference( ptr );
assert( ref );
@ -194,11 +198,39 @@ void DbgHeap::DereferencePointer
ref->refcount--;
/*
if( !ref->refcount )
{
refptr_t *r;
refptr_t *rootptr;
rootptr = hashTable[ ( ( size_t )ptr / 8 ) % DBG_HEAP_HASHSIZE ];
if( ref != rootptr )
{
for( r = rootptr; r != NULL; r = r->next )
{
if( r->ptr == ptr )
{
ref->next = r->next;
break;
}
ref = r;
}
}
else
{
hashTable[ ( ( size_t )ptr / 8 ) % DBG_HEAP_HASHSIZE ] = ref->next;
}
}
*/
#ifdef WIN32
RtlCaptureStackBackTrace( 1, DBG_HEAP_MAX_CALLSTACK, ref->callstack, NULL );
#endif
}
/*
void *operator new( size_t size )
{
void *ptr = malloc( size );
@ -224,3 +256,4 @@ void operator delete[]( void *ptr )
m_Heap.DereferencePointer( ptr );
free( ptr );
}
*/

View file

@ -80,7 +80,7 @@ Parses spawnflags out of the given string, returning the new position.
Clears out any previous args.
====================
*/
char *SpawnArgs::Parse( char *data )
char *SpawnArgs::Parse( char *data, bool bAllowUtils )
{
str keyname;
const char *com_token;
@ -130,7 +130,7 @@ char *SpawnArgs::Parse( char *data )
// keynames with a leading underscore are used for utility comments,
// and are immediately discarded by the game
if ( keyname[ 0 ] == '_' )
if ( !bAllowUtils && keyname[ 0 ] == '_' )
{
continue;
}

View file

@ -54,7 +54,7 @@ public:
void Clear( void );
char *Parse( char *data );
char *Parse( char *data, bool bAllowUtils = false );
const char *getArg( const char *key, const char *defaultValue = NULL );
void setArg( const char *key, const char *value );

View file

@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define glbs gi
#include "g_local.h"
#include <script.h>
#include "qcommon.h"
#else
@ -58,6 +59,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <containerclass.h>
#include <stack.h>
#include <listener.h>
#include <script.h>
#include "../qcommon/qcommon.h"

View file

@ -471,6 +471,13 @@ void L_ShutdownEvents( void )
L_ClearEventList();
eventInfo_t *evi, *prev;
for( evi = lastEvent; evi != NULL; evi = prev )
{
prev = evi->prev;
free( evi );
}
Event::commandList.clear();
Event::eventDefList.clear();
@ -3240,6 +3247,9 @@ qboolean Listener::ProcessPendingEvents( void )
// ProcessEvent will dispose of this event when it is done
obj->ProcessEvent( event->event );
// free up the node
delete event;
// start over, since can't guarantee that we didn't process any previous or following events
event = Event::EventQueue.next;

View file

@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TOKENSPACE (' ')
#define TOKENSPECIAL ('$')
#define MAXTOKEN 256
#define MAXTOKEN 512
typedef struct
{

View file

@ -39,6 +39,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define VECTOR_FABS fabs
#endif
static float vrsqrt( float number )
{
union {
float f;
int i;
} t;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
t.f = number;
t.i = 0x5f3759df - ( t.i >> 1 ); // what the fuck?
y = t.f;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
return y;
}
class Vector
{
public:
@ -101,9 +118,11 @@ public:
const Vector & CrossProduct( vec3_t a, const Vector &b );
const Vector & CrossProduct( const Vector &a, vec3_t b );
float length( void ) const;
float lengthfast( void ) const;
float lengthSquared( void ) const;
float lengthXY( void ) const;
float normalize( void );
void normalizefast( void );
void EulerNormalize( void );
void EulerNormalize360( void );
static Vector Clamp( Vector &value, const Vector &min, const Vector &max );
@ -518,6 +537,11 @@ inline float Vector::length( void ) const
return sqrt( lengthSquared() );
}
inline float Vector::lengthfast( void ) const
{
return vrsqrt( lengthSquared() );
}
//----------------------------------------------------------------
// Name: lengthXY
// Class: Vector
@ -560,6 +584,27 @@ inline float Vector::normalize( void )
return length;
}
//----------------------------------------------------------------
// Name: normalizefast
// Class: Vector
//
// Description: fast version of normalize
//
// Parameters: None
//
// Returns: float - length of the vector before the function
//----------------------------------------------------------------
inline void Vector::normalizefast( void )
{
float ilength;
ilength = this->lengthfast();
x *= ilength;
y *= ilength;
z *= ilength;
}
//----------------------------------------------------------------
// Name: EulerNormalize
// Class: Vector

View file

@ -549,7 +549,7 @@ Com_StringContains
============
*/
const char *Com_StringContains(const char *str1, const char *str2, int casesensitive) {
size_t len;
intptr_t len;
int i, j;
len = strlen(str1) - strlen(str2);

View file

@ -32,8 +32,6 @@ private:
Entry< k, v > **reverseTable; // the index table
protected:
virtual void rehash();
virtual Entry< k, v > *addNewKeyEntry( const k& key );
public:
@ -41,6 +39,7 @@ public:
~con_arrayset();
virtual void clear();
virtual void resize( int count );
unsigned int findKeyIndex( const k& key );
unsigned int addKeyIndex( const k& key );
@ -63,13 +62,13 @@ con_arrayset<key, value>::~con_arrayset()
}
template< typename key, typename value >
void con_arrayset<key, value>::rehash()
void con_arrayset<key, value>::resize( int count )
{
Entry< key, value > **oldReverseTable = reverseTable;
unsigned int oldTableLength = this->tableLength;
int i;
con_set< key, value >::rehash();
con_set< key, value >::resize( count );
// allocate a bigger reverse table
reverseTable = ( new Entry< key, value > *[ this->tableLength ]() ) - 1;

View file

@ -112,8 +112,20 @@ int HashCode< float >( const float& key )
return *( int * )&key;
}
template<>
int HashCode< double >( const double& key )
{
return *( int * )&key;
}
template<>
int HashCode< str >( const str& key )
{
return HashCode< const char * >( key.c_str() );
}
template<>
int HashCode< Vector >( const Vector& key )
{
return ( int )( ( key[ 0 ] + key[ 1 ] + key[ 2 ] ) / 3 );
}

View file

@ -50,8 +50,8 @@ public:
Entry *next;
public:
void *operator new( size_t size );
void operator delete( void *ptr );
//void *operator new( size_t size );
//void operator delete( void *ptr );
Entry();
@ -66,7 +66,7 @@ class con_set
friend class con_set_enum < k, v > ;
public:
static MEM_BlockAlloc< Entry< k, v >, char[ 256 ] > Entry_allocator;
static MEM_BlockAlloc< Entry< k, v >, MEM_BLOCKSIZE > Entry_allocator;
protected:
Entry< k, v > **table; // hashtable
@ -81,8 +81,6 @@ protected:
Entry< k, v > *addKeyEntry( const k& key );
virtual Entry< k, v > *addNewKeyEntry( const k& key );
virtual void rehash();
public:
con_set();
~con_set();
@ -92,6 +90,7 @@ public:
#endif
virtual void clear();
virtual void resize( int count = 0 );
v *findKeyValue( const k& key );
k *firstKeyValue();
@ -141,6 +140,7 @@ public:
#endif
void clear();
virtual void resize( int count = 0 );
value& operator[]( const key& index );
@ -184,11 +184,12 @@ int HashCode( const str& key );
*/
template< typename k, typename v >
MEM_BlockAlloc< Entry< k, v >, char[ 256 ] > con_set< k, v >::Entry_allocator;
MEM_BlockAlloc< Entry< k, v >, MEM_BLOCKSIZE > con_set< k, v >::Entry_allocator;
template< typename k >
int HashCode( const k& key );
/*
template< typename k, typename v >
void *Entry< k, v >::operator new( size_t size )
{
@ -200,6 +201,7 @@ void Entry< k, v >::operator delete( void *ptr )
{
con_set< k, v >::Entry_allocator.Free( ptr );
}
*/
template< typename k, typename v >
Entry< k, v >::Entry()
@ -262,18 +264,31 @@ void con_set< key, value >::clear()
}
template< typename key, typename value >
void con_set< key, value >::rehash()
void con_set< key, value >::resize( int count )
{
Entry< key, value > **oldTable = table;
Entry< key, value > *e, *old;
int oldTableLength = tableLength;
int i, index;
tableLength += 4;
if( count > 0 )
{
tableLength += count;
threshold = tableLength;
}
else
{
//threshold = ( unsigned int )( ( float )tableLength * 0.75f );
threshold = tableLength * ( 3 / 4 );
threshold = ( unsigned int )( ( float )tableLength * 0.75 );
if( threshold < 1 )
{
threshold = 1;
}
// allocate a bigger table
tableLength += threshold;
}
// allocate a new table
table = new Entry< key, value > *[ tableLength ]();
memset( table, 0, tableLength * sizeof( Entry< key, value > * ) );
@ -339,7 +354,7 @@ Entry< k, v > *con_set< k, v >::addNewKeyEntry( const k& key )
if( count >= threshold )
{
rehash();
resize();
}
index = HashCode< k >( key ) % tableLength;
@ -542,6 +557,12 @@ void con_map< key, value >::clear()
m_con_set.clear();
}
template< typename key, typename value >
void con_map< key, value >::resize( int count )
{
m_con_set.resize( count );
}
template< typename key, typename value >
value& con_map< key, value >::operator[]( const key& index )
{

View file

@ -2625,6 +2625,7 @@ void FS_AddGameDirectory( const char *path, const char *dir ) {
search = Z_Malloc (sizeof(searchpath_t));
search->pack = pak;
search->next = fs_searchpaths;
search->dir = NULL;
fs_searchpaths = search;
}
@ -2636,6 +2637,7 @@ void FS_AddGameDirectory( const char *path, const char *dir ) {
//
search = Z_Malloc( sizeof( searchpath_t ) );
search->dir = Z_Malloc( sizeof( *search->dir ) );
search->pack = NULL;
Q_strncpyz( search->dir->path, path, sizeof( search->dir->path ) );
Q_strncpyz( search->dir->gamedir, dir, sizeof( search->dir->gamedir ) );
@ -3612,3 +3614,111 @@ void FS_FilenameCompletion( const char *dir, const char *ext,
}
FS_FreeFileList( filenames );
}
#define ABSOLUTE_NAME_START 3
void FS_GetRelativeFilename( const char *currentDirectory, const char *absoluteFilename, char *out, size_t destlen )
{
// declarations - put here so this should work in a C compiler
int afMarker = 0, rfMarker = 0;
size_t cdLen = 0, afLen = 0;
int i = 0;
int levels = 0;
cdLen = strlen( currentDirectory );
afLen = strlen( absoluteFilename );
// make sure the names are not too long or too short
if( cdLen > destlen || cdLen < ABSOLUTE_NAME_START + 1 ||
afLen > destlen || afLen < ABSOLUTE_NAME_START + 1 )
{
return;
}
// Handle DOS names that are on different drives:
if( currentDirectory[ 0 ] != absoluteFilename[ 0 ] )
{
// not on the same drive, so only absolute filename will do
strncpy( out, absoluteFilename, destlen );
return;
}
// they are on the same drive, find out how much of the current directory
// is in the absolute filename
i = ABSOLUTE_NAME_START;
while( i < afLen && i < cdLen )
{
if( currentDirectory[ i ] == absoluteFilename[ i ]
|| currentDirectory[ i ] == '\\' && absoluteFilename[ i ] == '/'
|| currentDirectory[ i ] == '/' && absoluteFilename[ i ] == '\\' )
{
i++;
}
else
{
break;
}
}
if( i == cdLen )
{
if( absoluteFilename[ i ] == '\\' || absoluteFilename[ i - 1 ] == '\\'
|| absoluteFilename[ i ] == '/' || absoluteFilename[ i - 1 ] == '/' )
{
// the whole current directory name is in the file name,
// so we just trim off the current directory name to get the
// current file name.
if( absoluteFilename[ i ] == '\\' || absoluteFilename[ i ] == '/' )
{
// a directory name might have a trailing slash but a relative
// file name should not have a leading one...
i++;
}
strncpy( out, &absoluteFilename[ i ], destlen );
return;
}
}
// The file is not in a child directory of the current directory, so we
// need to step back the appropriate number of parent directories by
// using "..\"s. First find out how many levels deeper we are than the
// common directory
afMarker = i;
levels = 1;
// count the number of directory levels we have to go up to get to the
// common directory
while( i < cdLen )
{
i++;
if( currentDirectory[ i ] == '\\' || currentDirectory[ i ] == '/' )
{
// make sure it's not a trailing slash
i++;
if( currentDirectory[ i ] != '\0' )
{
levels++;
}
}
}
// move the absolute filename marker back to the start of the directory name
// that it has stopped in.
while( afMarker > 0 && absoluteFilename[ afMarker - 1 ] != '\\' && absoluteFilename[ afMarker - 1 ] != '/' )
{
afMarker--;
}
// check that the result will not be too long
if( levels * 3 + afLen - afMarker > destlen )
{
return;
}
// add the appropriate number of "..\"s.
rfMarker = 0;
for( i = 0; i < levels; i++ )
{
out[ rfMarker++ ] = '.';
out[ rfMarker++ ] = '.';
out[ rfMarker++ ] = PATH_SEP;
}
// copy the rest of the filename into the result string
strcpy( &out[ rfMarker ], &absoluteFilename[ afMarker ] );
}

View file

@ -76,6 +76,8 @@ const char *Z_NumberStringPointer( int iNum )
return ( const char * )numberstring[ iNum - '0' ].mem;
}
#ifndef _DEBUG_MEM
/*
========================
Z_Free
@ -108,6 +110,8 @@ void Z_Free( void *ptr )
free( block );
}
#endif
/*
========================
Z_FreeTags
@ -128,6 +132,8 @@ void Z_FreeTags( int tag )
mem_blocks[ tag ].next = &mem_blocks[ tag ];
}
#ifndef _DEBUG_MEM
/*
========================
Z_TagMalloc
@ -166,6 +172,8 @@ void *Z_TagMalloc( size_t size, int tag )
return ( void * )( ( byte * )block + sizeof( memblock_t ) );
}
#endif
/*
========================
Z_CheckHeap
@ -354,6 +362,8 @@ void Z_Shutdown( void ) {
}
}
#ifndef _DEBUG_MEM
/*
=================
Hunk_Alloc
@ -370,6 +380,8 @@ void *Hunk_Alloc( size_t size ) {
return ptr;
}
#endif
/*
=================
Hunk_Clear
@ -381,6 +393,8 @@ void Hunk_Clear( void ) {
Z_FreeTags( TAG_STATIC );
}
#ifndef _DEBUG_MEM
/*
=================
Hunk_AllocateTempMemory
@ -390,7 +404,7 @@ Multiple files can be loaded in temporary memory.
When the files-in-use count reaches zero, all temp memory will be deleted
=================
*/
void *Hunk_AllocateTempMemory( int size ) {
void *Hunk_AllocateTempMemory( size_t size ) {
return Z_TagMalloc( size, TAG_TEMP );
}
@ -403,6 +417,8 @@ void Hunk_FreeTempMemory( void *ptr ) {
Z_Free( ptr );
}
#endif
/*
=================
Hunk_ClearTempMemory
@ -438,6 +454,8 @@ void Com_TouchMemory( void ) {
Z_TouchMemory();
}
#ifndef _DEBUG_MEM
/*
========================
Z_Malloc
@ -451,3 +469,5 @@ void *Z_Malloc( size_t size ) {
return ptr;
}
#endif

View file

@ -2005,6 +2005,11 @@ void VectorPackTo01( vec3_t v ) {
v[ 2 ] += 0.5f;
}
vec_t Q_rint( vec_t in )
{
return floor( in + 0.5 );
}
void _VectorMA( const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc) {
vecc[0] = veca[0] + scale*vecb[0];
vecc[1] = veca[1] + scale*vecb[1];

View file

@ -163,7 +163,7 @@ float Com_Clamp( float min, float max, float value ) {
COM_SkipPath
============
*/
char *COM_SkipPath (char *pathname)
char *COM_SkipPath (const char *pathname)
{
char *last;

View file

@ -98,6 +98,19 @@ extern "C" {
#ifndef Q3_VM
#ifdef _DEBUG_MEM
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define Z_Malloc malloc
#define Z_TagMalloc(size, tag) malloc( size )
#define Z_Free(ptr) free(ptr)
#define Hunk_Alloc(size) malloc(size)
#define Hunk_AllocateTempMemory(size) malloc(size)
#define Hunk_FreeTempMemory(ptr) free(ptr)
#endif
#include <assert.h>
#include <math.h>
#include <stdio.h>
@ -619,6 +632,7 @@ void _VectorAdd( const vec3_t veca, const vec3_t vecb, vec3_t out );
void _VectorCopy( const vec3_t in, vec3_t out );
void _VectorScale( const vec3_t in, float scale, vec3_t out );
void _VectorMA( const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc );
vec_t Q_rint( vec_t in );
unsigned ColorBytes3 (float r, float g, float b);
unsigned ColorBytes4 (float r, float g, float b, float a);
@ -1053,7 +1067,7 @@ unsigned long long rdtsc( void );
float Com_Clamp( float min, float max, float value );
char *COM_SkipPath( char *pathname );
char *COM_SkipPath( const char *pathname );
const char *COM_GetExtension( const char *name );
void COM_StripExtension(const char *in, char *out, int destsize);
void COM_DefaultExtension( char *path, int maxSize, const char *extension );
@ -1534,7 +1548,7 @@ typedef enum
#define MAX_CLIENTS 64 // absolute limit
#define MAX_LOCATIONS 64
#define MAX_MAP_BOUNDS 8192
#define MAX_MAP_BOUNDS 16384
#define MIN_MAP_BOUNDS ( -MAX_MAP_BOUNDS )
#define MAP_SIZE ( MAX_MAP_BOUNDS - MIN_MAP_BOUNDS )

View file

@ -738,6 +738,8 @@ void FS_Remove( const char *osPath );
void FS_FilenameCompletion( const char *dir, const char *ext,
qboolean stripExt, void(*callback)(const char *s) );
void FS_GetRelativeFilename( const char *currentDirectory, const char *absoluteFilename, char *out, size_t destlen );
extern char fs_gamedir[];
extern cvar_t *fs_debug;
extern cvar_t *fs_mapdir;
@ -1134,24 +1136,32 @@ temp file loading
const char *Z_EmptyStringPointer( void );
const char *Z_NumberStringPointer( int iNum );
#ifndef _DEBUG_MEM
void *Z_TagMalloc( size_t size, int tag );
void *Z_Malloc( size_t size );
void Z_Free( void *ptr );
#endif
void Z_FreeTags( int tag );
void Z_InitMemory( void );
void Z_Shutdown( void );
int Z_AvailableMemory( void );
void Z_LogHeap( void );
void Z_Meminfo_f( void );
#ifndef _DEBUG_MEM
void *Hunk_Alloc( size_t size );
void *Hunk_AllocateTempMemory( size_t size );
void Hunk_FreeTempMemory( void *buf );
#endif
void Hunk_Clear( void );
void Hunk_ClearToMark( void );
void Hunk_SetMark( void );
qboolean Hunk_CheckMark( void );
void Hunk_ClearTempMemory( void );
void *Hunk_AllocateTempMemory( int size );
void Hunk_FreeTempMemory( void *buf );
int Hunk_MemoryRemaining( void );
void Hunk_Log( void);
void Hunk_Trash( void );

View file

@ -509,8 +509,8 @@ typedef struct {
#define LIGHTMAP_HEIGHT 128
#define LIGHTMAP_SIZE 128 // IneQuation: moved it here, MUST MATCH THE FORMER TWO
#define MAX_WORLD_COORD ( 128*1024 )
#define MIN_WORLD_COORD ( -128*1024 )
#define MAX_WORLD_COORD ( 128*128 )
#define MIN_WORLD_COORD ( -128*128 )
#define WORLD_SIZE ( MAX_WORLD_COORD - MIN_WORLD_COORD )
//=============================================================================

View file

@ -87,7 +87,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define SURF_NOMARKS 0x20 // don't leave missile marks
#define SURF_CASTSHADOW 0x40
#define SURF_NODRAW 0x80 // don't generate a drawsurface at all
#define SURF_NOLIGHTMAP 0x100 // surface doesn't need a lightmap
#define SURF_HINT 0x100 // make a primary bsp splitter
#define SURF_ALPHASHADOW 0x200 // do per-pixel light shadow casting in q3map
#define SURF_NOSTEPS 0x400 // no footstep sounds
#define SURF_NONSOLID 0x800 // don't collide against curves with this set
@ -109,7 +109,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define SURF_CARPET 0x8000000 // carpet effects
#define SURF_BACKSIDE 0x10000000 // su44: backside
#define SURF_NODLIGHT 0x20000000 // don't dlight even if solid (solid lava, skies)
#define SURF_HINT 0x40000000 // make a primary bsp splitter
#define SURF_NOLIGHTMAP 0x40000000 // surface doesn't need a lightmap
#define SURF_UNKNOWN3 0x80000000 // IneQuation: WTF?
#define SURF_FLESH 0x40 // make flesh sounds and effects

View file

@ -32,7 +32,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TOKENSPACE (' ')
#define TOKENSPECIAL ('$')
#ifndef MAXTOKEN
#define MAXTOKEN 256
#endif
#define MAXMACROS 48
typedef struct {

View file

@ -1088,10 +1088,7 @@ typedef struct {
typedef union varnodeUnpacked_u {
float fVariance;
struct s {
byte flags;
unsigned char unused[ 3 ];
};
} varnodeUnpacked_t;
typedef unsigned short terraInt;

View file

@ -259,6 +259,65 @@ bool IsBogusChannelName( const char *name )
return false;
}
int GetChannelTypeFromName( const char *name )
{
int i;
size_t len;
if( !name )
{
return 2;
}
for( i = 0; i < sizeof( bogusNameTable ) / sizeof( bogusNameTable[ 0 ] ); i++ )
{
if( !Q_stricmp( name, bogusNameTable[ i ] ) )
{
return 2;
}
}
if( strstr( name, "Bip0" ) && !strstr( name, "Bip01" ) && !strstr( name, "Footsteps" ) )
{
return 2;
}
len = strlen( name );
if( len >= 4 )
{
if( !memcmp( name + len - 4, " rot", 5 ) )
{
return 0;
}
else if( !memcmp( name + len - 4, " pos", 5 ) )
{
return 1;
}
else if( len >= 6 )
{
if( !memcmp( name + len - 4, " rotFK", 7 ) )
{
return 2;
}
else
{
return 3;
}
}
else
{
return 3;
}
}
else
{
return 3;
}
return false;
}
int ChannelNameTable::RegisterChannel( const char *name )
{
int index;

View file

@ -164,6 +164,7 @@ skelAnimDataGameHeader_s *skelAnimDataGameHeader_s::AllocRLEChannelData( int num
animSize = sizeof( skelAnimDataGameHeader_t ) + ( numChannels - 1 ) * sizeof( skanChannelHdr );
data = ( skelAnimDataGameHeader_t * )Skel_Alloc( animSize );
data->flags = 0;
data->nTotalChannels = numChannels;
data->channelList.InitChannels();
data->nBytesUsed = animSize;
return data;
@ -552,13 +553,13 @@ void SkeletorGetAnimFrame( skelHeaderGame_t *skelmodel, skelAnimDataGameHeader_t
skelAnimStoreFrameList_c frameList;
skelAnimFrame_t *newFrame;
frameList.actionWeight = 1.0;
frameList.actionWeight = animData ? 1.0 : 0;
frameList.numMovementFrames = 0;
frameList.numActionFrames = 1;
frameList.m_blendInfo[ 32 ].weight = 1.0;
frameList.m_blendInfo[ 32 ].pAnimationData = animData;
frameList.m_blendInfo[ 32 ].frame = frame;
numBones = boneList->NumChannels();
numBones = skelmodel->numBones;
bone = ( skelBone_Base ** )Skel_Alloc( sizeof( skelBone_Base * ) * numBones );
memset( bone, 0, sizeof( skelBone_Base * ) * numBones );
@ -572,9 +573,27 @@ void SkeletorGetAnimFrame( skelHeaderGame_t *skelmodel, skelAnimDataGameHeader_t
}
newFrame = ( skelAnimFrame_t * )Skel_Alloc( sizeof( skelAnimFrame_t ) + sizeof( SkelMat4 ) * numBones );
if( animData )
{
if( animData->m_frame )
{
newFrame->radius = animData->m_frame->radius;
}
else
{
newFrame->radius = 0;
}
newFrame->bounds[ 0 ] = animData->bounds[ 0 ];
newFrame->bounds[ 1 ] = animData->bounds[ 1 ];
}
else
{
newFrame->radius = 0;
newFrame->bounds[ 0 ] = SkelVec3();
newFrame->bounds[ 1 ] = SkelVec3();
}
for( i = 0; i < numBones; i++ )
{
@ -628,10 +647,8 @@ void SkeletorGetAnimFrame( skelHeaderGame_t *skelmodel, skelAnimDataGameHeader_t
Skel_Free( newFrame );
}
void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, int frame, float *radius, vec3_t *mins, vec3_t *maxes )
void TIKI_GetSkelAnimFrameInternal( dtiki_t *tiki, skelBoneCache_t *bones, skelAnimDataGameHeader_t *animData, int frame, float *radius, vec3_t *mins, vec3_t *maxes )
{
short *aliases;
skelAnimDataGameHeader_t *animData;
//int boneNum;
int numBones;
skelBone_Base **bone;
@ -642,16 +659,7 @@ void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, in
//skanBlendInfo *frame;
skelHeaderGame_t *skelmodel;
aliases = tiki->a->m_aliases;
if( *aliases == -1 )
{
SKEL_Warning( "TIKI_GetSkelAnimFrame: Bad anim in static model %s, couldn't generate pose properly.\n", tiki->name );
return;
}
animData = SkeletorCacheGetData( aliases[ anim ] );
frameList.actionWeight = 1.0;
frameList.actionWeight = animData ? 1.0 : 0;
frameList.numMovementFrames = 0;
frameList.numActionFrames = 1;
frameList.m_blendInfo[ 32 ].weight = 1.0;
@ -675,9 +683,27 @@ void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, in
}
newFrame = ( skelAnimFrame_t * )Skel_Alloc( sizeof( skelAnimFrame_t ) + sizeof( SkelMat4 ) * numBones );
if( animData )
{
if( animData->m_frame )
{
newFrame->radius = animData->m_frame->radius;
}
else
{
newFrame->radius = 0;
}
newFrame->bounds[ 0 ] = animData->bounds[ 0 ];
newFrame->bounds[ 1 ] = animData->bounds[ 1 ];
}
else
{
newFrame->radius = 0;
newFrame->bounds[ 0 ] = SkelVec3();
newFrame->bounds[ 1 ] = SkelVec3();
}
for( i = 0; i < numBones; i++ )
{
@ -724,6 +750,23 @@ void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, in
Skel_Free( newFrame );
}
void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, int frame, float *radius, vec3_t *mins, vec3_t *maxes )
{
short *aliases;
skelAnimDataGameHeader_t *animData;
aliases = tiki->a->m_aliases;
if( *aliases == -1 )
{
SKEL_Warning( "TIKI_GetSkelAnimFrame: Bad anim in static model %s, couldn't generate pose properly.\n", tiki->name );
return;
}
animData = SkeletorCacheGetData( aliases[ anim ] );
TIKI_GetSkelAnimFrameInternal( tiki, bones, animData, frame, NULL, NULL, NULL );
}
void TIKI_GetSkelAnimFrame( dtiki_t *tiki, skelBoneCache_t *bones, float *radius, vec3_t *mins, vec3_t *maxes )
{
TIKI_GetSkelAnimFrame2( tiki, bones, 0, 0, radius, mins, maxes );

View file

@ -109,6 +109,7 @@ public:
static skelAnimDataGameHeader_t *ConvertSkelFileToGame( skelAnimDataFileHeader_t *pHeader, int iBuffLength, const char *path );
static void SaveProcessedAnim( skelAnimDataGameHeader_t *enAnim, const char *path, skelAnimDataFileHeader_t *pHeader );
static skelAnimDataGameHeader_t *LoadProcessedAnim( const char *path, void *buffer, int len, const char *name );
static skelAnimDataGameHeader_t *LoadProcessedAnimEx( const char *path, void *buffer, int len, const char *name );
void PrintBoneCacheList();
void PrintBoneList();
void LoadMorphTargetNames( skelHeaderGame_t *modelHeader );
@ -153,14 +154,22 @@ void BoneGetFrames( skelHeaderGame_t *skelmodel, skelAnimDataGameHeader_t *animD
void SkeletorGetAnimFrame( skelHeaderGame_t *skelmodel, skelAnimDataGameHeader_t *animData, skelChannelList_c *boneList, skelBoneCache_t *bones, int frame, float *radius, vec3_t *mins, vec3_t *maxes );
void TIKI_GetSkelAnimFrame( dtiki_t *tiki, skelBoneCache_t *bones, float *radius, vec3_t *mins, vec3_t *maxes );
void TIKI_GetSkelAnimFrame2( dtiki_t *tiki, skelBoneCache_t *bones, int anim, int frame, float *radius, vec3_t *mins, vec3_t *maxes );
void TIKI_GetSkelAnimFrameInternal( dtiki_t *tiki, skelBoneCache_t *bones, skelAnimDataGameHeader_t *animData, int frame, float *radius, vec3_t *mins, vec3_t *maxes );
//
// skeletor_imports.cpp
//
void Skel_DPrintf( const char *fmt, ... );
#ifndef _DEBUG_MEM
void Skel_Free( void *ptr );
void *Skel_Alloc( size_t size );
#else
#define Skel_Free(ptr) free(ptr)
#define Skel_Alloc(size) malloc(size)
#endif
void Skel_FreeFile( void *buffer );
int Skel_ReadFileEx( const char *qpath, void **buffer, qboolean quiet );

View file

@ -370,6 +370,72 @@ void ReadEncodedFrames( msg_t *msg, skelAnimDataGameHeader_t *enAnim )
enAnim->nBytesUsed = MSG_ReadLong( msg );
}
void ReadEncodedFramesEx( msg_t *msg, skelAnimDataGameHeader_t *enAnim )
{
skanChannelHdr *pChannel;
skanGameFrame *pFrame;
int frameCnt;
int i, j;
const char *name;
int type;
for( i = 0; i < enAnim->nTotalChannels; i++ )
{
pChannel = &enAnim->ary_channels[ i ];
name = enAnim->channelList.ChannelName( &skeletor_c::m_channelNames, i );
type = GetChannelTypeFromName( name );
frameCnt = MSG_ReadShort( msg );
pFrame = ( skanGameFrame * )Skel_Alloc( frameCnt * sizeof( skanGameFrame ) );
pChannel->ary_frames = pFrame;
pChannel->nFramesInChannel = frameCnt;
if( type )
{
if( type == 1 )
{
for( j = 0; j < pChannel->nFramesInChannel; j++ )
{
pFrame = &pChannel->ary_frames[ j ];
pFrame->nFrameNum = MSG_ReadShort( msg );
pFrame->nPrevFrameIndex = MSG_ReadShort( msg );
pFrame->pChannelData[ 0 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 1 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 2 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 3 ] = 0;
}
}
else if( type == 3 )
{
for( j = 0; j < pChannel->nFramesInChannel; j++ )
{
pFrame = &pChannel->ary_frames[ j ];
pFrame->nFrameNum = MSG_ReadShort( msg );
pFrame->nPrevFrameIndex = MSG_ReadShort( msg );
pFrame->pChannelData[ 0 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 1 ] = 0;
pFrame->pChannelData[ 2 ] = 0;
pFrame->pChannelData[ 3 ] = 0;
}
}
}
else
{
for( j = 0; j < pChannel->nFramesInChannel; j++ )
{
pFrame = &pChannel->ary_frames[ j ];
pFrame->nFrameNum = MSG_ReadShort( msg );
pFrame->nPrevFrameIndex = MSG_ReadShort( msg );
pFrame->pChannelData[ 0 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 1 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 2 ] = MSG_ReadFloat( msg );
pFrame->pChannelData[ 3 ] = MSG_ReadFloat( msg );
}
}
}
}
skelAnimDataGameHeader_t *skeletor_c::LoadProcessedAnim( const char *path, void *buffer, int len, const char *name )
{
skelAnimDataGameHeader_t *enAnim;
@ -434,3 +500,67 @@ skelAnimDataGameHeader_t *skeletor_c::LoadProcessedAnim( const char *path, void
enAnim->channelList.PackChannels();
return enAnim;
}
skelAnimDataGameHeader_t *skeletor_c::LoadProcessedAnimEx( const char *path, void *buffer, int len, const char *name )
{
skelAnimDataGameHeader_t *enAnim;
int i;
msg_t msg;
int numChannels;
skelAnimGameFrame_t *newFrame;
MSG_Init( &msg, ( byte * )buffer, len );
msg.cursize = len;
MSG_BeginReading( &msg );
numChannels = MSG_ReadShort( &msg );
enAnim = skelAnimDataGameHeader_t::AllocRLEChannelData( numChannels );
enAnim->channelList.ZeroChannels();
enAnim->flags = MSG_ReadLong( &msg );
enAnim->frameTime = MSG_ReadFloat( &msg );
enAnim->totalDelta[ 0 ] = MSG_ReadFloat( &msg );
enAnim->totalDelta[ 1 ] = MSG_ReadFloat( &msg );
enAnim->totalDelta[ 2 ] = MSG_ReadFloat( &msg );
enAnim->totalAngleDelta = MSG_ReadFloat( &msg );
enAnim->numFrames = MSG_ReadLong( &msg );
enAnim->bHasDelta = MSG_ReadByte( &msg ) != 0;
enAnim->bHasUpper = MSG_ReadByte( &msg ) != 0;
enAnim->bHasMorph = MSG_ReadByte( &msg ) != 0;
for( i = 0; i < enAnim->nTotalChannels; i++ )
{
enAnim->channelList.AddChannel( m_channelNames.RegisterChannel( MSG_ReadString( &msg ) ) );
}
enAnim->channelList.PackChannels();
newFrame = ( skelAnimGameFrame_t * )Skel_Alloc( enAnim->numFrames * sizeof( skelAnimGameFrame_t ) );
enAnim->m_frame = newFrame;
for( i = 0; i < enAnim->numFrames; i++ )
{
newFrame->bounds[ 0 ][ 0 ] = MSG_ReadFloat( &msg );
newFrame->bounds[ 0 ][ 1 ] = MSG_ReadFloat( &msg );
newFrame->bounds[ 0 ][ 2 ] = MSG_ReadFloat( &msg );
newFrame->bounds[ 1 ][ 0 ] = MSG_ReadFloat( &msg );
newFrame->bounds[ 1 ][ 1 ] = MSG_ReadFloat( &msg );
newFrame->bounds[ 1 ][ 2 ] = MSG_ReadFloat( &msg );
newFrame->radius = MSG_ReadFloat( &msg );
newFrame->delta[ 0 ] = MSG_ReadFloat( &msg );
newFrame->delta[ 1 ] = MSG_ReadFloat( &msg );
newFrame->delta[ 2 ] = MSG_ReadFloat( &msg );
newFrame->angleDelta = MSG_ReadFloat( &msg );
newFrame->pChannels = NULL;
newFrame++;
}
enAnim->bounds[ 0 ][ 0 ] = MSG_ReadFloat( &msg );
enAnim->bounds[ 0 ][ 1 ] = MSG_ReadFloat( &msg );
enAnim->bounds[ 0 ][ 2 ] = MSG_ReadFloat( &msg );
enAnim->bounds[ 1 ][ 0 ] = MSG_ReadFloat( &msg );
enAnim->bounds[ 1 ][ 1 ] = MSG_ReadFloat( &msg );
enAnim->bounds[ 1 ][ 2 ] = MSG_ReadFloat( &msg );
ReadEncodedFramesEx( &msg, enAnim );
return enAnim;
}

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef __SKELETOR_NAME_LISTS_FORMAT_H__
#define __SKELETOR_NAME_LISTS_FORMAT_H__
#define MAX_CHANNELS 2048
#define MAX_CHANNELS 16384
#define MAX_CHANNEL_NAME 32
typedef struct ChannelName_s {
@ -57,6 +57,8 @@ private:
void SetChannelName( ChannelName_t *channel, const char *newName );
};
int GetChannelTypeFromName( const char *name );
#else
typedef struct {

View file

@ -530,8 +530,12 @@ skelBone_Base *skelBone_Base::Parent() const
}
SkelMat4 skelBone_Zero::GetDirtyTransform( const skelAnimStoreFrameList_c *frames )
{
if( m_parent )
{
m_cachedValue = m_parent->GetTransform( frames );
}
m_isDirty = false;
return m_cachedValue;
}
@ -559,7 +563,14 @@ SkelMat4 skelBone_Rotation::GetDirtyTransform( const skelAnimStoreFrameList_c *f
incomingQuat.GetMat4( incomingValue );
VectorCopy( m_baseValue, incomingValue[ 3 ] );
if( m_parent )
{
m_cachedValue.Multiply( incomingValue, m_parent->GetTransform( frames ) );
}
else
{
m_cachedValue = incomingValue;
}
if( m_controller )
{
@ -607,7 +618,14 @@ SkelMat4 skelBone_PosRot::GetDirtyTransform( const skelAnimStoreFrameList_c *fra
incomingQuat.GetMat4( incomingValue );
VectorCopy( incomingOffset, incomingValue[ 3 ] );
if( m_parent )
{
m_cachedValue.Multiply( incomingValue, m_parent->GetTransform( frames ) );
}
else
{
m_cachedValue = incomingValue;
}
if( m_controller )
{
@ -661,7 +679,14 @@ SkelMat4 skelBone_Root::GetDirtyTransform( const skelAnimStoreFrameList_c *frame
incomingQuat.GetMat4( incomingValue );
VectorCopy( incomingOffset, incomingValue[ 3 ] );
if( m_parent )
{
m_cachedValue.Multiply( incomingValue, m_parent->GetTransform( frames ) );
}
else
{
m_cachedValue = incomingValue;
}
if( m_controller )
{
@ -702,7 +727,11 @@ SkelMat4 skelBone_IKshoulder::GetDirtyTransform( const skelAnimStoreFrameList_c
return m_cachedValue;
}
if( m_parent )
{
baseMatrix = m_parent->GetTransform( frames );
}
baseMatrix[ 3 ][ 0 ] += m_baseValue[ 0 ] * baseMatrix[ 0 ][ 0 ] + m_baseValue[ 1 ] * baseMatrix[ 1 ][ 0 ] + m_baseValue[ 2 ] * baseMatrix[ 2 ][ 0 ];
baseMatrix[ 3 ][ 1 ] += m_baseValue[ 0 ] * baseMatrix[ 0 ][ 1 ] + m_baseValue[ 1 ] * baseMatrix[ 1 ][ 1 ] + m_baseValue[ 2 ] * baseMatrix[ 2 ][ 1 ];
baseMatrix[ 3 ][ 2 ] += m_baseValue[ 0 ] * baseMatrix[ 0 ][ 2 ] + m_baseValue[ 1 ] * baseMatrix[ 1 ][ 2 ] + m_baseValue[ 2 ] * baseMatrix[ 2 ][ 2 ];
@ -939,8 +968,12 @@ SkelMat4 skelBone_AvRot::GetDirtyTransform( const skelAnimStoreFrameList_c *fram
VectorCopy( m_basePos, m_cachedValue[ 3 ] );
if( m_parent )
{
temp.Multiply( m_cachedValue, m_parent->GetTransform( frames ) );
m_cachedValue = temp;
}
m_cachedQuat.GetMat4( m_cachedValue );
m_isDirty = false;
@ -979,7 +1012,14 @@ skelBone_Base *skelBone_AvRot::GetBoneRef( int num )
SkelMat4 skelBone_HoseRot::GetDirtyTransform( const skelAnimStoreFrameList_c *frames )
{
return GetDirtyTransform( m_parent->GetTransform( frames ), m_target->GetTransform( frames ) );
SkelMat4 mat;
if( m_parent )
{
mat = m_parent->GetTransform( frames );
}
return GetDirtyTransform( mat, m_target->GetTransform( frames ) );
}
SkelMat4 skelBone_HoseRot::GetDirtyTransform( SkelMat4& myParentTM, SkelMat4& targetTM )
@ -1104,8 +1144,11 @@ SkelMat4 skelBone_HoseRotBoth::GetDirtyTransform( const skelAnimStoreFrameList_c
SkelMat4 myParentTM;
SkelMat4 targetTM;
if( m_parent )
{
myParentTM = m_parent->GetTransform( frames );
targetTM = m_target->GetTransform( frames );
}
VectorInverse( targetTM[ 0 ] );
VectorInverse( targetTM[ 2 ] );
@ -1127,8 +1170,11 @@ SkelMat4 skelBone_HoseRotParent::GetDirtyTransform( const skelAnimStoreFrameList
SkelMat4 myParentTM;
SkelMat4 targetTM;
if( m_parent )
{
myParentTM = m_parent->GetTransform( frames );
targetTM = m_target->GetTransform( frames );
}
VectorInverse( myParentTM[ 0 ] );
VectorInverse( myParentTM[ 2 ] );

View file

@ -95,7 +95,14 @@ int TIKI_Anim_NumForName( dtiki_t *pmdl, const char *name )
iMiddle = ( iBottom + iTop ) / 2;
panimdef = pmdl->a->animdefs[ iMiddle ];
if( !panimdef )
{
iComp = -1;
}
else
{
iComp = stricmp( panimdef->alias, name );
}
if( !iComp )
{
@ -161,13 +168,13 @@ int TIKI_Anim_NumForName( dtiki_t *pmdl, const char *name )
return iMiddle;
}
if( iComp <= 0 )
if( iComp > 0 )
{
iBottom = iMiddle + 1;
iTop = iMiddle - 1;
}
else
{
iTop = iMiddle - 1;
iBottom = iMiddle + 1;
}
}

View file

@ -263,12 +263,14 @@ void TIKI_FreeAll()
}
tiki->m_boneList.CleanUpChannels();
/*
if( tiki->a->m_aliases )
{
TIKI_Free( tiki->a->m_aliases );
tiki->a->m_aliases = NULL;
tiki->a->num_anims = 0;
}
*/
TIKI_Free( tiki );
}
@ -285,6 +287,14 @@ void TIKI_FreeAll()
tikianim = *entryanim;
TIKI_RemoveTiki( tikianim );
if( tikianim->m_aliases )
{
TIKI_Free( tikianim->m_aliases );
tikianim->m_aliases = NULL;
tikianim->num_anims = 0;
}
TIKI_Free( tikianim );
}

View file

@ -132,7 +132,7 @@ dtikianim_t *TIKI_LoadTikiAnim( const char *path )
token = loaddef.tikiFile.GetToken( true );
if( strcmp( token, "TIKI" ) )
{
TIKI_Error( "TIKI_LoadTIKIfile: def file %s has wrong header (%s should be TIKI)\n", loaddef.tikiFile.Filename() );
TIKI_Error( "TIKI_LoadTIKIfile: def file %s has wrong header (%s should be TIKI)\n", loaddef.tikiFile.Filename(), token );
loaddef.tikiFile.Close();
return NULL;
}
@ -436,7 +436,7 @@ skelAnimDataGameHeader_t *SkeletorCacheFileCallback( const char *path )
char tempName[ 100 ];
char extension[ 100 ];
skelAnimDataGameHeader_t *finishedHeader;
void *buffer;
char *buffer;
char npath[ 256 ];
Skel_ExtractFileExtension( path, extension );
@ -464,7 +464,7 @@ skelAnimDataGameHeader_t *SkeletorCacheFileCallback( const char *path )
return NULL;
}
if( pHeader->ident != TIKI_SKC_HEADER_IDENT || pHeader->version != TIKI_SKC_HEADER_VERSION )
if( pHeader->ident != TIKI_SKC_HEADER_IDENT || ( pHeader->version != TIKI_SKC_HEADER_OLD_VERSION && pHeader->version != TIKI_SKC_HEADER_VERSION ) )
{
Com_Printf( "Skeletor CacheAnimSkel: anim %s has wrong header ([ident,version] = [%i,%i] should be [%i,%i])\n", path,
pHeader->ident, pHeader->version,
@ -473,12 +473,26 @@ skelAnimDataGameHeader_t *SkeletorCacheFileCallback( const char *path )
return NULL;
}
if( pHeader->version == TIKI_SKC_HEADER_OLD_VERSION )
{
Com_Printf( "WARNING- DOWNGRADING TO OLD ANIMATION FORMAT FOR FILE: %s\n", path );
finishedHeader = skeletor_c::ConvertSkelFileToGame( pHeader, iBuffLength, path );
if( convertAnims && convertAnims->integer )
{
skeletor_c::SaveProcessedAnim( finishedHeader, path, pHeader );
}
}
else
{
// looks like SKC version 14 and above are processed animations
// points the buffer to the animation data
buffer = ( char * )pHeader + sizeof( int ) + sizeof( int );
iBuffLength -= sizeof( int ) + sizeof( int );
// loads the processed animation
finishedHeader = skeletor_c::LoadProcessedAnimEx( path, buffer, iBuffLength, path );
}
TIKI_FreeFile( pHeader );
}
@ -646,7 +660,7 @@ void SkeletorCacheCleanCache()
{
int i;
for( i = 0; i < m_numInCache; i++ )
for( i = m_numInCache - 1; i >= 0; i-- )
{
if( !m_cachedData[ m_cachedDataLookup[ i ] ].numusers ) {
SkeletorCacheUnloadData( i );
@ -1025,6 +1039,6 @@ void TIKI_RemoveTiki( dtikianim_t *ptiki )
for( i = 0; i < ptiki->num_anims; i++ )
{
alias_index = ptiki->m_aliases[ i ];
m_cachedData[ i ].numusers--;
m_cachedData[ alias_index ].numusers--;
}
}

View file

@ -37,6 +37,8 @@ void TIKI_DPrintf( const char *fmt, ... )
Com_DPrintf( "%s", msg );
}
#ifndef _DEBUG_MEM
void TIKI_Free( void *ptr )
{
Z_Free( ptr );
@ -47,6 +49,8 @@ void *TIKI_Alloc( size_t size )
return Z_TagMalloc( size, TAG_TIKI );
}
#endif
void TIKI_FreeFile( void *buffer )
{
FS_FreeFile( buffer );

View file

@ -30,8 +30,15 @@ extern "C" {
#endif
void TIKI_DPrintf( const char *fmt, ... );
#ifndef _DEBUG_MEM
void TIKI_Free( void *ptr );
void *TIKI_Alloc( size_t size );
#else
#define TIKI_Free(ptr) free(ptr)
#define TIKI_Alloc(size) malloc(size)
#endif
void TIKI_FreeFile( void *buffer );
int TIKI_ReadFileEx( const char *qpath, void **buffer, qboolean quiet );

View file

@ -331,7 +331,7 @@ qboolean TIKI_ParseIncludes( dloaddef_t *ld )
const char *token;
qboolean b_incl = false;
const char *mapname;
int depth;
int depth = 0;
token = ld->tikiFile.GetToken( true );
if( sv_mapname )
@ -345,7 +345,9 @@ qboolean TIKI_ParseIncludes( dloaddef_t *ld )
while( 1 )
{
if( !strncmp( token, mapname, strlen( token ) ) )
if( !strncmp( token, mapname, strlen( token ) )
|| !strncmp( token, "spearheadserver", strlen( token ) )
|| !strncmp( token, "breakthroughserver", strlen( token ) ) )
{
b_incl = true;
}
@ -395,7 +397,7 @@ void TIKI_ParseAnimations( dloaddef_t *ld )
dloadanim_t *anim;
qboolean b_mapspec = false;
const char *mapname;
size_t depth;
size_t depth = 0;
ld->tikiFile.GetToken( true );
@ -1154,6 +1156,9 @@ void TIKI_ParseInitCommands( dloaddef_t *ld, dloadinitcmd_t **cmdlist, int maxcm
{
( *numcmds )++;
cmd->num_args = 0;
cmd->args = NULL;
ld->tikiFile.UnGetToken();
while( ld->tikiFile.TokenAvailable( false ) )
{

View file

@ -60,11 +60,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// skd skeletor
#define TIKI_SKD_HEADER_IDENT ( *( int * )"SKMD" )
#define TIKI_SKD_HEADER_VERSION 5
#define TIKI_SKD_HEADER_OLD_VERSION 5
#define TIKI_SKD_HEADER_VERSION 6
// skc skeletor animations
#define TIKI_SKC_HEADER_IDENT ( *( int * )"SKAN" )
#define TIKI_SKC_HEADER_VERSION 13
#define TIKI_SKC_HEADER_OLD_VERSION 13
#define TIKI_SKC_HEADER_VERSION 14
// tiki limitations
#define TIKI_MAX_BONES 100

View file

@ -191,11 +191,13 @@ void TIKI_CacheFileSkel( skelHeader_t *pHeader, skelcache_t *cache, int length )
if( pHeader->version > TIKI_SKB_HEADER_VERSION )
{
char *pMorphTargets;
size_t nLen;
intptr_t nLen;
nBoxBytes = pHeader->numBoxes * sizeof( skelHitBox_t );
pMorphTargets = ( char * )pHeader + pHeader->ofsMorphTargets;
if( pHeader->ofsMorphTargets > 0 || ( pHeader->ofsMorphTargets + pHeader->numMorphTargets ) < length )
{
for( i = 0; i < pHeader->numMorphTargets; i++ )
{
nLen = strlen( pMorphTargets ) + 1;
@ -203,6 +205,11 @@ void TIKI_CacheFileSkel( skelHeader_t *pHeader, skelcache_t *cache, int length )
pMorphTargets += nLen;
}
}
else
{
nMorphBytes = pHeader->numMorphTargets;
}
}
else if( pHeader->version == TIKI_SKB_HEADER_VERSION )
{
nBoxBytes = pHeader->numBoxes * sizeof( skelHitBox_t );
@ -325,7 +332,7 @@ void TIKI_CacheFileSkel( skelHeader_t *pHeader, skelcache_t *cache, int length )
if( nBoneBytes )
{
if( pHeader->version < TIKI_SKD_HEADER_VERSION )
if( pHeader->version <= TIKI_SKB_HEADER_VERSION )
{
skelBoneName_t *TIKI_bones = ( skelBoneName_t * )( ( byte * )pHeader + pHeader->ofsBones );
for( i = 0; i < pSkel->numBones; i++ )
@ -372,7 +379,7 @@ void TIKI_CacheFileSkel( skelHeader_t *pHeader, skelcache_t *cache, int length )
if( nBoxBytes )
{
if( pHeader->ofsBoxes < 0 || ( nBoxBytes + pHeader->ofsBoxes ) > length )
if( pHeader->ofsBoxes <= 0 || ( nBoxBytes + pHeader->ofsBoxes ) >= length )
{
Com_Printf( "^~^~^ Box data is corrupted for '%s'\n", cache->path );
pSkel->numMorphTargets = 0;
@ -398,7 +405,7 @@ void TIKI_CacheFileSkel( skelHeader_t *pHeader, skelcache_t *cache, int length )
if( nMorphBytes )
{
if( pHeader->ofsMorphTargets < 0 || ( nMorphBytes + pHeader->ofsMorphTargets ) > length )
if( pHeader->ofsMorphTargets <= 0 || ( nMorphBytes + pHeader->ofsMorphTargets ) >= length )
{
Com_Printf( "^~^~^ Morph targets data is corrupted for '%s'\n", cache->path );
pSkel->numMorphTargets = 0;
@ -524,7 +531,7 @@ qboolean TIKI_LoadSKB( const char *path, skelcache_t *cache )
}
version = LittleLong( pheader->version );
if( version != TIKI_SKB_HEADER_VER_3 || version != TIKI_SKB_HEADER_VERSION )
if( version != TIKI_SKB_HEADER_VER_3 && version != TIKI_SKB_HEADER_VERSION )
{
TIKI_Error( "TIKI_LoadSKB: %s has wrong version (%i should be %i or %i)\n", path, version, TIKI_SKB_HEADER_VER_3, TIKI_SKB_HEADER_VERSION );
TIKI_Free( pheader );
@ -599,10 +606,12 @@ qboolean TIKI_LoadSKB( const char *path, skelcache_t *cache )
newVerts->numMorphs = 0;
newVerts->numWeights = oldVerts->numWeights;
skelWeight_t *newWeights = ( skelWeight_t * )( ( byte * )newVerts + sizeof( skeletorVertex_t ) );
for( k = 0; k < oldVerts->numWeights; k++ )
{
skelWeight_t *newWeights = ( skelWeight_t * )( ( byte * )newVerts + sizeof( skeletorVertex_t ) * k );
memcpy( newWeights, &oldVerts->weights[ k ], sizeof( skelWeight_t ) );
newWeights++;
}
oldVerts = ( skelVertex_t * )( ( byte * )oldVerts + sizeof( skelWeight_t ) * oldVerts->numWeights + ( sizeof( skelVertex_t ) - sizeof( skelWeight_t ) ) );
@ -781,7 +790,7 @@ qboolean TIKI_LoadSKD( const char *path, skelcache_t *cache )
// Check the version
version = LittleLong( pheader->version );
if( version != TIKI_SKD_HEADER_VERSION )
if( version != TIKI_SKD_HEADER_OLD_VERSION && version != TIKI_SKD_HEADER_VERSION )
{
TIKI_Error( "TIKI_LoadSKD: %s has wrong version (%i should be %i)\n", path, version, TIKI_SKD_HEADER_VERSION );
TIKI_FreeFile( pheader );

View file

@ -2335,9 +2335,25 @@ typedef struct skelAnimDataGameHeader_s {
skanChannelHdr ary_channels[ 1 ];
} skelAnimDataGameHeader_t;
typedef struct skelAnimDataGameHeader2_s {
int flags;
char bHasDelta;
char bHasMorph;
short bHasUpper;
int numFrames;
SkelVec3 totalDelta;
float totalAngleDelta;
float frameTime;
SkelVec3 bounds[ 2 ];
skelAnimGameFrame_t *m_frame;
short int nTotalChannels;
skelChannelList_c channelList;
skanChannelHdr ary_channels[ 1 ];
} skelAnimDataGameHeader2_t;
typedef struct ChannelName_s {
char name[ 32 ];
short un1;
short int channelNum;
} ChannelName_t;
typedef struct ChannelNameTable_s {
@ -2459,15 +2475,13 @@ typedef struct fcm_s
typedef struct varnode_s
{
short unsigned int flags;
} varnode_t;
typedef union varnodeUnpacked_u {
float fVariance;
struct s {
typedef struct varnodeUnpacked_u {
byte flags;
unsigned char unused[ 3 ];
};
byte unused_0;
byte unused_1;
byte unused_2;
} varnodeUnpacked_t;
typedef unsigned short terraInt;
@ -2522,6 +2536,31 @@ typedef struct srfTerrain_s {
float lmapY;
} srfTerrain_t;
typedef struct cTerraPatch_s {
byte flags;
byte lmapScale;
byte s;
byte t;
float texCoord[ 2 ][ 2 ][ 2 ];
char x;
char y;
short iBaseHeight;
unsigned short iShader;
unsigned short iLightMap;
short iNorth;
short iEast;
short iSouth;
short iWest;
varnode_t varTree[ 2 ][ 63 ];
unsigned char heightmap[ 9 * 9 ];
} cTerraPatch_t;
typedef struct cTerraPatchUnpacked_s {
srfTerrain_t drawinfo;
int viewCount;
@ -5472,6 +5511,26 @@ typedef struct reallightinfo_s {
vec3_t vDirection;
} reallightinfo_t;
typedef struct light_s {
char char0;
_DWORD dword4;
vec3_t m_vOrigin;
vec3_t m_vSpotDir;
_BYTE gap20[4];
bool m_bLinear;
float m_fFalloff;
_BYTE gap2C[4];
float m_fRealIntensity;
vec3_t m_vColor;
float m_fSpotRadiusByDistance;
_BYTE gap44[4];
_DWORD dword48;
void *m_pShader;
float m_fScale;
float m_fOverbright;
float m_fDist;
} light_t;
typedef float cube_entry_t[3][4];
typedef struct {
@ -5498,8 +5557,8 @@ typedef struct {
struct mnode_s *leaf;
qboolean needs_trace;
qboolean spot_light;
float spot_radiusbydistance;
vec3_t spot_dir;
float spot_radiusbydistance;
int reference_count;
} spherel_t;

View file

@ -93,7 +93,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NO_SCRIPTENGINE;STANDALONE;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;../../../code/tools/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
@ -102,24 +102,32 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\code\tools\FBX\FBX SDK\2016.1.2\lib\vs2013\x86\debug</AdditionalLibraryDirectories>
<StackReserveSize>
</StackReserveSize>
<StackCommitSize>
</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NO_SCRIPTENGINE;STANDALONE;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;../../../code/tools/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\code\tools\FBX\FBX SDK\2016.1.2\lib\vs2013\x64\debug</AdditionalLibraryDirectories>
<StackReserveSize>
</StackReserveSize>
<StackCommitSize>
</StackCommitSize>
</Link>
<PostBuildEvent>
<Command>$(SolutionDir)..\..\build_increment.bat $(SolutionDir)..\..\$(ProjectName)</Command>
@ -134,7 +142,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NO_SCRIPTENGINE;STANDALONE;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;../../../code/tools/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
@ -144,6 +152,10 @@
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;libfbxsdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\code\tools\FBX\FBX SDK\2016.1.2\lib\vs2013\x86\release</AdditionalLibraryDirectories>
<StackReserveSize>
</StackReserveSize>
<StackCommitSize>
</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -155,7 +167,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NO_SCRIPTENGINE;STANDALONE;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../code/SDL2/include;../../../code/globalcpp;../../../code/testutils;../../../code/globalcpp/dummy;../../../code/qcommon;../../../code/tools/FBX/FBX SDK/2016.1.2/include;../../../code/tools/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
@ -165,6 +177,10 @@
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\code\tools\FBX\FBX SDK\2016.1.2\lib\vs2013\x64\release</AdditionalLibraryDirectories>
<StackReserveSize>
</StackReserveSize>
<StackCommitSize>
</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@ -230,7 +246,43 @@
<ClCompile Include="..\..\..\code\tiki\tiki_surface.cpp" />
<ClCompile Include="..\..\..\code\tiki\tiki_tag.cpp" />
<ClCompile Include="..\..\..\code\tiki\tiki_utility.cpp" />
<ClCompile Include="..\..\..\code\tools\common\aselib.c" />
<ClCompile Include="..\..\..\code\tools\common\bspfile.c" />
<ClCompile Include="..\..\..\code\tools\common\cmdlib.c" />
<ClCompile Include="..\..\..\code\tools\common\imagelib.c" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jcomapi.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdapimin.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdapistd.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdatasrc.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdcoefct.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdcolor.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jddctmgr.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdhuff.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdinput.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmainct.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmarker.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmaster.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdpostct.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdsample.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdtrans.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jerror.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jfdctflt.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jidctflt.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jmemmgr.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jmemnobs.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jpgload.cpp" />
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jutils.cpp" />
<ClCompile Include="..\..\..\code\tools\common\l3dslib.c" />
<ClCompile Include="..\..\..\code\tools\common\mathlib.c" />
<ClCompile Include="..\..\..\code\tools\common\mutex.c" />
<ClCompile Include="..\..\..\code\tools\common\polylib.c" />
<ClCompile Include="..\..\..\code\tools\common\scriplib.c" />
<ClCompile Include="..\..\..\code\tools\common\threads.c" />
<ClCompile Include="..\..\..\code\tools\common\trilib.c" />
<ClCompile Include="..\..\..\code\tools\converter\bspconverter.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\bspentity.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\bsplight.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\bspworld.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\formatconverter.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\main.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\mapconverter.cpp" />
@ -239,6 +291,33 @@
<ClCompile Include="..\..\..\code\tools\converter\skdconverter.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\tikiconverter.cpp" />
<ClCompile Include="..\..\..\code\tools\converter\tr_shared.c" />
<ClCompile Include="..\..\..\code\tools\q3map\brush.c" />
<ClCompile Include="..\..\..\code\tools\q3map\brush_primit.c" />
<ClCompile Include="..\..\..\code\tools\q3map\bsp.c" />
<ClCompile Include="..\..\..\code\tools\q3map\facebsp.c" />
<ClCompile Include="..\..\..\code\tools\q3map\fog.c" />
<ClCompile Include="..\..\..\code\tools\q3map\glfile.c" />
<ClCompile Include="..\..\..\code\tools\q3map\leakfile.c" />
<ClCompile Include="..\..\..\code\tools\q3map\light.c" />
<ClCompile Include="..\..\..\code\tools\q3map\lightmaps.c" />
<ClCompile Include="..\..\..\code\tools\q3map\lightv.c" />
<ClCompile Include="..\..\..\code\tools\q3map\light_trace.c" />
<ClCompile Include="..\..\..\code\tools\q3map\map.c" />
<ClCompile Include="..\..\..\code\tools\q3map\mesh.c" />
<ClCompile Include="..\..\..\code\tools\q3map\misc_model.c" />
<ClCompile Include="..\..\..\code\tools\q3map\nodraw.c" />
<ClCompile Include="..\..\..\code\tools\q3map\patch.c" />
<ClCompile Include="..\..\..\code\tools\q3map\portals.c" />
<ClCompile Include="..\..\..\code\tools\q3map\prtfile.c" />
<ClCompile Include="..\..\..\code\tools\q3map\shaders.c" />
<ClCompile Include="..\..\..\code\tools\q3map\soundv.c" />
<ClCompile Include="..\..\..\code\tools\q3map\surface.c" />
<ClCompile Include="..\..\..\code\tools\q3map\terrain.c" />
<ClCompile Include="..\..\..\code\tools\q3map\tjunction.c" />
<ClCompile Include="..\..\..\code\tools\q3map\tree.c" />
<ClCompile Include="..\..\..\code\tools\q3map\vis.c" />
<ClCompile Include="..\..\..\code\tools\q3map\visflow.c" />
<ClCompile Include="..\..\..\code\tools\q3map\writebsp.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\code\globalcpp\archive.h" />
@ -303,7 +382,36 @@
<ClInclude Include="..\..\..\code\tiki\tiki_surface.h" />
<ClInclude Include="..\..\..\code\tiki\tiki_tag.h" />
<ClInclude Include="..\..\..\code\tiki\tiki_utility.h" />
<ClInclude Include="..\..\..\code\tools\common\aselib.h" />
<ClInclude Include="..\..\..\code\tools\common\bspfile.h" />
<ClInclude Include="..\..\..\code\tools\common\cmdlib.h" />
<ClInclude Include="..\..\..\code\tools\common\imagelib.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jchuff.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jconfig.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jdct.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jdhuff.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jerror.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jinclude.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jmemsys.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jmorecfg.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jpegint.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jversion.h" />
<ClInclude Include="..\..\..\code\tools\common\jpeglib.h" />
<ClInclude Include="..\..\..\code\tools\common\l3dslib.h" />
<ClInclude Include="..\..\..\code\tools\common\mathlib.h" />
<ClInclude Include="..\..\..\code\tools\common\mutex.h" />
<ClInclude Include="..\..\..\code\tools\common\pakstuff.h" />
<ClInclude Include="..\..\..\code\tools\common\polylib.h" />
<ClInclude Include="..\..\..\code\tools\common\polyset.h" />
<ClInclude Include="..\..\..\code\tools\common\scriplib.h" />
<ClInclude Include="..\..\..\code\tools\common\str.h" />
<ClInclude Include="..\..\..\code\tools\common\surfaceflags.h" />
<ClInclude Include="..\..\..\code\tools\common\threads.h" />
<ClInclude Include="..\..\..\code\tools\common\trilib.h" />
<ClInclude Include="..\..\..\code\tools\converter\bspconverter.h" />
<ClInclude Include="..\..\..\code\tools\converter\bspentity.h" />
<ClInclude Include="..\..\..\code\tools\converter\bsplight.h" />
<ClInclude Include="..\..\..\code\tools\converter\bspworld.h" />
<ClInclude Include="..\..\..\code\tools\converter\formatconverter.h" />
<ClInclude Include="..\..\..\code\tools\converter\mapconverter.h" />
<ClInclude Include="..\..\..\code\tools\converter\shadermanager.h" />
@ -312,6 +420,15 @@
<ClInclude Include="..\..\..\code\tools\converter\tikiconverter.h" />
<ClInclude Include="..\..\..\code\tools\converter\tr_shared.h" />
<ClInclude Include="..\..\..\code\tools\converter\version.h" />
<ClInclude Include="..\..\..\code\tools\q3map\light.h" />
<ClInclude Include="..\..\..\code\tools\q3map\map.h" />
<ClInclude Include="..\..\..\code\tools\q3map\mesh.h" />
<ClInclude Include="..\..\..\code\tools\q3map\qbsp.h" />
<ClInclude Include="..\..\..\code\tools\q3map\shaders.h" />
<ClInclude Include="..\..\..\code\tools\q3map\vis.h" />
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram.cd" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -19,6 +19,15 @@
<Filter Include="tiki_skeletor">
<UniqueIdentifier>{8d8c8602-bd22-47a2-b420-53e8a35ab2c0}</UniqueIdentifier>
</Filter>
<Filter Include="q3map">
<UniqueIdentifier>{bb5b422a-47f6-47e8-8873-39789c9a917b}</UniqueIdentifier>
</Filter>
<Filter Include="q3_common">
<UniqueIdentifier>{b8821f97-61c4-492a-97b8-8dc7d7b23b93}</UniqueIdentifier>
</Filter>
<Filter Include="jpeglib">
<UniqueIdentifier>{bda88887-861f-493a-9248-9792a05d2489}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\code\globalcpp\archive.cpp">
@ -234,6 +243,195 @@
<ClCompile Include="..\..\..\code\tools\converter\shadermanager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\converter\bspentity.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\converter\bsplight.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\converter\bspworld.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jcomapi.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdapimin.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdapistd.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdatasrc.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdcoefct.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdcolor.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jddctmgr.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdhuff.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdinput.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmainct.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmarker.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdmaster.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdpostct.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdsample.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jdtrans.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jerror.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jfdctflt.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jidctflt.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jmemmgr.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jmemnobs.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jpgload.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\jpeg6\jutils.cpp">
<Filter>jpeglib</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\brush.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\brush_primit.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\bsp.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\facebsp.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\fog.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\glfile.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\leakfile.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\light.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\light_trace.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\lightmaps.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\lightv.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\map.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\mesh.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\misc_model.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\nodraw.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\patch.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\portals.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\prtfile.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\shaders.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\soundv.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\surface.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\terrain.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\tjunction.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\tree.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\vis.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\visflow.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\q3map\writebsp.c">
<Filter>q3map</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\aselib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\bspfile.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\cmdlib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\imagelib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\l3dslib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\mathlib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\mutex.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\polylib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\scriplib.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\threads.c">
<Filter>q3_common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\code\tools\common\trilib.c">
<Filter>q3_common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\code\globalcpp\archive.h">
@ -449,5 +647,113 @@
<ClInclude Include="..\..\..\code\tools\converter\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\converter\bspentity.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\converter\bsplight.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\converter\bspworld.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jchuff.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jconfig.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jdct.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jdhuff.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jerror.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jinclude.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jmemsys.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jmorecfg.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jpegint.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeg6\jversion.h">
<Filter>jpeglib</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\light.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\map.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\mesh.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\qbsp.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\shaders.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\q3map\vis.h">
<Filter>q3map</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\aselib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\bspfile.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\cmdlib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\imagelib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\jpeglib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\l3dslib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\mathlib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\mutex.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\pakstuff.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\polylib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\polyset.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\scriplib.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\str.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\surfaceflags.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\threads.h">
<Filter>q3_common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\code\tools\common\trilib.h">
<Filter>q3_common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram.cd" />
</ItemGroup>
</Project>