clip->saturation.val = 1.0f;
clip->gamma.val = 1.0f;
- if ( ( p = strstr( s, "(sequence)" ) ) ) {
+ if ( ( p = strstr( s, "(sequence)" ) ) != NULL ) {
p[ -1 ] = 0;
clip->type = ID_ISEQ;
clip->source.seq.prefix = s;
break;
case ID_TFLG:
- if ( !tex ) {
+ if( tex == NULL ) {
goto Fail;
}
+
flags = getU2( fp );
i = -1;
+
+ //only one of the three axis bits should be set
if ( flags & 1 ) {
i = 0;
}
}
/* setup */
p->buffer = (const char *) buffer;
- p->cursor = (const char *) buffer;
+ p->cursor = p->buffer;
p->bufSize = bufSize;
p->max = p->buffer + bufSize;
p->curLine = 1; /* sea: new */
/* types */
typedef struct picoParser_s
{
- const char *buffer;
+ const char *buffer;
int bufSize;
- char *token;
+ char *token;
int tokenSize;
int tokenMax;
- const char *cursor;
- const char *max;
+ const char *cursor;
+ const char *max;
int curLine;
}
picoParser_t;
typedef struct picoMemStream_s
{
- const picoByte_t *buffer;
+ const picoByte_t *buffer;
int bufSize;
- const picoByte_t *curPos;
+ const picoByte_t *curPos;
int flag;
}
picoMemStream_t;
{ CHUNK_OBJECT_UV, "CHUNK_OBJECT_UV" },
{ 0, NULL }
};
-static char *DebugGetChunkName( int id ){
+static char *DebugGetChunkName( int id ) {
int i,max; /* imax? ;) */
max = sizeof( debugChunkNames ) / sizeof( debugChunkNames[0] );
/* read in surface name */
if ( !GetASCIIZ( pers,surfaceName,sizeof( surfaceName ) ) ) {
return 0; /* this is bad */
-
}
//PicoGetSurfaceName
/* ignore NULL name surfaces */
fixme: replace/clean this function
*/
-void _terrain_load_tga_buffer( unsigned char *buffer, unsigned char **pic, int *width, int *height ){
+void _terrain_load_tga_buffer( unsigned char *buffer, unsigned char **pic, int *width, int *height ) {
int row, column;
int columns, rows, numPixels;
unsigned char *pixbuf;
validates a picoterrain file
*/
-static int _terrain_canload( PM_PARAMS_CANLOAD ){
+static int _terrain_canload( PM_PARAMS_CANLOAD ) {
picoParser_t *p;
loads a picoterrain file
*/
-static picoModel_t *_terrain_load( PM_PARAMS_LOAD ){
+static picoModel_t *_terrain_load( PM_PARAMS_LOAD ) {
int i, j, v, pw[ 5 ], r;
picoParser_t *p;
/*
-Copyright (C) 2001-2006, William Joseph.
-Copyright (C) 2010-2014 COR Entertainment, LLC.
-All Rights Reserved.
+ Copyright (C) 2001-2006, William Joseph.
+ Copyright (C) 2010-2014 COR Entertainment, LLC.
+ All Rights Reserved.
-This file is part of GtkRadiant.
+ This file is part of GtkRadiant.
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include "iqm.h"
typedef unsigned char byte;
/*
-========================================================================
+ ========================================================================
-.IQM triangle model file format
+ .IQM triangle model file format
+
+ ========================================================================
+ */
-========================================================================
-*/
typedef struct {
- float s;
- float t;
+ float s;
+ float t;
} iqmSt_t;
-void istream_read_iqmSt(PointerInputStream &inputStream, iqmSt_t &st)
-{
- st.s = istream_read_float32_le(inputStream);
- st.t = istream_read_float32_le(inputStream);
+void istream_read_iqmSt( PointerInputStream &inputStream, iqmSt_t &st ){
+ st.s = istream_read_float32_le( inputStream );
+ st.t = istream_read_float32_le( inputStream );
}
typedef struct {
- unsigned int indices[3];
+ unsigned int indices[3];
} iqmTriangle_t;
-void istream_read_iqmTriangle(PointerInputStream &inputStream, iqmTriangle_t &triangle)
-{
- triangle.indices[0] = istream_read_int32_le(inputStream);
- triangle.indices[1] = istream_read_int32_le(inputStream);
- triangle.indices[2] = istream_read_int32_le(inputStream);
+void istream_read_iqmTriangle( PointerInputStream &inputStream, iqmTriangle_t &triangle ){
+ triangle.indices[0] = istream_read_int32_le( inputStream );
+ triangle.indices[1] = istream_read_int32_le( inputStream );
+ triangle.indices[2] = istream_read_int32_le( inputStream );
}
typedef struct {
- float v[3];
+ float v[3];
} iqmPos_t;
-void istream_read_iqmPos(PointerInputStream &inputStream, iqmPos_t &iqmPos)
-{
- iqmPos.v[0] = istream_read_float32_le(inputStream);
- iqmPos.v[1] = istream_read_float32_le(inputStream);
- iqmPos.v[2] = istream_read_float32_le(inputStream);
+void istream_read_iqmPos( PointerInputStream &inputStream, iqmPos_t &iqmPos ){
+ iqmPos.v[0] = istream_read_float32_le( inputStream );
+ iqmPos.v[1] = istream_read_float32_le( inputStream );
+ iqmPos.v[2] = istream_read_float32_le( inputStream );
}
const int IQM_POSITION = 0;
const int IQM_LOOP = 1;
typedef struct iqmHeader_s {
- byte id[16];
- unsigned int version;
- unsigned int filesize;
- unsigned int flags;
- unsigned int num_text, ofs_text;
- unsigned int num_meshes, ofs_meshes;
- unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
- unsigned int num_triangles, ofs_triangles, ofs_neighbors;
- unsigned int num_joints, ofs_joints;
- unsigned int num_poses, ofs_poses;
- unsigned int num_anims, ofs_anims;
- unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
- unsigned int num_comment, ofs_comment;
- unsigned int num_extensions, ofs_extensions;
+ byte id[16];
+ unsigned int version;
+ unsigned int filesize;
+ unsigned int flags;
+ unsigned int num_text, ofs_text;
+ unsigned int num_meshes, ofs_meshes;
+ unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
+ unsigned int num_triangles, ofs_triangles, ofs_neighbors;
+ unsigned int num_joints, ofs_joints;
+ unsigned int num_poses, ofs_poses;
+ unsigned int num_anims, ofs_anims;
+ unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
+ unsigned int num_comment, ofs_comment;
+ unsigned int num_extensions, ofs_extensions;
} iqmHeader_t;
-void istream_read_iqmHeader(PointerInputStream &inputStream, iqmHeader_t &header)
-{
- inputStream.read(header.id, 16);
-#define READINT(x) header.x = istream_read_int32_le(inputStream);
- READINT (version)
- READINT (filesize)
- READINT (flags)
- READINT (num_text)
- READINT (ofs_text)
- READINT (num_meshes)
- READINT (ofs_meshes)
- READINT (num_vertexarrays)
- READINT (num_vertexes)
- READINT (ofs_vertexarrays)
- READINT (num_triangles)
- READINT (ofs_triangles)
- READINT (ofs_neighbors)
- READINT (num_joints)
- READINT (ofs_joints)
- READINT (num_frames)
- READINT (num_framechannels)
- READINT (ofs_frames)
- READINT (ofs_bounds)
- READINT (num_comment)
- READINT (ofs_comment)
- READINT (num_extensions)
- READINT (ofs_extensions)
+void istream_read_iqmHeader( PointerInputStream &inputStream, iqmHeader_t &header ){
+ inputStream.read( header.id, 16 );
+#define READINT( x ) header.x = istream_read_int32_le( inputStream );
+ READINT( version )
+ READINT( filesize )
+ READINT( flags )
+ READINT( num_text )
+ READINT( ofs_text )
+ READINT( num_meshes )
+ READINT( ofs_meshes )
+ READINT( num_vertexarrays )
+ READINT( num_vertexes )
+ READINT( ofs_vertexarrays )
+ READINT( num_triangles )
+ READINT( ofs_triangles )
+ READINT( ofs_neighbors )
+ READINT( num_joints )
+ READINT( ofs_joints )
+ READINT( num_frames )
+ READINT( num_framechannels )
+ READINT( ofs_frames )
+ READINT( ofs_bounds )
+ READINT( num_comment )
+ READINT( ofs_comment )
+ READINT( num_extensions )
+ READINT( ofs_extensions )
#undef READINT
}
-typedef struct iqmvertexarray_s {
- unsigned int type;
- unsigned int flags;
- unsigned int format;
- unsigned int size;
- unsigned int offset;
+typedef struct iqmmesh_s {
+ unsigned int name;
+ unsigned int material;
+ unsigned int first_vertex;
+ unsigned int num_vertexes;
+ unsigned int first_triangle;
+ unsigned int num_triangles;
+} iqmmesh_t;
+
+void istream_read_iqmMesh( PointerInputStream &inputStream, iqmmesh_t &iqmmesh ){
+#define READUINT( x ) iqmmesh.x = istream_read_uint32_le( inputStream );
+ READUINT( name )
+ READUINT( material )
+ READUINT( first_vertex )
+ READUINT( num_vertexes )
+ READUINT( first_triangle )
+ READUINT( num_triangles )
+#undef READUINT
}
- iqmvertexarray_t;
-
-void istream_read_iqmVertexarray(PointerInputStream &inputStream, iqmvertexarray_t &out)
-{
-#define READINT(x) out.x = istream_read_int32_le(inputStream);
- READINT (type)
- READINT (flags)
- READINT (format)
- READINT (size)
- READINT (offset)
+
+typedef struct iqmvertexarray_s {
+ unsigned int type;
+ unsigned int flags;
+ unsigned int format;
+ unsigned int size;
+ unsigned int offset;
+} iqmvertexarray_t;
+
+void istream_read_iqmVertexarray( PointerInputStream &inputStream, iqmvertexarray_t &vertexarray ){
+#define READINT( x ) vertexarray.x = istream_read_int32_le( inputStream );
+ READINT( type )
+ READINT( flags )
+ READINT( format )
+ READINT( size )
+ READINT( offset )
#undef READINT
}
-
-ArbitraryMeshVertex IQMVertex_construct(const iqmPos_t *pos, const iqmPos_t *norm, const iqmSt_t *st)
-{
- return ArbitraryMeshVertex(
- Vertex3f(pos->v[0], pos->v[1], pos->v[2]),
- Normal3f(norm->v[0], norm->v[1], norm->v[2]),
- TexCoord2f(st->s, st->t)
- );
+ArbitraryMeshVertex IQMVertex_construct( const iqmPos_t *pos, const iqmPos_t *norm, const iqmSt_t *st ){
+ return ArbitraryMeshVertex(
+ Vertex3f( pos->v[0], pos->v[1], pos->v[2] ),
+ Normal3f( norm->v[0], norm->v[1], norm->v[2] ),
+ TexCoord2f( st->s, st->t )
+ );
}
-void IQMSurface_read(Model &model, const byte *buffer, ArchiveFile &file)
-{
- Surface &surface = model.newSurface();
- iqmHeader_t header;
- {
- PointerInputStream inputStream(buffer);
- istream_read_iqmHeader(inputStream, header);
- }
-
- {
-
- UniqueVertexBuffer<ArbitraryMeshVertex> inserter(surface.vertices());
- inserter.reserve(header.num_vertexes);
-
- int ofs_position = -1, ofs_st = -1, ofs_normal = -1;
- PointerInputStream vaStream(buffer + header.ofs_vertexarrays);
- for (unsigned int i = 0; i < header.num_vertexarrays; i++) {
- iqmvertexarray_t va;
- istream_read_iqmVertexarray(vaStream, va);
-
- switch (va.type) {
- case IQM_POSITION:
- if (va.format == IQM_FLOAT && va.size == 3) {
- ofs_position = va.offset;
- }
- break;
- case IQM_TEXCOORD:
- if (va.format == IQM_FLOAT && va.size == 2) {
- ofs_st = va.offset;
- }
- break;
- case IQM_NORMAL:
- if (va.format == IQM_FLOAT && va.size == 3) {
- ofs_normal = va.offset;
- }
- break;
- }
- }
-
- surface.indices().reserve(header.num_vertexes);
-
- PointerInputStream posStream(buffer + ofs_position);
- Array<iqmPos_t> iqmPos(header.num_vertexes);
- for (Array<iqmPos_t>::iterator i = iqmPos.begin(); i != iqmPos.end(); ++i) {
- istream_read_iqmPos(posStream, *i);
- }
-
- PointerInputStream normStream(buffer + ofs_normal);
- Array<iqmPos_t> iqmNorm(header.num_vertexes);
- for (Array<iqmPos_t>::iterator i = iqmNorm.begin(); i != iqmNorm.end(); ++i) {
- istream_read_iqmPos(normStream, *i);
- }
-
- Array<iqmSt_t> iqmSt(header.num_vertexes);
- PointerInputStream stStream(buffer + ofs_st);
- for (Array<iqmSt_t>::iterator i = iqmSt.begin(); i != iqmSt.end(); ++i) {
- istream_read_iqmSt(stStream, *i);
- }
-
- PointerInputStream triangleStream(buffer + header.ofs_triangles);
- for (unsigned int i = 0; i < header.num_triangles; ++i) {
- iqmTriangle_t triangle;
- istream_read_iqmTriangle(triangleStream, triangle);
- for (int j = 0; j < 3; j++) {
- surface.indices().insert(inserter.insert(IQMVertex_construct(
- &iqmPos[triangle.indices[j]],
- &iqmNorm[triangle.indices[j]],
- &iqmSt[triangle.indices[j]])));
- }
- }
- }
-
- surface.setShader("");
- surface.updateAABB();
+void IQMSurface_read( Model &model, const byte *buffer, ArchiveFile &file ){
+ iqmHeader_t header;
+ {
+ PointerInputStream inputStream( buffer );
+ istream_read_iqmHeader( inputStream, header );
+ }
+
+ int ofs_position = -1, ofs_st = -1, ofs_normal = -1;
+ PointerInputStream vaStream( buffer + header.ofs_vertexarrays );
+ for ( unsigned int i = 0; i < header.num_vertexarrays; i++ ) {
+ iqmvertexarray_t va;
+ istream_read_iqmVertexarray( vaStream, va );
+
+ switch ( va.type ) {
+ case IQM_POSITION:
+ if ( va.format == IQM_FLOAT && va.size == 3 ) {
+ ofs_position = va.offset;
+ }
+ break;
+ case IQM_TEXCOORD:
+ if ( va.format == IQM_FLOAT && va.size == 2 ) {
+ ofs_st = va.offset;
+ }
+ break;
+ case IQM_NORMAL:
+ if ( va.format == IQM_FLOAT && va.size == 3 ) {
+ ofs_normal = va.offset;
+ }
+ break;
+ }
+ }
+
+ PointerInputStream posStream( buffer + ofs_position );
+ Array<iqmPos_t> iqmPos( header.num_vertexes );
+ for ( Array<iqmPos_t>::iterator i = iqmPos.begin(); i != iqmPos.end(); ++i ) {
+ istream_read_iqmPos( posStream, *i );
+ }
+
+ PointerInputStream normStream( buffer + ofs_normal );
+ Array<iqmPos_t> iqmNorm( header.num_vertexes );
+ for ( Array<iqmPos_t>::iterator i = iqmNorm.begin(); i != iqmNorm.end(); ++i ) {
+ istream_read_iqmPos( normStream, *i );
+ }
+
+ Array<iqmSt_t> iqmSt( header.num_vertexes );
+ PointerInputStream stStream( buffer + ofs_st );
+ for ( Array<iqmSt_t>::iterator i = iqmSt.begin(); i != iqmSt.end(); ++i ) {
+ istream_read_iqmSt( stStream, *i );
+ }
+
+ PointerInputStream iqmMesh( buffer + header.ofs_meshes );
+ for ( unsigned int m = 0; m < header.num_meshes; m++ ) {
+ Surface &surface = model.newSurface();
+
+ iqmmesh_t iqmmesh;
+ istream_read_iqmMesh( iqmMesh, iqmmesh );
+
+ bool material_found = false;
+ // if not malformed data neither missing string
+ if ( iqmmesh.material <= header.num_text && iqmmesh.material > 0 ) {
+ char *material;
+ material = (char*) buffer + header.ofs_text + iqmmesh.material;
+
+ if ( material[0] != '\0' ) {
+ surface.setShader( material );
+ material_found = true;
+ }
+ }
+
+ if ( !material_found ) {
+ // empty string will trigger "textures/shader/notex" on display
+ surface.setShader( "" );
+ }
+
+ UniqueVertexBuffer<ArbitraryMeshVertex> inserter( surface.vertices() );
+ inserter.reserve( iqmmesh.num_vertexes );
+
+ surface.indices().reserve( iqmmesh.num_vertexes );
+
+ unsigned int triangle_offset = header.ofs_triangles + iqmmesh.first_triangle * sizeof( iqmTriangle_t );
+ PointerInputStream triangleStream( buffer + triangle_offset );
+ for ( unsigned int i = 0; i < iqmmesh.num_triangles; ++i ) {
+ iqmTriangle_t triangle;
+ istream_read_iqmTriangle( triangleStream, triangle );
+ for ( int j = 0; j < 3; j++ ) {
+ surface.indices().insert( inserter.insert( IQMVertex_construct(
+ &iqmPos[triangle.indices[j]],
+ &iqmNorm[triangle.indices[j]],
+ &iqmSt[triangle.indices[j]] ) ) );
+ }
+ }
+
+ surface.updateAABB();
+ }
}
-void IQMModel_read(Model &model, const byte *buffer, ArchiveFile &file)
-{
- IQMSurface_read(model, buffer, file);
- model.updateAABB();
+void IQMModel_read( Model &model, const byte *buffer, ArchiveFile &file ){
+ IQMSurface_read( model, buffer, file );
+ model.updateAABB();
}
-scene::Node &IQMModel_new(const byte *buffer, ArchiveFile &file)
-{
- ModelNode *modelNode = new ModelNode();
- IQMModel_read(modelNode->model(), buffer, file);
- return modelNode->node();
+scene::Node &IQMModel_new( const byte *buffer, ArchiveFile &file ){
+ ModelNode *modelNode = new ModelNode();
+ IQMModel_read( modelNode->model(), buffer, file );
+ return modelNode->node();
}
-scene::Node &IQMModel_default()
-{
- ModelNode *modelNode = new ModelNode();
- Model_constructNull(modelNode->model());
- return modelNode->node();
+scene::Node &IQMModel_default(){
+ ModelNode *modelNode = new ModelNode();
+ Model_constructNull( modelNode->model() );
+ return modelNode->node();
}
-scene::Node &IQMModel_fromBuffer(unsigned char *buffer, ArchiveFile &file)
-{
- if (memcmp(buffer, "INTERQUAKEMODEL", 16)) {
- globalErrorStream() << "IQM read error: incorrect ident\n";
- return IQMModel_default();
- } else {
- return IQMModel_new(buffer, file);
- }
+scene::Node &IQMModel_fromBuffer( unsigned char *buffer, ArchiveFile &file ){
+ if ( memcmp( buffer, "INTERQUAKEMODEL", 16 ) ) {
+ globalErrorStream() << "IQM read error: incorrect ident\n";
+ return IQMModel_default();
+ }
+ else {
+ return IQMModel_new( buffer, file );
+ }
}
-scene::Node &loadIQMModel(ArchiveFile &file)
-{
- ScopedArchiveBuffer buffer(file);
- return IQMModel_fromBuffer(buffer.buffer, file);
+scene::Node &loadIQMModel( ArchiveFile &file ){
+ ScopedArchiveBuffer buffer( file );
+ return IQMModel_fromBuffer( buffer.buffer, file );
}
/*
-Copyright (C) 2001-2006, William Joseph.
-All Rights Reserved.
+ Copyright (C) 2001-2006, William Joseph.
+ All Rights Reserved.
-This file is part of GtkRadiant.
+ This file is part of GtkRadiant.
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
-#if !defined(INCLUDED_IQM_H)
+#if !defined( INCLUDED_IQM_H )
#define INCLUDED_IQM_H
namespace scene { class Node; }
class ArchiveFile;
-scene::Node &loadIQMModel(ArchiveFile &file);
+scene::Node &loadIQMModel( ArchiveFile &file );
#endif
/*
-Copyright (C) 2001-2006, William Joseph.
-All Rights Reserved.
+ Copyright (C) 2001-2006, William Joseph.
+ All Rights Reserved.
-This file is part of GtkRadiant.
+ This file is part of GtkRadiant.
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include "plugin.h"
class IQMModelLoader : public ModelLoader {
public:
- scene::Node &loadModel(ArchiveFile &file)
- {
- return loadIQMModel(file);
- }
+scene::Node &loadModel( ArchiveFile &file ){
+ return loadIQMModel( file );
+}
};
class ModelDependencies :
- public GlobalFileSystemModuleRef,
- public GlobalOpenGLModuleRef,
- public GlobalUndoModuleRef,
- public GlobalSceneGraphModuleRef,
- public GlobalShaderCacheModuleRef,
- public GlobalSelectionModuleRef,
- public GlobalFiletypesModuleRef {
+ public GlobalFileSystemModuleRef,
+ public GlobalOpenGLModuleRef,
+ public GlobalUndoModuleRef,
+ public GlobalSceneGraphModuleRef,
+ public GlobalShaderCacheModuleRef,
+ public GlobalSelectionModuleRef,
+ public GlobalFiletypesModuleRef {
};
class ModelIQMAPI : public TypeSystemRef {
- IQMModelLoader m_modeliqm;
+IQMModelLoader m_modeliqm;
public:
- typedef ModelLoader Type;
+typedef ModelLoader Type;
- STRING_CONSTANT(Name, "iqm");
+STRING_CONSTANT( Name, "iqm" );
- ModelIQMAPI()
- {
- GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("iqm models", "*.iqm"));
- }
+ModelIQMAPI(){
+ GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "InterQuake Models", "*.iqm" ) );
+}
- ModelLoader *getTable()
- {
- return &m_modeliqm;
- }
+ModelLoader *getTable(){
+ return &m_modeliqm;
+}
};
typedef SingletonModule<ModelIQMAPI, ModelDependencies> ModelIQMModule;
ModelIQMModule g_ModelIQMModule;
-extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer &server)
-{
- initialiseModule(server);
+extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer &server ){
+ initialiseModule( server );
- g_ModelIQMModule.selfRegister();
+ g_ModelIQMModule.selfRegister();
}
/*
-Copyright (C) 2001-2006, William Joseph.
-All Rights Reserved.
+ Copyright (C) 2001-2006, William Joseph.
+ All Rights Reserved.
-This file is part of GtkRadiant.
+ This file is part of GtkRadiant.
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
-#if !defined(INCLUDED_SAMPLE_H)
+#if !defined( INCLUDED_SAMPLE_H )
#define INCLUDED_SAMPLE_H
#endif
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/* -------------------------------------------------------------------------------
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/* -------------------------------------------------------------------------------
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
void WriteTGAGray( const char *filename, byte *data, int width, int height ) {
byte buffer[18];
- FILE *f;
+ FILE *f;
memset( buffer, 0, 18 );
buffer[2] = 3; // uncompressed type
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
xmlNodeSetContent( node, (xmlChar*)buf );
level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN ) ;
level[1] = 0;
- xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );
+ xmlSetProp( node, (xmlChar*)"level", (xmlChar*)&level );
// a 'select' information
sprintf( buf, "%i %i", entitynum, brushnum );
select = xmlNewNode( NULL, (xmlChar*)"brush" );
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
#include "cmdlib.h"
#include "mathlib.h"
#include "inout.h"
=============
*/
void ClipWindingEpsilonStrict( winding_t *in, vec3_t normal, vec_t dist,
- vec_t epsilon, winding_t **front, winding_t **back ){
+ vec_t epsilon, winding_t **front, winding_t **back ){
vec_t dists[MAX_POINTS_ON_WINDING + 4];
int sides[MAX_POINTS_ON_WINDING + 4];
int counts[3];
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
*/
void AddScriptToStack( const char *filename, int index ){
int size;
+ void* buffer;
script++;
if ( script == &scriptstack[MAX_INCLUDES] ) {
}
strcpy( script->filename, ExpandPath( filename ) );
- size = vfsLoadFile( script->filename, (void **)&script->buffer, index );
+ size = vfsLoadFile( script->filename, &buffer, index );
if ( size == -1 ) {
Sys_Printf( "Script file %s was not found\n", script->filename );
+ script--;
}
else
{
else{
Sys_Printf( "entering %s\n", script->filename );
}
- }
- script->line = 1;
- script->script_p = script->buffer;
- script->end_p = script->buffer + size;
+ script->buffer = buffer;
+ script->line = 1;
+ script->script_p = script->buffer;
+ script->end_p = script->buffer + size;
+ }
}
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
for ( i = 0 ; i < numthreads ; i++ )
{
/* Default pthread attributes: joinable & non-realtime scheduling */
- if (pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(size_t)i ) != 0 ) {
+ if ( pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(uintptr_t)i ) != 0 ) {
Error( "pthread_create failed" );
}
}
=============
*/
void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){
- int i;
int start, end;
dispatch = 0;
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
for ( i = 0; i < gi.number_entry; i++ )
{
char filename_inzip[NAME_MAX];
+ char *filename_lower;
unz_file_info file_info;
VFS_PAKFILE* file;
g_pakFiles = g_slist_append( g_pakFiles, file );
vfsFixDOSName( filename_inzip );
- g_strdown( filename_inzip );
+ //-1 null terminated string
+ filename_lower = g_ascii_strdown( filename_inzip, -1 );
- file->name = strdup( filename_inzip );
+ file->name = strdup( filename_lower );
file->size = file_info.uncompressed_size;
file->zipfile = uf;
file->zippos = pos;
break;
}
}
+ g_free( filename_lower );
}
}
int vfsGetFileCount( const char *filename ){
int i, count = 0;
char fixed[NAME_MAX], tmp[NAME_MAX];
+ char *lower;
GSList *lst;
strcpy( fixed, filename );
vfsFixDOSName( fixed );
- g_strdown( fixed );
+ lower = g_ascii_strdown( fixed, -1 );
for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) )
{
VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data;
- if ( strcmp( file->name, fixed ) == 0 ) {
+ if ( strcmp( file->name, lower ) == 0 ) {
count++;
}
}
for ( i = 0; i < g_numDirs; i++ )
{
strcpy( tmp, g_strDirs[i] );
- strcat( tmp, fixed );
+ strcat( tmp, lower );
if ( access( tmp, R_OK ) == 0 ) {
count++;
}
}
-
+ g_free( lower );
return count;
}
int vfsLoadFile( const char *filename, void **bufferptr, int index ){
int i, count = 0;
char tmp[NAME_MAX], fixed[NAME_MAX];
+ char *lower;
GSList *lst;
// filename is a full path
*bufferptr = NULL;
strcpy( fixed, filename );
vfsFixDOSName( fixed );
- g_strdown( fixed );
+ lower = g_ascii_strdown( fixed, -1 );
for ( i = 0; i < g_numDirs; i++ )
{
{
VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data;
- if ( strcmp( file->name, fixed ) != 0 ) {
+ if ( strcmp( file->name, lower ) != 0 ) {
continue;
}
if ( count == index ) {
- if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) {
- return -1;
- }
+ if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) {
+ return -1;
+ }
if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) {
return -1;
}
return -1;
}
else{
+ g_free( lower );
return file->size;
}
}
count++;
}
-
+ g_free( lower );
return -1;
}
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
return bytesRead;
}
-static int ReadChunkAndLength( FILE *fp, short *chunk, long *len ){
+static int ReadChunkAndLength( FILE *fp, unsigned short *chunk, long *len ){
if ( fread( chunk, sizeof( short ), 1, fp ) != 1 ) {
return 0;
}
}
static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen ){
- short chunkID;
+ unsigned short chunkID;
long chunkLen;
long bytesRead = 0;
static void LoadMaterialList( FILE *fp, long thisChunkLen, _3DSMaterial_t *pMat ){
long chunkLen;
- short chunkID;
+ unsigned short chunkID;
long bytesRead = 0;
_3DSMaterial_t mat;
char curdir[1024];
static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pTO ){
long chunkLen;
- short chunkID;
+ unsigned short chunkID;
int i = 0;
long bytesRead = 0;
_3DSTriObject_t triObj;
static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO ){
long chunkLen;
- short chunkID;
+ unsigned short chunkID;
int i = 0;
long bytesRead = 0;
char name[100];
}
static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){
- short chunkID;
+ unsigned short chunkID;
long chunkLen;
long bytesRead = 0;
_3DSEditChunk_t editChunk;
static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ){
FILE *fp;
- short chunkID;
+ unsigned short chunkID;
long chunkLen;
_3DSEditChunk_t editChunk;
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
_3DSEditChunk_t editChunk;
} _3DS_t;
-#define _3DS_CHUNK_NULL ((short) 0x0000)
-#define _3DS_CHUNK_UNKNOWN0 ((short) 0x0001)
-#define _3DS_CHUNK_M3D_VERSION ((short) 0x0002)
-#define _3DS_CHUNK_M3D_KFVERSION ((short) 0x0005)
-#define _3DS_CHUNK_COLOR_F ((short) 0x0010)
-#define _3DS_CHUNK_COLOR_24 ((short) 0x0011)
-#define _3DS_CHUNK_LIN_COLOR_24 ((short) 0x0012)
-#define _3DS_CHUNK_LIN_COLOR_F ((short) 0x0013)
-#define _3DS_CHUNK_INT_PERCENTAGE ((short) 0x0030)
-#define _3DS_CHUNK_FLOAT_PERCENT ((short) 0x0031)
-#define _3DS_CHUNK_MASTER_SCALE ((short) 0x0100)
-#define _3DS_CHUNK_CHUNK_TYPE ((short) 0x0995)
-#define _3DS_CHUNK_CHUNK_UNIQUE ((short) 0x0996)
-#define _3DS_CHUNK_NOT_CHUNK ((short) 0x0997)
-#define _3DS_CHUNK_CONTAINER ((short) 0x0998)
-#define _3DS_CHUNK_IS_CHUNK ((short) 0x0999)
-#define _3DS_CHUNK_C_SXP_SELFI_MASKDATA ((short) 0x0c3c)
-
-#define _3DS_CHUNK_BITMAP ((short) 0x1100)
-#define _3DS_CHUNK_USE_BITMAP ((short) 0x1101)
-#define _3DS_CHUNK_SOLID_BGND ((short) 0x1200)
-#define _3DS_CHUNK_USE_SOLID_BGND ((short) 0x1201)
-
-#define _3DS_CHUNK_EDIT ((short) 0x3d3d)
-#define _3DS_CHUNK_MESH_VERSION ((short) 0x3d3e)
-
-#define _3DS_CHUNK_NAMED_OBJECT ((short) 0x4000)
-#define _3DS_CHUNK_NAMED_TRI_OBJECT ((short) 0x4100)
-#define _3DS_CHUNK_POINT_ARRAY ((short) 0x4110)
-#define _3DS_CHUNK_POINT_FLAG_ARRAY ((short) 0x4111)
-#define _3DS_CHUNK_FACE_ARRAY ((short) 0x4120)
-#define _3DS_CHUNK_MSH_MAT_GROUP ((short) 0x4130)
-#define _3DS_CHUNK_TEX_VERTS ((short) 0x4140)
-#define _3DS_CHUNK_SMOOTH_GROUP ((short) 0x4150)
-#define _3DS_CHUNK_MESH_MATRIX ((short) 0x4160)
-#define _3DS_CHUNK_MAGIC ((short) 0x4d4d)
-
-#define _3DS_CHUNK_MAT_NAME ((short) 0xa000)
-#define _3DS_CHUNK_TEXMAP ((short) 0xa200)
-#define _3DS_CHUNK_SPECMAP ((short) 0xa204)
-#define _3DS_CHUNK_OPACMAP ((short) 0xa210)
-#define _3DS_CHUNK_REFLMAP ((short) 0xa220)
-#define _3DS_CHUNK_BUMPMAP ((short) 0xa230)
-#define _3DS_CHUNK_MAT_MAPNAME ((short) 0xa300)
-#define _3DS_CHUNK_MAT_LIST ((short) 0xafff)
-
-#define _3DS_CHUNK_KEYFRAME_DATA ((short) 0xb000)
+#define _3DS_CHUNK_NULL 0x0000
+#define _3DS_CHUNK_UNKNOWN0 0x0001
+#define _3DS_CHUNK_M3D_VERSION 0x0002
+#define _3DS_CHUNK_M3D_KFVERSION 0x0005
+#define _3DS_CHUNK_COLOR_F 0x0010
+#define _3DS_CHUNK_COLOR_24 0x0011
+#define _3DS_CHUNK_LIN_COLOR_24 0x0012
+#define _3DS_CHUNK_LIN_COLOR_F 0x0013
+#define _3DS_CHUNK_INT_PERCENTAGE 0x0030
+#define _3DS_CHUNK_FLOAT_PERCENT 0x0031
+#define _3DS_CHUNK_MASTER_SCALE 0x0100
+#define _3DS_CHUNK_CHUNK_TYPE 0x0995
+#define _3DS_CHUNK_CHUNK_UNIQUE 0x0996
+#define _3DS_CHUNK_NOT_CHUNK 0x0997
+#define _3DS_CHUNK_CONTAINER 0x0998
+#define _3DS_CHUNK_IS_CHUNK 0x0999
+#define _3DS_CHUNK_C_SXP_SELFI_MASKDATA 0x0c3c
+
+#define _3DS_CHUNK_BITMAP 0x1100
+#define _3DS_CHUNK_USE_BITMAP 0x1101
+#define _3DS_CHUNK_SOLID_BGND 0x1200
+#define _3DS_CHUNK_USE_SOLID_BGND 0x1201
+
+#define _3DS_CHUNK_EDIT 0x3d3d
+#define _3DS_CHUNK_MESH_VERSION 0x3d3e
+
+#define _3DS_CHUNK_NAMED_OBJECT 0x4000
+#define _3DS_CHUNK_NAMED_TRI_OBJECT 0x4100
+#define _3DS_CHUNK_POINT_ARRAY 0x4110
+#define _3DS_CHUNK_POINT_FLAG_ARRAY 0x4111
+#define _3DS_CHUNK_FACE_ARRAY 0x4120
+#define _3DS_CHUNK_MSH_MAT_GROUP 0x4130
+#define _3DS_CHUNK_TEX_VERTS 0x4140
+#define _3DS_CHUNK_SMOOTH_GROUP 0x4150
+#define _3DS_CHUNK_MESH_MATRIX 0x4160
+#define _3DS_CHUNK_MAGIC 0x4d4d
+
+#define _3DS_CHUNK_MAT_NAME 0xa000
+#define _3DS_CHUNK_TEXMAP 0xa200
+#define _3DS_CHUNK_SPECMAP 0xa204
+#define _3DS_CHUNK_OPACMAP 0xa210
+#define _3DS_CHUNK_REFLMAP 0xa220
+#define _3DS_CHUNK_BUMPMAP 0xa230
+#define _3DS_CHUNK_MAT_MAPNAME 0xa300
+#define _3DS_CHUNK_MAT_LIST 0xafff
+
+#define _3DS_CHUNK_KEYFRAME_DATA 0xb000
void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose );
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
}
else{
Error( "TRI files no longer supported" );
+ return NULL;
}
// TRI_LoadPolysets( file, &psets, numpolysets );
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
brush_t *bb;
size_t c;
-
/* allocate and clear */
if ( numSides <= 0 ) {
Error( "AllocBrush called with numsides = %d", numSides );
}
}
+
+
/*
==================
SnapWeldVectorAccu
}
}
+
+
/*
FixWinding() - ydnar
removes degenerate edges from a winding
if ( !w ) {
continue;
}
+ /* strict, in parallel case we get the face back because it also is the midwinding */
ClipWindingEpsilonStrict( w, plane->normal, plane->dist,
- 0 /*PLANESIDE_EPSILON*/, &cw[0], &cw[1] ); /* strict, in parallel case we get the face back because it also is the midwinding */
+ 0 /*PLANESIDE_EPSILON*/, &cw[0], &cw[1] );
for ( j = 0 ; j < 2 ; j++ )
{
if ( !cw[j] ) {
------------------------------------------------------------------------------- */
+
/*
ProcessAdvertisements()
copies advertisement info into the BSP structures
colorsRGB = qfalse;
Sys_Printf( "Colors are linear\n" );
}
- else if ( !strcmp( argv[ i ], "-altsplit" ) ) {
+ else if ( !strcmp( argv[ i ], "-altsplit" ) )
+ {
Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" );
bspAlternateSplitWeights = qtrue;
}
- else if ( !strcmp( argv[ i ], "-deep" ) ) {
+ else if ( !strcmp( argv[ i ], "-deep" ) )
+ {
Sys_Printf( "Deep BSP tree generation enabled\n" );
deepBSP = qtrue;
}
numBSPEntities = numEntities;
}
+
+
/*
* must be called before UnparseEntities
*/
SetKeyValue( &entities[0], "_q3map2_version", Q3MAP_VERSION );
}
+
+
/*
UnparseEntities()
generates the dentdata string from all the entities.
ep->value = copystring( value );
}
+
+
/*
KeyExists()
returns true if entity has this key
return qfalse;
}
+
+
/*
ValueForKey()
gets the value for an entity key
*/
static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum, int *compileFlags ){
- face_t *split;
- face_t *check;
- face_t *bestSplit;
+ face_t *split;
+ face_t *check;
+ face_t *bestSplit;
int splits, facing, front, back;
int side;
- plane_t *plane;
+ plane_t *plane;
int value, bestValue;
int i;
vec3_t normal;
int planenum;
float sizeBias;
- //int frontC,backC,splitsC,facingC;
-
-
/* ydnar: set some defaults */
*splitPlaneNum = -1; /* leaf */
*compileFlags = 0;
if ( value > bestValue ) {
bestValue = value;
bestSplit = split;
- //frontC=front;
- //backC=back;
- //splitsC=splits;
- //facingC=facing;
}
}
return;
}
- //Sys_FPrintf (SYS_VRB, "F: %d B:%d S:%d FA:%ds\n",frontC,backC,splitsC,facingC );
-
/* set best split data */
*splitPlaneNum = bestSplit->planenum;
*compileFlags = bestSplit->compileFlags;
-#if 0
- if ( bestSplit->compileFlags & C_DETAIL ) {
- for ( split = list; split; split = split->next )
- if ( !( split->compileFlags & C_DETAIL ) ) {
- Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (1)\n" );
- }
- }
- if ( ( node->compileFlags & C_DETAIL ) && !( bestSplit->compileFlags & C_DETAIL ) ) {
- Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (2)\n" );
- }
-#endif
-
if ( *splitPlaneNum > -1 ) {
mapplanes[ *splitPlaneNum ].counter++;
}
winding_t *frontWinding, *backWinding;
int i;
int splitPlaneNum, compileFlags;
-#if 0
- qboolean isstruct = qfalse;
-#endif
/* count faces left */
continue;
}
-#if 0
- if ( !( split->compileFlags & C_DETAIL ) ) {
- isstruct = 1;
- }
-#endif
-
/* determine which side the face falls on */
side = WindingOnPlaneSide( split->w, plane->normal, plane->dist );
/* switch on side */
if ( side == SIDE_CROSS ) {
+ /* strict; if no winding is left, we have a "virtually identical" plane and don't want to split by it */
ClipWindingEpsilonStrict( split->w, plane->normal, plane->dist, CLIP_EPSILON * 2,
- &frontWinding, &backWinding ); /* strict; if no winding is left, we have a "virtually identical" plane and don't want to split by it */
+ &frontWinding, &backWinding );
if ( frontWinding ) {
newFace = AllocBspFace();
newFace->w = frontWinding;
}
}
-#if 0
- if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
- Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf1\n", node->has_structural_children );
- }
-#endif
-
for ( i = 0 ; i < 2 ; i++ ) {
BuildFaceTree_r( node->children[i], childLists[i] );
node->has_structural_children |= node->children[i]->has_structural_children;
}
-
-#if 0
- if ( ( node->compileFlags & C_DETAIL ) && !( node->children[0]->compileFlags & C_DETAIL ) && node->children[0]->planenum != PLANENUM_LEAF ) {
- Sys_FPrintf( SYS_ERR, "I am detail, my child is structural\n", node->has_structural_children );
- }
- if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
- Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf2\n", node->has_structural_children );
- }
-#endif
}
NULL, /* unix home sub-dir */
NULL, /* magic path word */
NULL, /* shader directory */
- 0, /* max lightmapped surface verts */
- 0, /* max surface verts */
- 0, /* max surface indexes */
+ 0, /* max lightmapped surface verts */
+ 0, /* max surface verts */
+ 0, /* max surface indexes */
qfalse, /* flares */
NULL, /* default flare shader */
qfalse, /* wolf lighting model? */
- 0, /* lightmap width/height */
- 0, /* lightmap gamma */
+ 0, /* lightmap width/height */
+ 0, /* lightmap gamma */
qfalse, /* lightmap sRGB */
qfalse, /* texture sRGB */
qfalse, /* color sRGB */
- 0, /* lightmap exposure */
- 0, /* lightmap compensate */
- 0, /* lightgrid scale */
- 0, /* lightgrid ambient scale */
+ 0, /* lightmap exposure */
+ 0, /* lightmap compensate */
+ 0, /* lightgrid scale */
+ 0, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qfalse, /* disable shader lightstyles hack */
qfalse, /* keep light entities on bsp */
- 0, /* default patchMeta subdivisions tolerance */
+ 0, /* default patchMeta subdivisions tolerance */
qfalse, /* patch casting enabled */
qfalse, /* compile deluxemaps */
- 0, /* deluxemaps default mode */
- 0, /* minimap size */
- 0, /* minimap sharpener */
- 0, /* minimap border */
+ 0, /* deluxemaps default mode */
+ 0, /* minimap size */
+ 0, /* minimap sharpener */
+ 0, /* minimap border */
qfalse, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
NULL, /* minimap name format */
NULL, /* bsp file prefix */
- 0, /* bsp file version */
+ 0, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
NULL, /* bsp load function */
NULL, /* bsp write function */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
- 1.0f, /* lightmap gamma */
+ 2.2f, /* lightmap gamma */
qtrue, /* lightmap sRGB */
qfalse, /* texture sRGB (yes, this is incorrect, but we better match ET:UT) */
qfalse, /* color sRGB */
------------------------------------------------------------------------------- */
+ /* -------------------------------------------------------------------------------
+
+ Additional surface flags for Quake Live
+
+ ------------------------------------------------------------------------------- */
+
+#define Q_SURF_SNOWSTEPS 0x80000 // snow footsteps
+#define Q_SURF_WOODSTEPS 0x100000 // wood footsteps
+#define Q_SURF_DMGTHROUGH 0x200000 // Missile dmg through surface(?)
+ // (This is not in use atm, will
+ // probably be re-purposed some day.)
+
/* -------------------------------------------------------------------------------
{
"quakelive", /* -game x */
- "baseq3", /* default base game data dir (FIXME what does quake live really use?) */
- ".q3a", /* unix home sub-dir (FIXME what does quake live really use?) */
- "quake", /* magic path word (FIXME where does quake live install to?) */
+ "baseq3", /* default base game data dir */
+ ".quakelive/quakelive/home", /* unix home sub-dir */
+ "quake", /* magic path word */
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
+ { "snowsteps", 0, 0, Q_SURF_SNOWSTEPS, 0, 0, 0 },
+ { "woodsteps", 0, 0, Q_SURF_WOODSTEPS, 0, 0, 0 },
+ { "dmgthrough", 0, 0, Q_SURF_DMGTHROUGH, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
------------------------------------------------------------------------------- */
/* Derived from Tremulous support by LinuxManMikeC */
+/* Updated to Unvanquished support by Neumond */
/* marker */
{ "clusterportal", W_CONT_CLUSTERPORTAL, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", W_CONT_DONOTENTER, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "nonotenterlarge",W_CONT_DONOTENTER_LARGE, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
+ { "donotenterlarge",W_CONT_DONOTENTER_LARGE, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", W_CONT_FOG, W_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, W_SURF_SKY, 0, C_SKY, 0 },
{ "clusterportal", W_CONT_CLUSTERPORTAL, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", W_CONT_DONOTENTER, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "nonotenterlarge",W_CONT_DONOTENTER_LARGE, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
+ { "donotenterlarge",W_CONT_DONOTENTER_LARGE, W_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", W_CONT_FOG, W_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, W_SURF_SKY, 0, C_SKY, 0 },
{"-flat", "Enable flat shading (good for combining with -celshader)"},
{"-fulldetail", "Treat detail brushes as structural ones"},
{"-leaktest", "Abort if a leak was found"},
- {"-linefile <filename.lin>", "Line file to write"},
+ {"-linfile <filename.lin>", "Line file to write"},
{"-meta", "Combine adjacent triangles of the same texture to surfaces (ALWAYS USE THIS)"},
{"-minsamplesize <N>", "Sets minimum lightmap resolution in luxels/qu"},
{"-mi <N>", "Sets the maximum number of indexes per surface"},
struct HelpOption vis[] = {
{"-vis <filename.map>", "Switch that enters this stage"},
{"-fast", "Very fast and crude vis calculation"},
+ {"-hint", "Merge all but hint portals"},
{"-mergeportals", "The less crude half of `-merge`, makes vis sometimes much faster but doesn't hurt fps usually"},
{"-merge", "Faster but still okay vis calculation"},
{"-nopassage", "Just use PortalFlow vis (usually less fps)"},
{"-gridscale <F>", "Scaling factor for the light grid only"},
{"-keeplights", "Keep light entities in the BSP file after compile"},
{"-lightmapdir <directory>", "Directory to store external lightmaps (default: same as map name without extension)"},
+ {"-lightmapsearchblocksize <N>", "Restrict lightmap search to block size <N>"},
+ {"-lightmapsearchpower <N>", "Optimize for lightmap merge power <N>"},
{"-lightmapsize <N>", "Size of lightmaps to generate (must be a power of two)"},
{"-lightsubdiv <N>", "Size of light emitting shader subdivision"},
{"-lomem", "Low memory but slower lighting mode"},
png_struct *png;
png_info *info, *end;
pngBuffer_t pb;
- //pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png );
int bitDepth, colorType;
png_uint_32 w, h, i;
byte **rowPointers;
pb.size = size;
pb.offset = 0;
png_set_read_fn( png, &pb, PNGReadData );
- //png->io_ptr = &pb; /* hack! */
/* set error longjmp */
if ( setjmp( png_jmpbuf(png) ) ) {
/* return to sender */
return 1;
}
- else{
+ else {
Error( "Light of undefined type!" );
}
if ( VectorLength( color ) == 0.0f ) {
VectorSet( color, 1.0, 1.0, 1.0 );
}
+
if ( colorsRGB ) {
color[0] = Image_LinearFloatFromsRGBFloat( color[0] );
color[1] = Image_LinearFloatFromsRGBFloat( color[1] );
}
i++;
}
+
else if ( !strcmp( argv[ i ], "-deluxe" ) || !strcmp( argv[ i ], "-deluxemap" ) ) {
deluxemap = qtrue;
Sys_Printf( "Generating deluxemaps for average light direction\n" );
light->falloffTolerance = falloffTolerance;
/* bouncing light? */
- if ( !bouncing ) {
+ if ( bouncing == qfalse ) {
/* This is weird. This actually handles surfacelight and not
* bounces. */
#define GROW_TRACE_NODES 16384 //% 16384
#define GROW_NODE_ITEMS 16 //% 256
-#define MAX_TW_VERTS 24 // vortex: increased from 12 to 24 for ability co compile some insane maps with large curve count
+// vortex: increased from 12 to 24 for ability co compile some insane maps with large curve count
+#define MAX_TW_VERTS 24
#define TRACE_ON_EPSILON 0.1f
memset( &traceNodes[ numTraceNodes ], 0, sizeof( traceNode_t ) );
traceNodes[ numTraceNodes ].type = TRACE_LEAF;
ClearBounds( traceNodes[ numTraceNodes ].mins, traceNodes[ numTraceNodes ].maxs );
-
- /* Sys_Printf("alloc node %d\n", numTraceNodes); */
-
numTraceNodes++;
/* return the count */
}
}
- /* Sys_Printf("node %d children: %d %d\n", nodeNum, traceNodes[ nodeNum ].children[0], traceNodes[ nodeNum ].children[1]); */
-
/* return node number */
return nodeNum;
}
origin2 = SUPER_ORIGIN( x, y );
//% normal2 = SUPER_NORMAL( x, y );
}
- else{
+ else {
Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap S vector\n" );
}
origin2 = SUPER_ORIGIN( x, y );
//% normal2 = SUPER_NORMAL( x, y );
}
- else{
+ else {
Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap T vector\n" );
}
VectorSubtract( origin2, origin, originVecs[ 1 ] );
- //% VectorSubtract( normal2, normal, normalVecs[ 1 ] );
/* calculate new origin */
- //% VectorMA( origin, bx, originVecs[ 0 ], sampleOrigin );
- //% VectorMA( sampleOrigin, by, originVecs[ 1 ], sampleOrigin );
for ( i = 0; i < 3; i++ )
sampleOrigin[ i ] = sampleOrigin[ i ] + ( bx * originVecs[ 0 ][ i ] ) + ( by * originVecs[ 1 ][ i ] );
}
/* calculate new normal */
- //% VectorMA( normal, bx, normalVecs[ 0 ], sampleNormal );
- //% VectorMA( sampleNormal, by, normalVecs[ 1 ], sampleNormal );
- //% if( VectorNormalize( sampleNormal, sampleNormal ) <= 0.0f )
- //% return qfalse;
normal = SUPER_NORMAL( x, y );
VectorCopy( normal, sampleNormal );
normal = SUPER_NORMAL( x, y );
flag = SUPER_FLAG( x, y );
-#if 0
- ////////// 27's temp hack for testing edge clipping ////
- if ( origin[0] == 0 && origin[1] == 0 && origin[2] == 0 ) {
- lightLuxel[ 1 ] = 255;
- lightLuxel[ 3 ] = 1.0f;
- totalLighted++;
- }
- else
-#endif
- {
- /* set contribution count */
- lightLuxel[ 3 ] = 1.0f;
+ /* set contribution count */
+ lightLuxel[ 3 ] = 1.0f;
- /* setup trace */
- trace.cluster = *cluster;
- VectorCopy( origin, trace.origin );
- VectorCopy( normal, trace.normal );
+ /* setup trace */
+ trace.cluster = *cluster;
+ VectorCopy( origin, trace.origin );
+ VectorCopy( normal, trace.normal );
- /* get light for this sample */
- LightContributionToSample( &trace );
- VectorCopy( trace.color, lightLuxel );
+ /* get light for this sample */
+ LightContributionToSample( &trace );
+ VectorCopy( trace.color, lightLuxel );
- /* add the contribution to the deluxemap */
- if ( deluxemap ) {
- VectorCopy( trace.directionContribution, lightDeluxel );
- }
+ /* add the contribution to the deluxemap */
+ if ( deluxemap ) {
+ VectorCopy( trace.directionContribution, lightDeluxel );
+ }
- /* check for evilness */
- if ( trace.forceSubsampling > 1.0f && ( lightSamples > 1 || lightRandomSamples ) && luxelFilterRadius == 0 ) {
- totalLighted++;
- *flag |= FLAG_FORCE_SUBSAMPLING; /* force */
- }
- /* add to count */
- else if ( trace.color[ 0 ] || trace.color[ 1 ] || trace.color[ 2 ] ) {
+ /* check for evilness */
+ if ( trace.forceSubsampling > 1.0f && ( lightSamples > 1 || lightRandomSamples ) && luxelFilterRadius == 0 ) {
totalLighted++;
- }
+ *flag |= FLAG_FORCE_SUBSAMPLING; /* force */
+ }
+ /* add to count */
+ else if ( trace.color[ 0 ] || trace.color[ 1 ] || trace.color[ 2 ] ) {
+ totalLighted++;
}
}
}
{
/* get cluster */
cluster = SUPER_CLUSTER( x, y );
- //% if( *cluster < 0 ) // TODO why not do this check? These pixels should be zero anyway
- //% continue;
/* get particulars */
luxel = SUPER_LUXEL( lightmapNum, x, y );
}
}
}
-
-
-#if 0
- // audit pass
- for ( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
- {
- /* early out */
- if ( lm->superLuxels[ lightmapNum ] == NULL ) {
- continue;
- }
- for ( y = 0; y < lm->sh; y++ )
- for ( x = 0; x < lm->sw; x++ )
- {
- /* get cluster */
- cluster = SUPER_CLUSTER( x, y );
- luxel = SUPER_LUXEL( lightmapNum, x, y );
- deluxel = SUPER_DELUXEL( x, y );
- if ( !luxel || !deluxel || !cluster ) {
- Sys_FPrintf( SYS_VRB, "WARNING: I got NULL'd.\n" );
- continue;
- }
- else if ( *cluster < 0 ) {
- // unmapped pixel
- // should have neither deluxemap nor lightmap
- if ( deluxel[3] ) {
- Sys_FPrintf( SYS_VRB, "WARNING: I have written deluxe to an unmapped luxel. Sorry.\n" );
- }
- }
- else
- {
- // mapped pixel
- // should have both deluxemap and lightmap
- if ( deluxel[3] ) {
- Sys_FPrintf( SYS_VRB, "WARNING: I forgot to write deluxe to a mapped luxel. Sorry.\n" );
- }
- }
- }
- }
-#endif
}
else{
light->flags &= ~LIGHT_FAST_TEMP;
}
- if ( fastpoint && ( light->flags != EMIT_AREA ) ) {
+ if ( fastpoint && ( light->type != EMIT_AREA ) ) {
light->flags |= LIGHT_FAST_TEMP;
}
if ( light->si && light->si->noFast ) {
return -1;
}
-
/* then lightmap sample size */
if ( aInfo->sampleSize < bInfo->sampleSize ) {
return 1;
return 0;
}
+
+
void FillOutLightmap( outLightmap_t *olm ){
int x, y;
int ofs;
}
}
+
+
/*
StoreSurfaceLightmaps()
stores the surface lightmaps into the bsp as byte rgb triplets
char dirname[ 1024 ], filename[ 1024 ];
shaderInfo_t *csi;
char lightmapName[ 128 ];
- const char *rgbGenValues[ 256 ];
- const char *alphaGenValues[ 256 ];
+ const char *rgbGenValues[ 256 ];
+ const char *alphaGenValues[ 256 ];
/* note it */
----------------------------------------------------------------- */
/* note it */
- Sys_Printf( "Subsampling..." );
+ Sys_FPrintf( SYS_VRB, "Subsampling..." );
/* walk the list of raw lightmaps */
numUsed = 0;
if ( noCollapse == qfalse && deluxemap == qfalse ) {
/* note it */
- Sys_Printf( "collapsing..." );
+ Sys_FPrintf( SYS_VRB, "collapsing..." );
/* set all twin refs to null */
for ( i = 0; i < numRawLightmaps; i++ )
----------------------------------------------------------------- */
/* note it */
- Sys_Printf( "sorting..." );
+ Sys_FPrintf( SYS_VRB, "sorting..." );
/* allocate a new sorted list */
if ( sortLightmaps == NULL ) {
----------------------------------------------------------------- */
/* note it */
- Sys_Printf( "allocating..." );
+ Sys_FPrintf( SYS_VRB, "allocating..." );
/* kill all existing output lightmaps */
if ( outLightmaps != NULL ) {
----------------------------------------------------------------- */
/* note it */
- Sys_Printf( "storing..." );
+ Sys_FPrintf( SYS_VRB, "storing..." );
/* count the bsp lightmaps and allocate space */
if ( bspLightBytes != NULL ) {
}
if ( numExtLightmaps > 0 ) {
- Sys_Printf( "\n" );
+ Sys_FPrintf( SYS_VRB, "\n" );
}
/* delete unused external lightmaps */
----------------------------------------------------------------- */
/* note it */
- Sys_Printf( "projecting..." );
+ Sys_FPrintf( SYS_VRB, "projecting..." );
/* walk the list of surfaces */
for ( i = 0; i < numBSPDrawSurfaces; i++ )
}
/* finish */
- Sys_Printf( "done.\n" );
+ Sys_FPrintf( SYS_VRB, "done.\n" );
/* calc num stored */
numStored = numBSPLightBytes / 3;
#include "q3map2.h"
#include <glib.h>
-
/*
Random()
returns a pseudorandom number between 0 and 1
return Q_strncpyz( dst + n, src, MIN( slen, dlen - n ) );
}
+
/*
ExitQ3Map()
cleanup routine
}
}
+
/*
main()
q3map mojo...
}
}
-
/* walk the entity list */
for ( num = 1; num < numEntities; num++ )
{
*/
void LokiInitPaths( char *argv0 ){
- char *home;
+ char *home;
if ( !homePath ) {
/* get home dir */
/* this is kinda crap, but hey */
strcpy( installPath, "../" );
#else
+
char temp[ MAX_OS_PATH ];
- char *path;
- char *last;
+ char *path;
+ char *last;
qboolean found;
path++;
}
-
/* concatenate */
if ( last > ( path + 1 ) ) {
// +1 hack: Q_strncat calls Q_strncpyz that expects a len including '\0'
//
// cut the portal into two portals, one on each side of the cut plane
//
+ /* not strict, we want to always keep one of them even if coplanar */
ClipWindingEpsilon( p->winding, plane->normal, plane->dist,
- SPLIT_WINDING_EPSILON, &frontwinding, &backwinding ); /* not strict, we want to always keep one of them even if coplanar */
+ SPLIT_WINDING_EPSILON, &frontwinding, &backwinding );
if ( frontwinding && WindingIsTiny( frontwinding ) ) {
if ( !f->tinyportals ) {
#define Q3MAP_MOTD "Your map saw the pretty lights from q3map2's BFG"
-
-
/* -------------------------------------------------------------------------------
dependencies
#define HINT_PRIORITY 1000 /* ydnar: force hint splits first and antiportal/areaportal splits last */
#define ANTIPORTAL_PRIORITY -1000
#define AREAPORTAL_PRIORITY -1000
-#define DETAIL_PRIORITY -3000
+#define DETAIL_PRIORITY -3000
#define PSIDE_FRONT 1
#define PSIDE_BACK 2
#define RAD_LUXEL_SIZE 3
#define SUPER_LUXEL_SIZE 4
#define SUPER_FLAG_SIZE 4
-#define FLAG_FORCE_SUBSAMPLING 1
+#define FLAG_FORCE_SUBSAMPLING 1
#define FLAG_ALREADY_SUBSAMPLED 2
#define SUPER_ORIGIN_SIZE 3
#define SUPER_NORMAL_SIZE 4
struct face_s *next;
int planenum;
int priority;
- //qboolean checked;
+ //qboolean checked;
int compileFlags;
winding_t *w;
}
shaderInfo_t *shaderInfo;
shaderInfo_t *celShader; /* :) */
+ /* jal : entity based _lightmapsamplesize */
+ int lightmapSampleSize;
/* ydnar: gs mods */
- int lightmapSampleSize; /* jal : entity based _lightmapsamplesize */
float lightmapScale;
vec3_t eMins, eMaxs;
indexMap_t *im;
float *bspLuxels[ MAX_LIGHTMAPS ];
float *radLuxels[ MAX_LIGHTMAPS ];
float *superLuxels[ MAX_LIGHTMAPS ];
- unsigned char *superFlags;
+ unsigned char *superFlags;
float *superOrigins;
float *superNormals;
int *superClusters;
game_t *GetGame( char *arg );
void InitPaths( int *argc, char **argv );
+
/* fixaas.c */
int FixAASMain( int argc, char **argv );
+
/* bsp.c */
int BSPMain( int argc, char **argv );
+
/* bsp_analyze.c */
int AnalyzeBSPMain( int argc, char **argv );
+
/* bsp_info.c */
int BSPInfoMain( int count, char **fileNames );
/* convert_bsp.c */
int ConvertBSPMain( int argc, char **argv );
+
/* convert_map.c */
int ConvertBSPToMap( char *bspName );
int ConvertBSPToMap_BP( char *bspName );
,
#include "game_tremulous.h" /*LinuxManMikeC: must be after game_quake3.h, depends on #define's set in it */
,
- #include "game_unvanquished.h"
+ #include "game_unvanquished.h" /* must be after game_tremulous.h as they share defines! */
,
#include "game_tenebrae.h"
,
Q_EXTERN qboolean noHint Q_ASSIGN( qfalse ); /* ydnar */
Q_EXTERN qboolean renameModelShaders Q_ASSIGN( qfalse ); /* ydnar */
Q_EXTERN qboolean skyFixHack Q_ASSIGN( qfalse ); /* ydnar */
-Q_EXTERN qboolean bspAlternateSplitWeights Q_ASSIGN( qfalse ); /* 27 */
-Q_EXTERN qboolean deepBSP Q_ASSIGN( qfalse ); /* div0 */
+Q_EXTERN qboolean bspAlternateSplitWeights Q_ASSIGN( qfalse ); /* 27 */
+Q_EXTERN qboolean deepBSP Q_ASSIGN( qfalse ); /* div0 */
Q_EXTERN qboolean maxAreaFaceSurface Q_ASSIGN( qfalse ); /* divVerent */
Q_EXTERN int patchSubdivisions Q_ASSIGN( 8 ); /* ydnar: -patchmeta subdivisions */
Q_EXTERN bspBrushSide_t* bspBrushSides Q_ASSIGN( NULL );
Q_EXTERN int numBSPLightBytes Q_ASSIGN( 0 );
-Q_EXTERN byte *bspLightBytes Q_ASSIGN( NULL );
+Q_EXTERN byte *bspLightBytes Q_ASSIGN( NULL );
//% Q_EXTERN int numBSPGridPoints Q_ASSIGN( 0 );
//% Q_EXTERN byte *bspGridPoints Q_ASSIGN( NULL );
Q_EXTERN byte bspVisBytes[ MAX_MAP_VISIBILITY ];
Q_EXTERN int numBSPDrawVerts Q_ASSIGN( 0 );
-Q_EXTERN bspDrawVert_t *bspDrawVerts Q_ASSIGN( NULL );
+Q_EXTERN bspDrawVert_t *bspDrawVerts Q_ASSIGN( NULL );
Q_EXTERN int numBSPDrawIndexes Q_ASSIGN( 0 );
Q_EXTERN int allocatedBSPDrawIndexes Q_ASSIGN( 0 );
-Q_EXTERN int *bspDrawIndexes Q_ASSIGN( NULL );
+Q_EXTERN int *bspDrawIndexes Q_ASSIGN( NULL );
Q_EXTERN int numBSPDrawSurfaces Q_ASSIGN( 0 );
Q_EXTERN bspDrawSurface_t *bspDrawSurfaces Q_ASSIGN( NULL );
return AddReferenceToLeaf( ds, node );
}
+
+
/*
FilterPointConvexHullIntoTree_r() - ydnar
filters the convex hull of multiple points from a surface into the tree
}
+
/*
FilterWindingIntoTree_r() - ydnar
filters a winding from a drawsurface into the tree
if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) {
return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
}
- #else
+ #else
(void) plane2;
/* div0: this is the cholera (doesn't hit enough) */
numSurfacesByType[ ds->type ]++;
}
+
+
/*
EmitPatchSurface()
emits a bsp patch drawsurface
numSurfacesByType[ ds->type ]++;
}
+
+
/*
OptimizeTriangleSurface() - ydnar
optimizes the vertex/index data in a triangle surface
}
+
/*
MakeDebugPortalSurfs_r() - ydnar
generates drawsurfaces for passable portals in the bsp
}
/* parse the file */
- ParseFromMemory( (char *) buffer, size );
+ ParseFromMemory( (char*) buffer, size );
/* tokenize it */
while ( 1 )
if ( ds->numVerts == 0 || ds->type != SURFACE_PATCH || ( patchMeta == qfalse && !forcePatchMeta ) ) {
return;
}
+
/* make a mesh from the drawsurf */
src.width = ds->patchWidth;
src.height = ds->patchHeight;
ClassifySurfaces( 1, ds );
}
+
+
#define TINY_AREA 1.0f
#define MAXAREA_MAXTRIES 8
int MaxAreaIndexes( bspDrawVert_t *vert, int cnt, int *indexes ){
return -1;
}
+
+
/*
MaxAreaFaceSurface() - divVerent
creates a triangle list using max area indexes
}
+
/*
FanFaceSurface() - ydnar
creates a tri-fan from a brush face winding
}
+
/*
EmitMetaStatictics
vortex: prints meta statistics in general output
Sys_Printf( "%9d meta triangles\n", numMetaTriangles );
}
+
+
/*
MakeEntityMetaTriangles()
builds meta triangles from brush faces (tristrips and fans)
}
}
-
-
if ( metaMaxBBoxDistance >= 0 ) {
if ( ds->numIndexes > 0 ) {
VectorCopy( ds->mins, mins );
vec3_t origin;
vec3_t dir;
- edgePoint_t *chain; // unused element of doubly linked list
+ // unused element of doubly linked list
+ edgePoint_t *chain;
} edgeLine_t;
typedef struct {
int numOriginalEdges;
int allocatedOriginalEdges = 0;
-
-edgeLine_t *edgeLines = NULL;
+edgeLine_t *edgeLines = NULL;
int numEdgeLines;
int allocatedEdgeLines = 0;
p = e->chain->prev;
}
- for ( ; p != e->chain ; ) {
+ for ( ; p != e->chain ; ) {
if ( start < end ) {
if ( p->intercept > end - ON_EPSILON ) {
break;
Merges the portal visibility for a leaf
===============
*/
+
static int clustersizehistogram[MAX_MAP_LEAFS] = {0};
+
void ClusterMerge( int leafnum ){
leaf_t *leaf;
byte portalvector[MAX_PORTALS / 8];
}
if ( i != argc - 1 ) {
- Error( "usage: vis [-threads #] [-level 0-4] [-fast] [-v] BSPFilePath" );
+ Error( "usage: vis [-threads #] [-fast] [-v] BSPFilePath" );
}
sprintf( portalFilePath, "%s%s", inbase, ExpandArg( argv[ i ] ) );
StripExtension( portalFilePath );
strcat( portalFilePath, ".prt" );
- Sys_Printf( "Loading %s\n", portalFilePath );
- LoadPortals( portalFilePath );
}
+ Sys_Printf( "Loading %s\n", portalFilePath );
+ LoadPortals( portalFilePath );
/* ydnar: exit if no portals, hence no vis */
if ( numportals == 0 ) {
}
}
- // i == numBSPShaders
-
/* get shaderinfo */
si = ShaderInfoForShader( shader );