K3dTextureBuild Class Reference

#include <K3dTextureBuild.h>

Inheritance diagram for K3dTextureBuild:

K3dMngGraphics K3dMngSystem K3dScene List of all members.

Public Member Functions

 K3dTextureBuild (K3dGameData *_pGameData)
 Constructor.
 ~K3dTextureBuild ()
void LoadTextures ()
 Load textures from map file.
int FindTextureId (const char *_strName)
 Find texture index in global texture data by texture name.
GLuint CreateTexture (const char *_strFileName)
 Create texture from file.
int GetTextureWidth ()
 Get Texture width.
int GetTextureHeight ()
 Get Texture width.
void DeleteTextures ()
 Delete texture array.

Private Member Functions

bool SwapSurfaceRows (SDL_Surface *_ptSurface)
 Swap texture surface rows.
GLuint CreateTexture (SDL_Surface *_ptSurface)
 Create texture from SDL surface.

Private Attributes

K3dGameDatam_pGameData
 Global game data, data centered game system.
int m_iWidth
int m_iHeight

Detailed Description

Definition at line 48 of file K3dTextureBuild.h.


Constructor & Destructor Documentation

K3dTextureBuild::K3dTextureBuild ( K3dGameData _pGameData  ) 

Constructor.

Parameters:
_pGameData Pointer to global game data
See also:
K3dGameData

Definition at line 40 of file K3dTextureBuild.cpp.

References m_pGameData, and K3dSceneData::SetTextureBuild().

K3dTextureBuild::~K3dTextureBuild (  ) 

Definition at line 48 of file K3dTextureBuild.cpp.

References DeleteTextures().


Member Function Documentation

bool K3dTextureBuild::SwapSurfaceRows ( SDL_Surface *  _ptSurface  )  [private]

Swap texture surface rows.

Parameters:
_ptSurface Pointer to SDL surface
See also:
SDL_Surface

Pointer to swap rows

Definition at line 125 of file K3dTextureBuild.cpp.

Referenced by CreateTexture().

GLuint K3dTextureBuild::CreateTexture ( SDL_Surface *  _ptSurface  )  [private]

Create texture from SDL surface.

Parameters:
_ptSurface Pointer to SDL surface
See also:
SDL_Surface

Definition at line 179 of file K3dTextureBuild.cpp.

References K3dOptionsData::GetGraphicOption(), TGraphicOption::iColorBits, m_iHeight, m_iWidth, m_pGameData, and SwapSurfaceRows().

Referenced by CreateTexture(), and LoadTextures().

void K3dTextureBuild::LoadTextures (  ) 

Load textures from map file.

Definition at line 65 of file K3dTextureBuild.cpp.

References K3dString::AddNumber(), CreateTexture(), K3dSceneData::GetLua(), K3dSceneData::GetPath(), K3dString::GetString(), GetTextureHeight(), K3dGameData::GetTextureObjSP(), GetTextureWidth(), K_PATH_APP, K_STR_NAME, K_STR_NUM_TEXTURES, K_STR_PATH, K_STR_TEXTURE_TABLE, K3dLua::LuaError(), K3dLua::LuaGetFieldString(), K3dLua::LuaGetGlobal(), K3dLua::LuaIsNumber(), K3dLua::LuaIsTable(), K3dLua::LuaToNumber(), m_pGameData, and K3dSafePointer< _T >::New().

Referenced by K3dMngGraphics::InitMngGraphics().

int K3dTextureBuild::FindTextureId ( const char *  _strName  ) 

Find texture index in global texture data by texture name.

Definition at line 108 of file K3dTextureBuild.cpp.

References K3dSafePointer< _T >::Get(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetTextureObjSP(), and m_pGameData.

Referenced by K3dFontBmp::LoadBmpFonts(), K2dImageBuild::LoadImages(), and K3dSphereBuild::LoadSpheres().

GLuint K3dTextureBuild::CreateTexture ( const char *  _strFileName  ) 

Create texture from file.

Parameters:
_strFileName Texture filename

Definition at line 261 of file K3dTextureBuild.cpp.

References CreateTexture().

int K3dTextureBuild::GetTextureWidth (  )  [inline]

Get Texture width.

Return values:
m_iWidth Texture width

Definition at line 69 of file K3dTextureBuild.h.

References m_iWidth.

Referenced by LoadTextures().

int K3dTextureBuild::GetTextureHeight (  )  [inline]

Get Texture width.

Return values:
m_iHeight Texture height

Definition at line 75 of file K3dTextureBuild.h.

References m_iHeight.

Referenced by LoadTextures().

void K3dTextureBuild::DeleteTextures (  ) 

Delete texture array.

Definition at line 55 of file K3dTextureBuild.cpp.

References K3dSafePointer< _T >::Delete(), K3dSafePointer< _T >::Get(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetTextureObjSP(), and m_pGameData.

Referenced by ~K3dTextureBuild().


Member Data Documentation

K3dGameData* K3dTextureBuild::m_pGameData [private]

Global game data, data centered game system.

Reimplemented in K3dScene, K3dMngGraphics, and K3dMngSystem.

Definition at line 50 of file K3dTextureBuild.h.

Referenced by CreateTexture(), DeleteTextures(), FindTextureId(), K3dTextureBuild(), and LoadTextures().

int K3dTextureBuild::m_iWidth [private]

Definition at line 51 of file K3dTextureBuild.h.

Referenced by CreateTexture(), and GetTextureWidth().

int K3dTextureBuild::m_iHeight [private]

Definition at line 52 of file K3dTextureBuild.h.

Referenced by CreateTexture(), and GetTextureHeight().


The documentation for this class was generated from the following files:
Generated on Thu Aug 16 23:53:34 2007 for K3dEngine by  doxygen 1.5.0