1 | #ifndef _LWREADER_H_
|
---|
2 | #define _LWREADER_H_
|
---|
3 |
|
---|
4 | #include "lwo.h"
|
---|
5 | #include "lwObject.h"
|
---|
6 | #include <istream>
|
---|
7 | #include <vector>
|
---|
8 |
|
---|
9 | class lwReader
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | lwObject *readObjectFromFile( const char *nfilename);
|
---|
13 | lwObject *readObjectFromStream( istream *nis);
|
---|
14 | private:
|
---|
15 | istream *is;
|
---|
16 | unsigned long chunksize;
|
---|
17 | unsigned long currentchunkid;
|
---|
18 | unsigned long formsize;
|
---|
19 | unsigned long flen;
|
---|
20 |
|
---|
21 | bool *flags;
|
---|
22 |
|
---|
23 | lwObject *lwGetLWLO();
|
---|
24 | lwObject *lwGetLWO2();
|
---|
25 |
|
---|
26 | int lwGetPoints( vpoints &points );
|
---|
27 | int lwGetPolygons( vpolygons &polygons, int ptoffset );
|
---|
28 | int lwGetLWOBPolygons( vpolygons &polygons, int ptoffset );
|
---|
29 | int lwGetTags( vtags &tags );
|
---|
30 | int lwGetPolygonTags( vtags &tags, int tagsoffset, vpolygons &polygons, int polygonsoffset );
|
---|
31 | lwVMap *lwGetVMap( int ptoffset, int poloffset, int perpoly );
|
---|
32 | lwClip *lwGetClip();
|
---|
33 | lwEnvelope *lwGetEnvelope();
|
---|
34 | int lwGetTHeader( int hsz, lwTexture &tex );
|
---|
35 | int lwGetTMap( int tmapsz, lwTMap &tmap );
|
---|
36 | lwImageMap *lwGetImageMap( int rsz, lwTexture &tex );
|
---|
37 | lwProcedural *lwGetProcedural( int rsz, lwTexture &tex );
|
---|
38 | lwGradient *lwGetGradient( int rsz, lwTexture &tex );
|
---|
39 | lwTexture *lwGetTexture( int bloksz, unsigned int type );
|
---|
40 | lwPlugin *lwGetShader( int bloksz );
|
---|
41 | lwSurface *lwGetSurface();
|
---|
42 | lwSurface *lwGetLWOBSurface( lwObject *obj );
|
---|
43 |
|
---|
44 | int add_clip( char *s, vclips &clips );
|
---|
45 | int add_tvel( float pos[], float vel[], venvelopes &envelopes );
|
---|
46 | lwTexture *get_texture( char *s );
|
---|
47 |
|
---|
48 | char *getbytes( int size );
|
---|
49 | void skipbytes( int n );
|
---|
50 | short getI2();
|
---|
51 | long getI4();
|
---|
52 | unsigned char getU1();
|
---|
53 | unsigned short getU2();
|
---|
54 | unsigned long getU4();
|
---|
55 | int getVX();
|
---|
56 | float getF4();
|
---|
57 | char *getS0();
|
---|
58 | short sgetI2( char **bp );
|
---|
59 | long sgetI4( char **bp );
|
---|
60 | unsigned char sgetU1( char **bp );
|
---|
61 | unsigned short sgetU2( char **bp );
|
---|
62 | unsigned long sgetU4( char **bp );
|
---|
63 | int sgetVX( char **bp );
|
---|
64 | float sgetF4( char **bp );
|
---|
65 | char *sgetS0( char **bp );
|
---|
66 |
|
---|
67 | unsigned short swappedShort(unsigned short w);
|
---|
68 | unsigned long swappedLong(unsigned long w);
|
---|
69 | void revbytes( void *bp, int elsize, int elcount );
|
---|
70 | };
|
---|
71 |
|
---|
72 | #endif // _LWREADER_H_
|
---|
73 |
|
---|