]> icculus.org git repositories - divverent/netradiant.git/blob - tools/quake2/qdata_heretic2/qdata.h
initial
[divverent/netradiant.git] / tools / quake2 / qdata_heretic2 / qdata.h
1 /*
2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 // qdata.h
23
24
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <math.h>
28 #include <string.h>
29 #include <sys/stat.h>
30
31 #include "cmdlib.h"
32 #include "inout.h"
33 #include "scriplib.h"
34 #include "mathlib.h"
35 #include "trilib.h"
36 #include "lbmlib.h"
37 #include "her2_threads.h"
38 #include "l3dslib.h"
39 #include "bspfile.h"
40
41 #ifndef _WIN32
42 #define stricmp strcasecmp
43 #define strcmpi strcasecmp
44 #endif
45
46
47 #define MODEL_AUTO      0
48 #define MODEL_MD2       1
49 #define MODEL_FM        2
50
51 // Model cover functions (to allow the forcing of a model type)
52 void MODELCMD_Modelname (int modeltype);
53 void MODELCMD_Cd (int modeltype);
54 void MODELCMD_Origin (int modeltype);
55 void MODELCMD_Jointed (int modeltype);
56 void MODELCMD_Cluster (int modeltype);
57 void MODELCMD_Base (int modeltype);
58 void MODELCMD_BaseST (int modeltype);
59 void MODELCMD_ScaleUp (int modeltype);
60 void MODELCMD_Frame (int modeltype);
61 void MODELCMD_Skin (int modeltype);
62 void MODELCMD_Skinsize (int modeltype);
63 void MODELCMD_Skeleton (int modeltype);
64 void MODELCMD_SkeletalFrame (int modeltype);
65 void MODELCMD_BeginGroup(int modeltype);
66 void MODELCMD_EndGroup(int modeltype);
67 void MODELCMD_Referenced(int modeltype);
68 void MODELCMD_NodeOrder(int modeltype);
69
70 void Cmd_Modelname (void);
71 void Cmd_Base (void);
72 void Cmd_Cd (void);
73 void Cmd_Origin (void);
74 void Cmd_ScaleUp (void);
75 void Cmd_Frame (void);
76 void Cmd_Skin (void);
77 void Cmd_Skinsize (void);
78 void FinishModel (void);
79 void Cmd_Cluster (void);
80
81 // Flexible Models
82 //void Cmd_FMModelname (void);
83 void Cmd_FMBase (qboolean GetST);
84 void Cmd_FMCd (void);
85 //void Cmd_FMOrigin (void);
86 void Cmd_FMCluster();
87 void Cmd_FMSkeleton();
88 //void Cmd_FMScaleUp (void);
89 void Cmd_FMFrame (void);
90 void Cmd_FMSkeletalFrame();
91 void Cmd_FMSkin (void);
92 //void Cmd_FMSkinsize (void);
93 void Cmd_FMBeginGroup(void);
94 void Cmd_FMEndGroup(void);
95 void Cmd_FMReferenced();
96 void Cmd_FMNodeOrder(void);
97 void FMFinishModel (void);
98 void GenSkin(char *ModelFile, char *OutputName, int Width, int Height);
99 void NewGen (char *ModelFile, char *OutputName, int width, int height);
100
101
102 void Cmd_Inverse16Table( void );
103
104 void Cmd_SpriteName (void);
105 void Cmd_Load (void);
106 void Cmd_SpriteFrame (void);
107 void Cmd_Sprdir (void);
108 void FinishSprite (void);
109
110 void Cmd_Grab (void);
111 void Cmd_Raw (void);
112 void Cmd_Mip (void);
113 void Cmd_Environment (void);
114 void Cmd_Colormap (void);
115
116 void Cmd_File (void);
117 void Cmd_Dir (void);
118 void Cmd_StartWad (void);
119 void Cmd_EndWad (void);
120 void Cmd_Mippal (void);
121 void Cmd_Mipdir (void);
122 void Cmd_Alphalight (void);
123
124 void Cmd_Picdir (void);
125 void Cmd_Pic (void);
126
127 void Cmd_Bookdir (void);
128 void Cmd_Book (void);
129
130 void Cmd_TextureMix (void);
131
132 void Cmd_Video (void);
133
134 //void RemapZero (byte *pixels, byte *palette, int width, int height);
135
136 void ReleaseFile (char *filename);
137
138 extern  byte            *byteimage, *lbmpalette;
139 extern  int                     byteimagewidth, byteimageheight;
140 extern  qboolean        TrueColorImage;
141 extern  unsigned        *longimage;
142 extern  int                     longimagewidth, longimageheight;
143
144 extern  qboolean        g_release;                      // don't grab, copy output data to new tree
145 extern  char            g_releasedir[1024];     // c:\quake2\baseq2, etc
146 extern  qboolean        g_archive;                      // don't grab, copy source data to new tree
147 extern  qboolean        do3ds;
148 extern  char            g_only[256];            // if set, only grab this cd
149 extern  qboolean        g_skipmodel;            // set true when a cd is not g_only
150 extern  qboolean        g_no_opimizations;
151 extern  int                     g_forcemodel;
152 extern  qboolean        g_verbose;
153 extern  qboolean        g_allow_newskin;
154 extern  qboolean        g_ignoreTriUV;  //from qdata.c
155 extern qboolean g_dokeypress;
156
157 extern  char            *trifileext;
158
159 extern  char            g_materialFile[256];
160
161 extern  unsigned        total_x;
162 extern  unsigned        total_y;
163 extern  unsigned        total_textures;
164
165 miptex_t *CreateMip(byte *data, unsigned width, unsigned height, byte *palette, int *FinalSize, qboolean mip);
166 miptex32_t *CreateMip32(unsigned *data, unsigned width, unsigned height, int *FinalSize, qboolean mip);