Initial (unmodified) import of Lee Salzman's iqm exporter.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5037 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-01-07 02:13:20 +00:00
parent 68e535c5b2
commit cd75caeb27
6 changed files with 5026 additions and 0 deletions

7
iqm/LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright (c) 2010-2016 Lee Salzman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

19
iqm/Makefile Normal file
View File

@ -0,0 +1,19 @@
CXXFLAGS= -O3 -fomit-frame-pointer
override CXXFLAGS+= -Wall -fsigned-char
IQM_OBJS= \
iqm.o
UPGRADE_OBJS= \
upgrade.o
default: all
all: iqm upgrade
clean:
-$(RM) $(IQM_OBJS) $(UPGRADE_OBJS) iqm upgrade
iqm: $(IQM_OBJS)
$(CXX) $(CXXFLAGS) -o iqm $(IQM_OBJS)
upgrade: $(UPGRADE_OBJS)
$(CXX) $(CXXFLAGS) -o upgrade $(UPGRADE_OBJS)

26
iqm/Makefile.mingw Normal file
View File

@ -0,0 +1,26 @@
CXXFLAGS= -O3 -fomit-frame-pointer
override CXXFLAGS+= -Wall -fsigned-char
PLATFORM= $(shell uname -s)
ifeq (,$(findstring MINGW,$(PLATFORM)))
CXX=i686-w64-mingw32-g++
endif
LIBS= -mwindows -static -static-libgcc -static-libstdc++
IQM_OBJS= \
iqm.o
UPGRADE_OBJS= \
upgrade.o
default: all
all: iqm.exe upgrade.exe
clean:
-$(RM) $(IQM_OBJS) $(UPGRADE_OBJS) iqm.exe upgrade.exe
iqm.exe: $(IQM_OBJS)
$(CXX) $(CXXFLAGS) -o iqm.exe $(IQM_OBJS) $(LIBS)
upgrade.exe: $(UPGRADE_OBJS)
$(CXX) $(CXXFLAGS) -o upgrade.exe $(UPGRADE_OBJS) $(LIBS)

3760
iqm/iqm.cpp Normal file

File diff suppressed because it is too large Load Diff

134
iqm/iqm.h Normal file
View File

@ -0,0 +1,134 @@
#ifndef __IQM_H__
#define __IQM_H__
#define IQM_MAGIC "INTERQUAKEMODEL"
#define IQM_VERSION 2
struct iqmheader
{
char magic[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_adjacency;
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;
};
struct iqmmesh
{
unsigned int name;
unsigned int material;
unsigned int first_vertex, num_vertexes;
unsigned int first_triangle, num_triangles;
};
enum
{
IQM_POSITION = 0,
IQM_TEXCOORD = 1,
IQM_NORMAL = 2,
IQM_TANGENT = 3,
IQM_BLENDINDEXES = 4,
IQM_BLENDWEIGHTS = 5,
IQM_COLOR = 6,
IQM_CUSTOM = 0x10
};
enum
{
IQM_BYTE = 0,
IQM_UBYTE = 1,
IQM_SHORT = 2,
IQM_USHORT = 3,
IQM_INT = 4,
IQM_UINT = 5,
IQM_HALF = 6,
IQM_FLOAT = 7,
IQM_DOUBLE = 8
};
struct iqmtriangle
{
unsigned int vertex[3];
};
struct iqmadjacency
{
unsigned int triangle[3];
};
struct iqmjointv1
{
unsigned int name;
int parent;
float translate[3], rotate[3], scale[3];
};
struct iqmjoint
{
unsigned int name;
int parent;
float translate[3], rotate[4], scale[3];
};
struct iqmposev1
{
int parent;
unsigned int mask;
float channeloffset[9];
float channelscale[9];
};
struct iqmpose
{
int parent;
unsigned int mask;
float channeloffset[10];
float channelscale[10];
};
struct iqmanim
{
unsigned int name;
unsigned int first_frame, num_frames;
float framerate;
unsigned int flags;
};
enum
{
IQM_LOOP = 1<<0
};
struct iqmvertexarray
{
unsigned int type;
unsigned int flags;
unsigned int format;
unsigned int size;
unsigned int offset;
};
struct iqmbounds
{
float bbmin[3], bbmax[3];
float xyradius, radius;
};
struct iqmextension
{
unsigned int name;
unsigned int num_data, ofs_data;
unsigned int ofs_extensions; // pointer to next extension
};
#endif

1080
iqm/util.h Normal file

File diff suppressed because it is too large Load Diff