UTILITY Class Reference

#include <utility.h>

List of all members.

Public Member Functions

 UTILITY ()
 ~UTILITY ()
void Init ()
GLuint TexLoad (string texfile, bool mipmap)
GLuint TexLoad (string texfile, int format, bool mipmap)
GLuint TexLoad (string texfile, int format, bool mipmap, int &w, int &h, const bool supresserror, bool &err)
GLuint TexLoad (string texfile, int format, bool mipmap, int &w, int &h, const bool supresserror, bool &err, int attempt)
void SelectTU (int TU)
void Tex2D (int TU, bool enable)
void TexCoord2d2f (int TU, float u, float v)
string sGetLine (ifstream &ffrom)
string sGetParam (ifstream &ffrom)
int iGetParam (ifstream &ffrom)
float fGetParam (ifstream &ffrom)
bool bGetParam (ifstream &ffrom)
int numTUs ()
void Draw2D (float x1, float y1, float x2, float y2, TEXTURE_HANDLE *texid)
void Draw2D (float x1, float y1, float x2, float y2, TEXTURE_HANDLE *texid, float rotation)
void Draw2D (float x1, float y1, float x2, float y2, TEXTURE_HANDLE *texid, float rotation, int texsize)
void Draw2D (float x1, float y1, float x2, float y2, TEXTURE_HANDLE *texid, float rotation, int texsize, float opacity)
void DrawButton (float x1, float y1, float x2, float y2, float sidewidth, TEXTURE_HANDLE *texid, float opacity)
void DrawEllipse (float center_x, float center_y, float radius_x, float radius_y)
void DrawEllipse (float center_x, float center_y, float radius_x, float radius_y, float color_r, float color_g, float color_b)
void DrawEllipse (float center_x, float center_y, float radius_x, float radius_y, float color_r, float color_g, float color_b, float opacity)
string GetEOFString ()
float GetValue (SDL_Surface *surf, int channel, float x, float y, bool interpolate)
float GetValue (SDL_Surface *surf, int channel, float x, float y, bool interpolate, bool wrap)
bool FileExists (string filename)
int IntersectTriangleD (double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v)
int IntersectTriangleF (float orig[3], float dir[3], float vert0[3], float vert1[3], float vert2[3], float *t, float *u, float *v)
bool IntersectQuadrilateralF (VERTEX orig, VERTEX dir, VERTEX v_00, VERTEX v_10, VERTEX v_11, VERTEX v_01, float &t, float &u, float &v)
bool IntersectQuadrilateralD (VERTEXD orig, VERTEXD dir, VERTEXD v_00, VERTEXD v_10, VERTEXD v_11, VERTEXD v_01, double &t, double &u, double &v)
int BruteForceTriangleIntersectionF (VERTEX *tri1, VERTEX *tri2, VERTEX &colpt, VERTEX &colseg, VERTEX &coldest, int &whichtri)
int BruteForceTriangleIntersectionF2 (VERTEX *tri1, VERTEX *tri2, VERTEX &colpt, VERTEX &colseg, VERTEX &coldest, int &whichtri, float &destdepth, float &origdepth)
int MollerTriTriIsectWithLine (float *V0, float *V1, float *V2, float *U0, float *U1, float *U2, int *coplanar, float *isectpt1, float *isectpt2)
bool FileCopy (const string &srcfile, const string &dstfile) const
string GetPathFromFilename (string filename)
bool isNaN (float val)
bool GetFolderIndex (string folderpath, list< string > &outputfolderlist)

Private Member Functions

void initerror ()

Private Attributes

ofstream error_log
GLint nb_multitexture
bool initdone
string texture_size


Detailed Description

Definition at line 82 of file utility.h.


Constructor & Destructor Documentation

UTILITY::UTILITY  ) 
 

Definition at line 273 of file utility.cpp.

References error_log, SETTINGS::GetSettingsDir(), initdone, and settings.

UTILITY::~UTILITY  ) 
 

Definition at line 280 of file utility.cpp.

References error_log.


Member Function Documentation

bool UTILITY::bGetParam ifstream &  ffrom  ) 
 

Definition at line 421 of file utility.cpp.

Referenced by GAMECONTROLS::LoadControls().

int UTILITY::BruteForceTriangleIntersectionF VERTEX tri1,
VERTEX tri2,
VERTEX colpt,
VERTEX colseg,
VERTEX coldest,
int &  whichtri
 

Definition at line 1797 of file utility.cpp.

References NoDivTriTriIsect().

Referenced by OBJECTCOLLISION::CollideBranchModel().

int UTILITY::BruteForceTriangleIntersectionF2 VERTEX tri1,
VERTEX tri2,
VERTEX colpt,
VERTEX colseg,
VERTEX coldest,
int &  whichtri,
float &  destdepth,
float &  origdepth
 

Definition at line 1877 of file utility.cpp.

References NoDivTriTriIsect(), NormalFromTri(), VERTEX::x, VERTEX::y, and VERTEX::z.

