CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iSyntaxService Struct Reference
[Loading & Saving support]

This component provides services for other loaders to easily parse properties of standard CS world syntax. More...

#include <services.h>

Inheritance diagram for iSyntaxService:

iBase List of all members.

Public Methods

virtual bool ParseBool (iDocumentNode *node, bool &result, bool def_result)=0
 Parse the value of this node and return a boolean depending on this value. More...

virtual bool ParseMatrix (iDocumentNode *node, csMatrix3 &m)=0
 Parse a matrix description. More...

virtual bool ParseVector (iDocumentNode *node, csVector3 &v)=0
 Parse a vector description. More...

virtual bool ParseBox (iDocumentNode *node, csBox3 &v)=0
 Parse a box description. More...

virtual bool ParseColor (iDocumentNode *node, csColor &c)=0
 Parse a color description. More...

virtual bool ParseMixmode (iDocumentNode *node, uint &mixmode)=0
 Parse a mixmode description. More...

virtual bool ParseTextureMapping (iDocumentNode *node, const csVector3 *vref, uint &texspec, csVector3 &tx_orig, csVector3 &tx1, csVector3 &tx2, csVector3 &len, csMatrix3 &tx_m, csVector3 &tx_v, csVector2 &uv_shift, int &idx1, csVector2 &uv1, int &idx2, csVector2 &uv2, int &idx3, csVector2 &uv3, const char *polyname)=0
 Parse a texture mapping specification. More...

virtual bool ParsePortal (iDocumentNode *node, iLoaderContext *ldr_context, iPolygon3DStatic *poly3d, csVector &flags, bool &mirror, bool &warp, int &msv, csMatrix3 &m, csVector3 &before, csVector3 &after)=0
 Parses a portal definition specification. More...

virtual bool ParsePoly3d (iDocumentNode *node, iLoaderContext *ldr_context, iEngine *engine, iPolygon3DStatic *poly3d, float default_texlen, iThingFactoryState *thing_fact_state, int vt_offset)=0
 Parses a POLYGON. More...

virtual void ReportError (const char *msgid, iDocumentNode *errornode, const char *msg,...)=0
 Report an error and also gives a path in the XML tree. More...

virtual void ReportBadToken (iDocumentNode *badtokennode)=0
 Report a bad token. More...

virtual void Report (const char *msgid, int severity, iDocumentNode *errornode, const char *msg,...)=0
 Report something, also gives a path in the XML tree. More...


Detailed Description

This component provides services for other loaders to easily parse properties of standard CS world syntax.

Definition at line 61 of file services.h.


Member Function Documentation

virtual bool iSyntaxService::ParseBool iDocumentNode   node,
bool &    result,
bool    def_result
[pure virtual]
 

Parse the value of this node and return a boolean depending on this value.

The following mapping happens (case insensitive):

  • yes -> true
  • no -> false
  • true -> true
  • false -> false
  • on -> true
  • off -> false
  • (empty value) -> (def_result)
  • (everyting else) -> error

virtual bool iSyntaxService::ParseBox iDocumentNode   node,
csBox3   v
[pure virtual]
 

Parse a box description.

Returns true if successful.

virtual bool iSyntaxService::ParseColor iDocumentNode   node,
csColor   c
[pure virtual]
 

Parse a color description.

Returns true if successful.

virtual bool iSyntaxService::ParseMatrix iDocumentNode   node,
csMatrix3   m
[pure virtual]
 

Parse a matrix description.

Returns true if successful.

virtual bool iSyntaxService::ParseMixmode iDocumentNode   node,
uint   mixmode
[pure virtual]
 

Parse a mixmode description.

Returns true if successful.

virtual bool iSyntaxService::ParsePoly3d iDocumentNode   node,
iLoaderContext   ldr_context,
iEngine   engine,
iPolygon3DStatic   poly3d,
float    default_texlen,
iThingFactoryState   thing_fact_state,
int    vt_offset
[pure virtual]
 

Parses a POLYGON.

virtual bool iSyntaxService::ParsePortal iDocumentNode   node,
iLoaderContext   ldr_context,
iPolygon3DStatic   poly3d,
csVector   flags,
bool &    mirror,
bool &    warp,
int &    msv,
csMatrix3   m,
csVector3   before,
csVector3   after
[pure virtual]
 

Parses a portal definition specification.

flags: contains all flags found in the description.

virtual bool iSyntaxService::ParseTextureMapping iDocumentNode   node,
const csVector3   vref,
uint   texspec,
csVector3   tx_orig,
csVector3   tx1,
csVector3   tx2,
csVector3   len,
csMatrix3   tx_m,
csVector3   tx_v,
csVector2   uv_shift,
int &    idx1,
csVector2   uv1,
int &    idx2,
csVector2   uv2,
int &    idx3,
csVector2   uv3,
const char *    polyname
[pure virtual]
 

Parse a texture mapping specification.

  • vref: is the array containing vertices which can be referenced by indices in the description.
  • texspec: describes the data found for the texture transformation. It consists of or'ed CSTEX_.
  • tx_orig, tx1, tx2, len: texture transformation is given by 3 points describing a 3d space (third vector is implicitly given to be perpendicular on the 2 vectors described by the 3 points),
  • width and height of the texture.
  • tx_m and tx_v: if texture transformation is given explicitly by matrix/vector.
  • uv_shift: contains UV_SHIFT value.
  • idx? and uv?: if texture mapping is given explicitly by defining the u,v coordinate that belongs to vertex idx? of the polygon.
  • polyname: name of polygon to which this texture description belongs. This is used to make errormessages more verbose.
See also:
CSTEX_UV

virtual bool iSyntaxService::ParseVector iDocumentNode   node,
csVector3   v
[pure virtual]
 

Parse a vector description.

Returns true if successful.

virtual void iSyntaxService::Report const char *    msgid,
int    severity,
iDocumentNode   errornode,
const char *    msg,
...   
[pure virtual]
 

Report something, also gives a path in the XML tree.

virtual void iSyntaxService::ReportBadToken iDocumentNode   badtokennode [pure virtual]
 

Report a bad token.

This is a conveniance function which will eventually call ReportError().

virtual void iSyntaxService::ReportError const char *    msgid,
iDocumentNode   errornode,
const char *    msg,
...   
[pure virtual]
 

Report an error and also gives a path in the XML tree.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14