35 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
39 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
44 #define TRPG_MAGIC 9480372
47 #define TRPG_VERSION_MAJOR 2
48 #define TRPG_VERSION_MINOR 2
53 #define TRPG_NOMERGE_VERSION_MAJOR 2
54 #define TRPG_NOMERGE_VERSION_MINOR 2
58 #define TRPG_NOTOKEN 0
66 #define TRPG_MINTOKEN 100
73 #define TRPGHEADER 200
74 #define TRPGHEAD_LODINFO 201
78 #define TRPGMATTABLE 300
79 #define TRPGMATTABLE2 301
82 #define TRPGSHORTMATTABLE 302
87 #define TRPGMATERIAL 400
88 #define TRPGMAT_BASIC 401
90 #define TRPGMAT_SHADE 402
92 #define TRPGMAT_SIZES 403
95 #define TRPGMAT_CULL 404
97 #define TRPGMAT_ALPHA 405
99 #define TRPGMAT_NORMAL 406
101 #define TRPGMAT_TEXTURE 407
103 #define TRPGMAT_BUMP 408
105 #define TRPGMAT_ATTR 409
107 #define TRPGMAT_HANDLE 410
111 #define TRPGMAT_TEXENV 500
112 #define TRPGMAT_TXENV_MODE 501
114 #define TRPGMAT_TXENV_FILTER 502
116 #define TRPGMAT_TXENV_WRAP 503
118 #define TRPGMAT_TXENV_BORDER 504
122 #define TRPGTEXTABLE 600
123 #define TRPGTEXTABLE2 601
125 #define TRPGTEXTURE 650
129 #define TRPGMODELREF 700
130 #define TRPGMODELREF2 701
132 #define TRPGMODELTABLE 800
136 #define TRPGTILETABLE 900
137 #define TRPG_TILE_ENTRY 901
139 #define TRPGTILETABLE2 902
143 #define TRPGTILEHEADER 1000
144 #define TRPG_TILE_MATLIST 1001
146 #define TRPG_TILE_MODELLIST 1002
148 #define TRPG_TILE_DATE 1003
150 #define TRPGLOCALMATERIAL 1004
152 #define TRPG_TILE_LOCMATLIST 1005
158 #define TRPGLIGHTTABLE 1100
159 #define TRPGLIGHTATTR 1150
161 #define TRPGLIGHTATTR_BASIC 1151
163 #define TRPGLIGHTATTR_RASCAL 1152
165 #define TRPGLIGHTATTR_CALLIGRAPHIC 1153
167 #define TRPGLIGHTATTR_PERFORMER 1154
169 #define TRPGLIGHTATTR_ANIMATION 1155
171 #define TRPGLIGHTATTR_COMMENT 1156
173 #define TRPGLIGHTATTR_HANDLE 1157
175 #define TRPGLIGHT 1160
177 #define TRPG_LIGHT 1160
181 #define TRPGRANGETABLE 1200
182 #define TRPG_RANGE 1201
187 #define TRPG_TEXT_STYLE_TABLE 1300
188 #define TRPG_TEXT_STYLE 1301
190 #define TRPG_TEXT_STYLE_BASIC 1302
194 #define TRPG_SUPPORT_STYLE_TABLE 1310
195 #define TRPG_SUPPORT_STYLE 1311
197 #define TRPG_SUPPORT_STYLE_BASIC 1312
201 #define TRPG_LABEL_PROPERTY_TABLE 1320
202 #define TRPG_LABEL_PROPERTY 1321
204 #define TRPG_LABEL_PROPERTY_BASIC 1322
209 #define TRPG_LABEL 1330
213 #define TRPG_GROUP 2001
214 #define TRPG_BILLBOARD 2002
216 #define TRPG_LOD 2003
218 #define TRPG_TRANSFORM 2004
220 #define TRPG_MODELREF 2005
222 #define TRPG_LAYER 2006
226 #define TRPG_GEOMETRY 3000
227 #define TRPG_GEOM_PRIM 3001
229 #define TRPG_GEOM_MATERIAL 3002
231 #define TRPG_GEOM_VERT32 3003
233 #define TRPG_GEOM_VERT64 3004
235 #define TRPG_GEOM_NORM32 3005
237 #define TRPG_GEOM_NORM64 3006
239 #define TRPG_GEOM_COLOR 3007
241 #define TRPG_GEOM_TEX32 3008
243 #define TRPG_GEOM_TEX64 3009
245 #define TRPG_GEOM_EFLAG 3010
249 #define TRPG_ATTACH 4000
252 #define TRPG_CHILDREF 5000
255 #define TRPG_MAXTOKEN 5000
271 if ( x != pt.
x )
return false;
272 if ( y != pt.
y )
return false;
289 trpg3dPoint(
double in_x,
double in_y,
double in_z) {x = in_x; y = in_y; z = in_z;}
291 if ( x != pt.
x )
return false;
292 if ( y != pt.
y )
return false;
293 if ( z != pt.
z )
return false;
304 if ( color.
red != red )
return false;
305 if ( color.
green != green )
return false;
306 if ( color.
blue != blue )
return false;
328 virtual void Add(
int32) = 0;
329 virtual void Add(
int64) = 0;
330 virtual void Add(
const char *) = 0;
334 virtual void Add(
bool) = 0;
336 virtual void Add(
uint8) = 0;
337 #if (trpgDiskRef != int64)
342 virtual void Reset(
void) = 0;
346 virtual void End(
void) = 0;
348 virtual void Push(
void) = 0;
350 virtual void Pop(
void) = 0;
357 virtual void Add(
const std::string &);
383 virtual int length(
void)
const;
385 virtual const char *getData(
void)
const;
387 virtual void setLength(
unsigned int);
396 virtual void Add(
const char *);
398 virtual void Add(std::string &);
405 virtual void Add(
bool);
409 #if (trpgDiskRef != int64)
416 virtual void Reset(
void);
423 virtual void End(
void);
426 virtual void Push(
void);
429 virtual void Pop(
void);
432 virtual bool UnPop();
435 virtual bool UnPush();
438 virtual void append(
unsigned int,
const char *);
439 virtual void set(
unsigned int pos,
unsigned int len,
const char *);
457 virtual bool Get(
int32 &);
458 virtual bool Get(
int64 &);
459 virtual bool Get(
char *,
int);
460 virtual bool Get(std::string &);
464 virtual bool Get(
bool &);
466 virtual bool Get(
uint8 &);
467 #if (trpgDiskRef != int64)
474 virtual bool GetArray(
int,
float32 **);
475 virtual bool GetArray(
int,
float64 **);
476 virtual bool GetArray(
int,
int32 **);
478 virtual bool GetArray(
int,
char **);
490 virtual void PushLimit(
int);
493 virtual void PopLimit(
void);
497 virtual bool SkipToLimit(
void);
500 virtual bool isEmpty(
void) = 0;
505 virtual bool TestLimit(
int);
512 virtual bool GetData(
char *,
int)=0;
517 virtual bool GetDataRef(
char **,
int)=0;
520 virtual bool Skip(
int) = 0;
523 virtual void UpdateLimits(
int);
546 char *GetDataPtr(
void);
566 bool isValid(
void)
const;
616 virtual void Reset(
void) = 0;
621 const char *
getErrMess()
const {
if(errMess[0] ==
'\0')
return 0;
else return &errMess[0];}
625 mutable char errMess[512];
658 virtual bool Append(
const char *,
int size);
659 virtual int64 Pos(
void)
const;
660 virtual int GetLengthWritten();
661 virtual bool Flush(
void);
662 virtual void Init(
trpgEndian,
const char *,
bool reuse=
false);
664 bool isValid(
void)
const;
685 virtual bool Read(
char *data,
int32 baseOffset,
int32 objOffset,
int32 dataSize);
687 bool isValid(
void)
const;
702 virtual void Init(
const char *prefix,
const char *ext,
int noFiles);
709 char baseName[1024],ext[20];
Definition: trpage_io.h:314
bool writeHandle
Definition: trpage_io.h:581
int lastUsed
Definition: trpage_io.h:718
virtual void Add(int32)=0
trpgllong trpgDiskRef
Basic data types.
Definition: trpage_io.h:260
double y
Definition: trpage_io.h:287
trpg3dPoint(double in_x, double in_y, double in_z)
Definition: trpage_io.h:289
trpgEndian
Used to specify machine endianess.
Definition: trpage_io.h:314
int y
Definition: trpage_io.h:280
std::vector< int > limits
Definition: trpage_io.h:524
trpgEndian cpuNess
Endianness of the machine we're running on.
Definition: trpage_io.h:367
FILE * fp
Definition: trpage_io.h:668
FILE * fp
Definition: trpage_io.h:691
#define DT_DLL_osgdb_vrftxp
Contains DLL export macros.
Definition: osgdb_vrftxpDefines.h:25
virtual void Push(void)=0
See trpgMemWriteBuffer for details.
std::vector< OpenFile > files
Definition: trpage_io.h:721
const char * getErrMess() const
Definition: trpage_io.h:621
virtual TeAttrHdl GetHandle() const
Definition: trpage_io.h:568
Definition: trpage_io.h:314
trpgrAppFileCache()
Definition: trpage_io.h:699
virtual void End(void)=0
See trpgMemWriteBuffer for details.
Definition: trpage_io.h:697
int trpgMatRef
{secret}
Definition: trpage_io.h:262
float64 green
Definition: trpage_io.h:309
int timeCount
Definition: trpage_io.h:722
float64 red
Definition: trpage_io.h:309
double x
Definition: trpage_io.h:267
voidpf void uLong size
Definition: ioapi.h:39
virtual bool GetDataRef(char **, int)=0
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
trpgrAppFile * afile
Definition: trpage_io.h:717
trpgwAppFile()
Definition: trpage_io.h:654
trpg2iPoint(int in_x, int in_y)
Definition: trpage_io.h:282
long TeAttrHdl
Definition: trpage_io.h:30
TeAttrHdl handle
Definition: trpage_io.h:580
trpg2iPoint(void)
Definition: trpage_io.h:281
int32 row
Row and col are used for TerraPage 2.3 archives, so we can know which block to get the appropriate fi...
Definition: trpage_io.h:642
bool valid
Definition: trpage_io.h:666
virtual void Reset(void)=0
trpgColor(float64 r, float64 g, float64 b)
Definition: trpage_io.h:301
trpgEndian ness
Definition: trpage_io.h:508
double z
Definition: trpage_io.h:287
long long int64
Definition: trpage_sys.h:67
Definition: trpage_io.h:652
trpg2dPoint(double in_x, double in_y)
Definition: trpage_io.h:269
virtual bool GetData(char *, int)=0
Endiannees of the CPU.
int col
Definition: trpage_io.h:716
trpgEndian ness
Definition: trpage_io.h:690
trpg2dPoint(void)
Definition: trpage_io.h:268
virtual void SetHandle(TeAttrHdl hdl)
Definition: trpage_io.h:571
Definition: trpage_io.h:376
float64 blue
Definition: trpage_io.h:309
trpgReadWriteable()
Definition: trpage_io.h:604
bool valid
Definition: trpage_io.h:579
Definition: trpage_io.h:265
unsigned char uint8
Basic data types.
Definition: trpage_sys.h:74
char * data
Current position.
Definition: trpage_io.h:554
char * data
Definition: trpage_io.h:442
int totLen
Data Length.
Definition: trpage_io.h:552
Definition: trpage_io.h:561
Definition: trpage_io.h:299
int32 offset
Offset within the file Note: This is not a 64 bit value.
Definition: trpage_io.h:639
Definition: trpage_io.h:532
Definition: trpage_io.h:677
Definition: trpage_print.h:28
Definition: trpage_io.h:632
float float32
Definition: trpage_sys.h:83
bool operator!=(const trpg3dPoint &pt) const
Definition: trpage_io.h:296
virtual ~trpgWriteBuffer(void)
Definition: trpage_io.h:325
virtual void Begin(trpgToken)=0
See trpgMemWriteBuffer for details.
int totLen
Definition: trpage_io.h:441
trpgColor(void)
Definition: trpage_io.h:302
double y
Definition: trpage_io.h:267
trpgEndian cpuNess
Endianness of the source we're reading.
Definition: trpage_io.h:509
Definition: trpage_io.h:601
int row
ID of open file.
Definition: trpage_io.h:715
int64 trpgllong
We use long longs for addresses within a paging file.
Definition: trpage_sys.h:96
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
std::vector< int > lengths
Definition: trpage_io.h:443
virtual bool Print(trpgPrintBuffer &) const
Definition: trpage_io.h:619
virtual bool Read(trpgReadBuffer &)
Definition: trpage_io.h:612
Definition: trpage_io.h:323
Definition: trpage_io.h:278
int GetLength(void)
Gets the size of the buffer.
Definition: trpage_io.h:542
trpgEndian ness
Definition: trpage_io.h:667
bool operator==(const trpgColor &color)
Definition: trpage_io.h:303
bool operator==(const trpg2dPoint &pt) const
Definition: trpage_io.h:270
int id
Definition: trpage_io.h:714
bool operator!=(const trpg2dPoint &pt) const
Definition: trpage_io.h:275
virtual ~trpgReadBuffer(void)
Definition: trpage_io.h:454
int len
Skip over the given amount.
Definition: trpage_io.h:551
Definition: trpage_io.h:711
trpg3dPoint(void)
Definition: trpage_io.h:288
int pos
Total allocated length.
Definition: trpage_io.h:553
trpgwAppAddress()
Definition: trpage_io.h:634
double x
Definition: trpage_io.h:287
#define TX_EXDECL
Goes before "class" to handle DLL export in windows.
Definition: trdll.h:69
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
trpgEndian ness
Target endianness of the buffer. This should be set by the subclass on creation.
Definition: trpage_io.h:365
virtual bool isEmpty(void)=0
Buffer is empty.
Definition: trpage_io.h:452
voidpf uLong offset
Definition: ioapi.h:42
trpgrAppFile()
Definition: trpage_io.h:679
int curLen
Definition: trpage_io.h:440
bool valid
Definition: trpage_io.h:689
virtual void Pop(void)=0
See trpgMemWriteBuffer for details.
virtual trpgEndian GetEndian(void)
Definition: trpage_io.h:361
int lengthSoFar
Definition: trpage_io.h:669
Definition: trpage_io.h:285
short trpgToken
16 bit token definition value. These are values such as TRPGTEXTABLE or TRPG_ATTACH, etc...
Definition: trpage_io.h:61
bool operator==(const trpg3dPoint &pt) const
Definition: trpage_io.h:290
int32 col
Definition: trpage_io.h:643