void UTILITY::Draw2D float  x1,
float  y1,
float  x2,
float  y2,
TEXTURE_HANDLE texid,
float  rotation,
int  texsize,
float  opacity
 

Definition at line 466 of file utility.cpp.

References TEXTURE_HANDLE::Activate(), QUATERNION::Rotate(), VERTEX::Set(), Tex2D(), and VERTEX::y.

void UTILITY::Draw2D float  x1,
float  y1,
float  x2,
float  y2,
TEXTURE_HANDLE texid,
float  rotation,
int  texsize
 

Definition at line 461 of file utility.cpp.

References Draw2D().

void UTILITY::Draw2D float  x1,
float  y1,
float  x2,
float  y2,
TEXTURE_HANDLE texid,
float  rotation
 

Definition at line 456 of file utility.cpp.

References Draw2D().

void UTILITY::Draw2D float  x1,
float  y1,
float  x2,
float  y2,
TEXTURE_HANDLE texid
 

Definition at line 451 of file utility.cpp.

Referenced by TIMER::Draw(), VGUI::Toggle::Draw(), VGUI::TextBox::Draw(), VGUI::Slider::Draw(), VGUI::Page::Draw(), VGUI::MultiImage::Draw(), VGUI::Image::Draw(), VGUI::Gui::Draw(), VGUI::Calibrate::Draw(), VGUI::Wheel2< wheel_t1, wheel_t2 >::Draw(), VGUI::Wheel< wheel_t >::Draw(), Draw2D(), and VAMOSWORLD::DrawHUD().

void UTILITY::DrawButton float  x1,
float  y1,
float  x2,
float  y2,
float  sidewidth,
TEXTURE_HANDLE texid,
float  opacity
 

Definition at line 897 of file utility.cpp.

References TEXTURE_HANDLE::Activate(), and VERTEX::Set().

Referenced by VGUI::TextBox::Draw(), VGUI::Page::Draw(), VGUI::ControlGrab::Draw(), and VGUI::Button::Draw().

void UTILITY::DrawEllipse float  center_x,
float  center_y,
float  radius_x,
float  radius_y,
float  color_r,
float  color_g,
float  color_b,
float  opacity
 

Definition at line 622 of file utility.cpp.

References DEG2RAD.

void UTILITY::DrawEllipse float  center_x,
float  center_y,
float  radius_x,
float  radius_y,
float  color_r,
float  color_g,
float  color_b
[inline]
 

Definition at line 114 of file utility.h.

References DrawEllipse().

void UTILITY::DrawEllipse float  center_x,
float  center_y,
float  radius_x,
float  radius_y
[inline]
 

Definition at line 113 of file utility.h.

Referenced by DrawEllipse().

float UTILITY::fGetParam ifstream &  ffrom  ) 
 

Definition at line 385 of file utility.cpp.

Referenced by GAMECONTROLS::LoadCalibration().

bool UTILITY::FileCopy const string &  srcfile,
const string &  dstfile
const
 

Definition at line 2025 of file utility.cpp.

bool UTILITY::FileExists string  filename  ) 
 

Definition at line 742 of file utility.cpp.

Referenced by JOEMODEL::AdditiveTexture(), Vamos_Body::Gl_Car::exterior_model(), REPLAY::PlayStart(), JOEMODEL::ReflectionTexture(), and JOEMODEL::Texture().

string UTILITY::GetEOFString  )  [inline]
 

Definition at line 116 of file utility.h.

References ENDOFFILESTRING.

bool UTILITY::GetFolderIndex string  folderpath,
list< string > &  outputfolderlist
 

Definition at line 2054 of file utility.cpp.

References NULL.

Referenced by VGUI::Gui::Init().

string UTILITY::GetPathFromFilename string  filename  ) 
 

Definition at line 2040 of file utility.cpp.

Referenced by JOEPACK::LoadPack().

float UTILITY::GetValue SDL_Surface *  surf,
int  channel,
float  x,
float  y,
bool  interpolate,
bool  wrap
 

Definition at line 650 of file utility.cpp.

References error_log.

float UTILITY::GetValue SDL_Surface *  surf,
int  channel,
float  x,
float  y,
bool  interpolate
 

Definition at line 645 of file utility.cpp.

int UTILITY::iGetParam ifstream &  ffrom  ) 
 

Definition at line 369 of file utility.cpp.

Referenced by KEYMAN::Load(), and GAMECONTROLS::LoadControls().

void UTILITY::Init  ) 
 

Definition at line 288 of file utility.cpp.

References error_log, SETTINGS::GetSettingsDir(), initdone, nb_multitexture, NULL, and settings.

Referenced by InitGameData().

void UTILITY::initerror  )  [private]
 

Definition at line 401 of file utility.cpp.

Referenced by numTUs(), SelectTU(), Tex2D(), and TexCoord2d2f().

bool UTILITY::IntersectQuadrilateralD VERTEXD  orig,
VERTEXD  dir,
VERTEXD  v_00,
VERTEXD  v_10,
VERTEXD  v_11,
VERTEXD  v_01,
double &  t,
double &  u,
double &  v
 

