#include <K3dTextureBuild.h>
Inheritance diagram for K3dTextureBuild:
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 | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
int | m_iWidth |
int | m_iHeight |
Definition at line 48 of file K3dTextureBuild.h.
K3dTextureBuild::K3dTextureBuild | ( | K3dGameData * | _pGameData | ) |
Constructor.
_pGameData | Pointer to global game data |
Definition at line 40 of file K3dTextureBuild.cpp.
References m_pGameData, and K3dSceneData::SetTextureBuild().
K3dTextureBuild::~K3dTextureBuild | ( | ) |
bool K3dTextureBuild::SwapSurfaceRows | ( | SDL_Surface * | _ptSurface | ) | [private] |
Swap texture surface rows.
_ptSurface | Pointer to 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.
_ptSurface | Pointer to 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.
_strFileName | Texture filename |
Definition at line 261 of file K3dTextureBuild.cpp.
References CreateTexture().
int K3dTextureBuild::GetTextureWidth | ( | ) | [inline] |
Get Texture width.
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.
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().
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().