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
00033 #define CSTEX_UV 1 // UV is given in texture description
00034 #define CSTEX_V1 2 // vector1 is given in texture description
00035 #define CSTEX_V2 4 // vector2 is given in texture description
00036 #define CSTEX_UV_SHIFT 8 // explicit (u,v) <-> vertex mapping is given in texture description
00037
00038 SCF_VERSION (iSyntaxService, 0, 0, 2);
00039
00044 struct iSyntaxService : public iBase
00045 {
00049 virtual bool ParseMatrix (char *buffer, csMatrix3 &m) = 0;
00050
00054 virtual bool ParseVector (char *buffer, csVector3 &v) = 0;
00055
00059 virtual bool ParseMixmode (char *buffer, UInt &mixmode) = 0;
00060
00064 virtual bool ParseShading (char *buf, int &shading) = 0;
00065
00087 virtual bool ParseTexture (char *buf, const csVector3* vref, UInt &texspec,
00088 csVector3 &tx_orig, csVector3 &tx1,
00089 csVector3 &tx2, csVector3 &len,
00090 csMatrix3 &tx_m, csVector3 &tx_v,
00091 csVector2 &uv_shift,
00092 int &idx1, csVector2 &uv1,
00093 int &idx2, csVector2 &uv2,
00094 int &idx3, csVector2 &uv3,
00095 char *plane, const char *polyname) = 0;
00096
00101 virtual bool ParseWarp (char *buf, csVector &flags, bool &mirror,
00102 csMatrix3 &m, csVector3 &before,
00103 csVector3 &after) = 0;
00104
00105
00109 virtual bool ParsePoly3d (iEngine* engine, iPolygon3D* poly3d, char* buf,
00110 float default_texlen,
00111 iThingState* thing_state, int vt_offset) = 0;
00112
00120 virtual const char* MatrixToText (const csMatrix3 &m, int indent,
00121 bool newline=true) = 0;
00122
00131 virtual const char* VectorToText (const char *vname, const csVector3 &v,
00132 int indent, bool newline=true) = 0;
00133 virtual const char* VectorToText (const char *vname,
00134 float x, float y, float z, int indent, bool newline=true) = 0;
00135 virtual const char* VectorToText (const char *vname, const csVector2 &v,
00136 int indent, bool newline=true) = 0;
00137 virtual const char* VectorToText (const char *vname, float x, float y,
00138 int indent, bool newline=true) = 0;
00139
00148 virtual const char* BoolToText (const char *vname, bool b, int indent,
00149 bool newline=true) = 0;
00150
00158 virtual const char* MixmodeToText (UInt mixmode, int indent,
00159 bool newline=true) = 0;
00160 };
00161
00162 #endif