Definition at line 1168 of file utility.cpp.

References VERTEXD::cross(), VERTEXD::dot(), EPSILON, VERTEXD::x, VERTEXD::y, and VERTEXD::z.

bool UTILITY::IntersectQuadrilateralF VERTEX  orig,
VERTEX  dir,
VERTEX  v_00,
VERTEX  v_10,
VERTEX  v_11,
VERTEX  v_01,
float &  t,
float &  u,
float &  v
 

Definition at line 1060 of file utility.cpp.

References VERTEX::cross(), VERTEX::dot(), EPSILON, VERTEX::x, VERTEX::y, and VERTEX::z.

int UTILITY::IntersectTriangleD double  orig[3],
double  dir[3],
double  vert0[3],
double  vert1[3],
double  vert2[3],
double *  t,
double *  u,
double *  v
 

Definition at line 755 of file utility.cpp.

References CROSS, DOT, EPSILON, and SUB.

Referenced by OBJECTCOLLISION::CollideBranch_double().

int UTILITY::IntersectTriangleF float  orig[3],
float  dir[3],
float  vert0[3],
float  vert1[3],
float  vert2[3],
float *  t,
float *  u,
float *  v
 

Definition at line 825 of file utility.cpp.

References CROSS, DOT, EPSILON, isNaN(), and SUB.

bool UTILITY::isNaN float  val  ) 
 

Definition at line 2049 of file utility.cpp.

Referenced by IntersectTriangleF().

int UTILITY::MollerTriTriIsectWithLine float *  V0,
float *  V1,
float *  V2,
float *  U0,
float *  U1,
float *  U2,
int *  coplanar,
float *  isectpt1,
float *  isectpt2
 

Definition at line 1513 of file utility.cpp.

References compute_intervals_isectline(), coplanar_tri_tri(), CROSS, DOT, EPSILON, isect2(), SET, SORT2, and SUB.

Referenced by OBJECTCOLLISION::CollideBranchModel().

int UTILITY::numTUs  ) 
 

Definition at line 440 of file utility.cpp.

References initdone, initerror(), and nb_multitexture.

Referenced by JOEMODEL::DrawStatic().

void UTILITY::SelectTU int  TU  ) 
 

Definition at line 56 of file utility.cpp.

References initdone, and initerror().

Referenced by Vamos_Body::Gl_Car::draw(), JOEMODEL::Draw(), VGUI::SpinningCar::Draw(), VAMOSWORLD::draw_cars(), JOEMODEL::DrawStatic(), and Tex2D().

string UTILITY::sGetLine ifstream &  ffrom  ) 
 

Definition at line 328 of file utility.cpp.

Referenced by REPLAY::BuildFuncMem(), GAMECONTROLS::ControlParseError(), and GAMECONTROLS::LoadControls().

string UTILITY::sGetParam ifstream &  ffrom  ) 
 

Definition at line 350 of file utility.cpp.

Referenced by GAMECONTROLS::LoadControls().

void UTILITY::Tex2D int  TU,
bool  enable
 

Definition at line 406 of file utility.cpp.

References initdone, initerror(), and SelectTU().

Referenced by Draw2D(), and LoadingScreen().

void UTILITY::TexCoord2d2f int  TU,
float  u,
float  v
 

Definition at line 84 of file utility.cpp.

References initdone, initerror(), and nb_multitexture.

GLuint UTILITY::TexLoad string  texfile,
int  format,
bool  mipmap,
int &  w,
int &  h,
const bool  supresserror,
bool &  err,
int  attempt
 

Definition at line 120 of file utility.cpp.

References CARDINFOTYPE::ANISOTROPY, SETTINGS::Get(), CARDINFO::GetCapability(), SETTINGS::GetFullDataPath(), gfxcard, settings, and texture_size.

GLuint UTILITY::TexLoad string  texfile,
int  format,
bool  mipmap,
int &  w,
int &  h,
const bool  supresserror,
bool &  err
 

Definition at line 115 of file utility.cpp.

References TexLoad().

GLuint UTILITY::TexLoad string  texfile,
int  format,
bool  mipmap
 

Definition at line 263 of file utility.cpp.

References TexLoad().

GLuint UTILITY::TexLoad string  texfile,
bool  mipmap
 

Definition at line 258 of file utility.cpp.

Referenced by TEXTURE::Load(), and TexLoad().


Member Data Documentation

ofstream UTILITY::error_log [private]
 

Definition at line 85 of file utility.h.

Referenced by GetValue(), Init(), UTILITY(), and ~UTILITY().

bool UTILITY::initdone [private]
 

Definition at line 87 of file utility.h.

Referenced by Init(), numTUs(), SelectTU(), Tex2D(), TexCoord2d2f(), and UTILITY().

GLint UTILITY::nb_multitexture [private]
 

Definition at line 86 of file utility.h.

Referenced by Init(), numTUs(), and TexCoord2d2f().

string UTILITY::texture_size [private]
 

Definition at line 88 of file utility.h.

Referenced by TexLoad().


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 04:12:36 2006 by  doxygen 1.4.6