00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _I_SYNTAXSERVICE_H_
00020 #define _I_SYNTAXSERVICE_H_
00021
00022 #include "csutil/scf.h"
00023
00024 class csMatrix3;
00025 class csVector3;
00026 class csVector2;
00027 class csVector;
00028 struct iPolygon3D;
00029 struct iEngine;
00030 struct iMaterialWrapper;
00031 struct iThingState;
00032 struct iLoaderContext;
00033
00034 #define CSTEX_UV 1 // UV is given in texture description
00035 #define CSTEX_V1 2 // vector1 is given in texture description
00036 #define CSTEX_V2 4 // vector2 is given in texture description
00037 #define CSTEX_UV_SHIFT 8 // explicit (u,v) <-> vertex mapping is given in texture description
00038
00039 SCF_VERSION (iSyntaxService, 0, 0, 3);
00040
00045 struct iSyntaxService : public iBase
00046 {
00050 virtual bool ParseMatrix (char *buffer, csMatrix3 &m) = 0;
00051
00055 virtual bool ParseVector (char *buffer, csVector3 &v) = 0;
00056
00060 virtual bool ParseMixmode (char *buffer, uint &mixmode) = 0;
00061
00065 virtual bool ParseShading (char *buf, int &shading) = 0;
00066
00088 virtual bool ParseTexture (char *buf, const csVector3* vref, uint &texspec,
00089 csVector3 &tx_orig, csVector3 &tx1,
00090 csVector3 &tx2, csVector3 &len,
00091 csMatrix3 &tx_m, csVector3 &tx_v,
00092 csVector2 &uv_shift,
00093 int &idx1, csVector2 &uv1,
00094 int &idx2, csVector2 &uv2,
00095 int &idx3, csVector2 &uv3,
00096 char *plane, const char *polyname) = 0;
00097
00102 virtual bool ParseWarp (char *buf, csVector &flags, bool &mirror,
00103 bool& warp, int& msv,
00104 csMatrix3 &m, csVector3 &before,
00105 csVector3 &after) = 0;
00106
00107
00111 virtual bool ParsePoly3d (iLoaderContext* ldr_context,
00112 iEngine* engine, iPolygon3D* poly3d, char* buf,
00113 float default_texlen,
00114 iThingState* thing_state, int vt_offset) = 0;
00115
00123 virtual const char* MatrixToText (const csMatrix3 &m, int indent,
00124 bool newline=true) = 0;
00125
00134 virtual const char* VectorToText (const char *vname, const csVector3 &v,
00135 int indent, bool newline=true) = 0;
00136 virtual const char* VectorToText (const char *vname,
00137 float x, float y, float z, int indent, bool newline=true) = 0;
00138 virtual const char* VectorToText (const char *vname, const csVector2 &v,
00139 int indent, bool newline=true) = 0;
00140 virtual const char* VectorToText (const char *vname, float x, float y,
00141 int indent, bool newline=true) = 0;
00142
00151 virtual const char* BoolToText (const char *vname, bool b, int indent,
00152 bool newline=true) = 0;
00153
00161 virtual const char* MixmodeToText (uint mixmode, int indent,
00162 bool newline=true) = 0;
00163 };
00164
00165 #endif