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

TextureDefinition Class Reference

Parsable texture definition. More...

#include <texdef.h>

List of all members.

Public Methods

 TextureDefinition ()
 TextureDefinition (rvshort _tex, rvfloat _x0,rvfloat _x1,rvfloat _y0,rvfloat _y1)
bool parseTexSpec (const char *str, TextureDefinition *def, Parser &, bool allow_asterisk)
bool uv_in_def (rvshort sheet, RV_UV *uv)
void rotateRight ()
void printtex (FILE *)

Public Attributes

rvfloat x0
rvfloat x1
rvfloat y0
rvfloat y1
rvshort tex

Private Methods

bool parseTexLetter (char *buf, Parser &, bool allow_asterisk)
bool parseSingleNum (char *buf, int *num, Parser &)
bool parseNumPair (char *obuf, char sepch, int *i1, int *i2, const char *pairname, Parser &)


Detailed Description

Parsable texture definition.

This class provides a common parser for the texture definition syntax in command files together with some functions on them.


Constructor & Destructor Documentation

TextureDefinition::TextureDefinition ( )
 

ctor

TextureDefinition::TextureDefinition ( rvshort _tex,
rvfloat _x0,
rvfloat _x1,
rvfloat _y0,
rvfloat _y1 )
 


Member Function Documentation

bool TextureDefinition::parseNumPair ( char * obuf,
char sepch,
int * i1,
int * i2,
const char * pairname,
Parser & p ) [private]
 

bool TextureDefinition::parseSingleNum ( char * buf,
int * num,
Parser & p ) [private]
 

bool TextureDefinition::parseTexLetter ( char * buf,
Parser & p,
bool allow_asterisk ) [private]
 

bool TextureDefinition::parseTexSpec ( const char * str,
TextureDefinition * def,
Parser & parser,
bool allow_asterisk )
 

parses the string str for a texture definition (style a:1,2:3x4). Error messages are printed through the given parser.

If allow_asterisk is false, wildcards are not allowed for the texture sheet.

def is a texture definition from which values are copied if parts contain wildcards. It must point to a valid TextureDefinition instance. default_src_texdef() is there if no special values are needed.

str is modified while parsing it. (Split up into substrings)

void TextureDefinition::printtex ( FILE * f )
 

dumps the texture definition in a human-readible format.

void TextureDefinition::rotateRight ( )
 

Rotate right 90 degrees.

bool TextureDefinition::uv_in_def ( rvshort sheet,
RV_UV * uv )
 

Returns true, if uv is inside the given definition and sheet matches.

Does work with TEX_UNKNOWN for both texture definition and argument


Member Data Documentation

rvshort TextureDefinition::tex
 

May be TEX_UNKNOWN

rvfloat TextureDefinition::x0
 

rvfloat TextureDefinition::x1
 

rvfloat TextureDefinition::y0
 

rvfloat TextureDefinition::y1
 


The documentation for this class was generated from the following files:
Generated at Fri Jul 26 09:34:00 2002 for rvtmod/rvglue by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000