Skyscraper 2.0
|
#include <texture.h>
Classes | |
struct | TextureInfo |
struct | TexturePixelBox |
Public Member Functions | |
TextureManager (Object *parent) | |
~TextureManager () | |
bool | LoadTexture (const std::string &filename, const std::string &name, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false, int mipmaps=-1, bool use_alpha_color=false, Ogre::ColourValue alpha_color=Ogre::ColourValue::Black) |
bool | LoadAnimatedTexture (std::vector< std::string > filenames, const std::string &name, Real duration, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false, int mipmaps=-1, bool use_alpha_color=false, Ogre::ColourValue alpha_color=Ogre::ColourValue::Black) |
bool | LoadAlphaBlendTexture (const std::string &filename, const std::string &specular_filename, const std::string &blend_filename, const std::string &name, bool spherical, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false, int mipmaps=-1, bool use_alpha_color=false, Ogre::ColourValue alpha_color=Ogre::ColourValue::Black) |
bool | LoadMaterial (const std::string &filename, const std::string &name, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false) |
bool | UnloadTexture (const std::string &name, const std::string &group) |
bool | UnloadMaterial (const std::string &name, const std::string &group) |
bool | LoadTextureCropped (const std::string &filename, const std::string &name, int x, int y, int width, int height, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false) |
bool | RotateTexture (const std::string &name, Real angle) |
bool | RotateAnimTexture (const std::string &name, Real speed) |
bool | ScrollTexture (const std::string &name, Real x_offset, Real y_offset) |
bool | ScrollAnimTexture (const std::string &name, Real x_speed, Real y_speed) |
bool | ScaleTexture (const std::string &name, Real x_scale, Real y_scale) |
bool | TransformTexture (const std::string &name, const std::string &type, const std::string &wave_type, Real base, Real frequency, Real phase, Real amplitude) |
Real | AutoSize (Real n1, Real n2, bool iswidth, Real offset, bool enable_force, bool force_mode) |
void | SetTextureMapping (int vertindex1, Vector2 uv1, int vertindex2, Vector2 uv2, int vertindex3, Vector2 uv3) |
void | SetTextureMapping2 (const std::string &x1, const std::string &y1, const std::string &z1, Vector2 uv1, const std::string &x2, const std::string &y2, const std::string &z2, Vector2 uv2, const std::string &x3, const std::string &y3, const std::string &z3, Vector2 uv3) |
void | ResetTextureMapping (bool todefaults=false) |
void | SetAutoSize (bool x, bool y) |
void | GetAutoSize (bool &x, bool &y) |
void | SetTextureOverride (const std::string &mainneg, const std::string &mainpos, const std::string &sideneg, const std::string &sidepos, const std::string &top, const std::string &bottom) |
void | SetTextureFlip (int mainneg, int mainpos, int sideneg, int sidepos, int top, int bottom) |
void | ProcessTextureFlip (Real tw, Real th) |
bool | GetTextureTiling (const std::string &texture, Real &tw, Real &th) |
bool | GetTextureForce (const std::string &texture, bool &enable_force, bool &force_mode) |
bool | AddTextToTexture (const std::string &origname, const std::string &name, const std::string &font_filename, Real font_size, const std::string &text, int x1, int y1, int x2, int y2, const std::string &h_align, const std::string &v_align, int ColorR, int ColorG, int ColorB, bool enable_force=false, bool force_mode=false) |
bool | AddTextureOverlay (const std::string &orig_texture, const std::string &overlay_texture, const std::string &name, int x, int y, int width, int height, Real widthmult, Real heightmult, bool enable_force=false, bool force_mode=false) |
void | FreeTextureImages () |
int | GetTextureCount () |
int | GetMaterialCount () |
bool | GetTextureMapping (PolyArray &vertices, Vector3 &v1, Vector3 &v2, Vector3 &v3, int &direction) |
void | SetPlanarMapping (bool flat, bool FlipX, bool FlipY, bool FlipZ, bool rotate) |
void | GetPlanarMapping (bool &flat, bool &FlipX, bool &FlipY, bool &FlipZ, bool &rotate) |
Vector2 | CalculateSizing (const std::string &texture, const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, int direction, Real tw, Real th) |
Ogre::TexturePtr | loadChromaKeyedTexture (const std::string &filename, const std::string &resGroup, const std::string &name, const Ogre::ColourValue &keyCol=Ogre::ColourValue::Black, int numMipmaps=-1, Real threshold=0.003) |
void | SaveTexture (Ogre::TexturePtr texture, const std::string &filename) |
std::string | ListTextures (bool show_filename=false) |
void | IncrementTextureCount () |
void | DecrementTextureCount () |
void | IncrementMaterialCount () |
void | DecrementMaterialCount () |
void | RegisterTextureInfo (const std::string &name, const std::string &material_name, const std::string &filename, Real widthmult, Real heightmult, bool enable_force, bool force_mode, size_t tex_size, size_t mat_size) |
bool | UnregisterTextureInfo (std::string name, std::string material_name="") |
Ogre::MaterialPtr | CreateMaterial (const std::string &name, const std::string &path) |
Ogre::MaterialPtr | GetMaterialByName (const std::string &name, const std::string &group="General") |
Ogre::TextureUnitState * | BindTextureToMaterial (Ogre::MaterialPtr mMat, std::string texture_name, bool has_alpha) |
Ogre::TextureUnitState * | GetTextureUnitState (Ogre::MaterialPtr mMat) |
std::string | GetTextureName (Ogre::MaterialPtr mMat) |
Ogre::TexturePtr | GetTextureByName (const std::string &name, const std::string &group="General") |
std::string | GetTextureMaterial (const std::string &name, bool &result, bool report=true, const std::string &polygon_name="") |
void | CopyTexture (Ogre::TexturePtr source, Ogre::TexturePtr destination) |
void | CopyTexture (Ogre::TexturePtr source, Ogre::TexturePtr destination, const Ogre::Box &srcBox, const Ogre::Box &dstBox) |
void | FreeTextureBoxes () |
void | SetPlanarRotate (bool value) |
bool | GetPlanarRotate () |
bool | ComputeTextureMap (Matrix3 &t_matrix, Vector3 &t_vector, PolyArray &vertices, const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, Real tw, Real th) |
void | EnableLighting (const std::string &material_name, bool value) |
void | EnableShadows (const std::string &material_name, bool value) |
int | GetTextureInfoCount () |
bool | GetTextureInfo (int index, TextureInfo &info) |
bool | SetTextureInfo (int index, TextureInfo &info) |
void | IncrementTextureUsage (const std::string &name) |
void | DecrementTextureUsage (const std::string &name) |
void | SetCulling (const std::string &material_name, int mode=1) |
Ogre::MaterialPtr | SetCulling (const std::string &material_name, const std::string &name, int mode) |
size_t | GetMemoryUsage () |
bool | GetTextureImage (Ogre::TexturePtr texture) |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
virtual void | Report (const std::string &message) |
virtual bool | ReportError (const std::string &message) |
Public Attributes | |
bool | TextureOverride |
bool | FlipTexture |
std::string | mainnegtex |
std::string | mainpostex |
std::string | sidenegtex |
std::string | sidepostex |
std::string | toptex |
std::string | bottomtex |
int | mainnegflip |
int | mainposflip |
int | sidenegflip |
int | sideposflip |
int | topflip |
int | bottomflip |
std::vector< Real > | widthscale |
std::vector< Real > | heightscale |
Private Member Functions | |
void | BackupMapping () |
bool | WriteToTexture (const std::string &str, Ogre::TexturePtr destTexture, int destLeft, int destTop, int destRight, int destBottom, Ogre::FontPtr font, const Ogre::ColourValue &color, char justify='l', char vert_justify='t', bool wordwrap=true) |
Ogre::TexturePtr | LoadTexture (const std::string &filename, int mipmaps, bool &has_alpha, bool use_alpha_color=false, Ogre::ColourValue alpha_color=Ogre::ColourValue::Black) |
void | UnloadMaterials () |
bool | ComputeTextureSpace (Matrix3 &m, Vector3 &v, const Vector3 &v_orig, const Vector3 &v1, Real len1, const Vector3 &v2, Real len2) |
Private Attributes | |
std::vector< int > | MapIndex |
std::vector< int > | OldMapIndex |
std::vector< Vector2 > | MapUV |
std::vector< Vector2 > | OldMapUV |
std::vector< std::string > | MapVerts1 |
std::vector< std::string > | MapVerts2 |
std::vector< std::string > | MapVerts3 |
std::vector< std::string > | OldMapVerts1 |
std::vector< std::string > | OldMapVerts2 |
std::vector< std::string > | OldMapVerts3 |
bool | AutoX |
bool | AutoY |
int | MapMethod |
int | OldMapMethod |
bool | RevX |
bool | RevY |
bool | RevZ |
bool | OldRevX |
bool | OldRevY |
bool | OldRevZ |
bool | PlanarFlat |
bool | OldPlanarFlat |
bool | PlanarRotate |
bool | OldPlanarRotate |
int | DefaultMapper |
std::vector< TextureInfo > | textureinfo |
std::vector< Ogre::TexturePtr > | manual_textures |
int | texturecount |
int | materialcount |
std::vector< TexturePixelBox > | textureboxes |
std::string | prev_material |
Additional Inherited Members | |
![]() | |
SBS * | sbs |
SBS::TextureManager::TextureManager | ( | Object * | parent | ) |
Definition at line 41 of file texture.cpp.
References AutoX, AutoY, bottomflip, DefaultMapper, FlipTexture, SBS::SBS::GetConfigInt(), heightscale, LoadTexture(), mainnegflip, mainposflip, MapIndex, MapMethod, MapUV, MapVerts1, MapVerts2, MapVerts3, materialcount, OldMapIndex, OldMapMethod, OldMapUV, OldMapVerts1, OldMapVerts2, OldMapVerts3, OldPlanarFlat, OldPlanarRotate, OldRevX, OldRevY, OldRevZ, PlanarFlat, PlanarRotate, SBS::ObjectBase::Report(), SBS::SBS::ResetLighting(), ResetTextureMapping(), RevX, RevY, RevZ, SBS::ObjectBase::sbs, SBS::SBS::SetLighting(), SBS::ObjectBase::SetName(), sidenegflip, sideposflip, texturecount, TextureOverride, topflip, and widthscale.
SBS::TextureManager::~TextureManager | ( | ) |
Definition at line 103 of file texture.cpp.
References FreeTextureBoxes(), manual_textures, textureboxes, textureinfo, and UnloadMaterials().
bool SBS::TextureManager::AddTextToTexture | ( | const std::string & | origname, |
const std::string & | name, | ||
const std::string & | font_filename, | ||
Real | font_size, | ||
const std::string & | text, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
const std::string & | h_align, | ||
const std::string & | v_align, | ||
int | ColorR, | ||
int | ColorG, | ||
int | ColorB, | ||
bool | enable_force = false, | ||
bool | force_mode = false ) |
Definition at line 658 of file texture.cpp.
References BindTextureToMaterial(), SBS::SBS::CacheFilename(), CopyTexture(), CreateMaterial(), GetMaterialByName(), GetTextureByName(), GetTextureName(), GetTextureTiling(), IncrementTextureCount(), SBS::SBS::InstanceNumber, manual_textures, SBS::ObjectBase::Name, RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::ToString(), SBS::TrimString(), SBS::TrimStringCopy(), SBS::SBS::Verbose, SBS::SBS::VerifyFile(), and WriteToTexture().
bool SBS::TextureManager::AddTextureOverlay | ( | const std::string & | orig_texture, |
const std::string & | overlay_texture, | ||
const std::string & | name, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false ) |
Definition at line 814 of file texture.cpp.
References BindTextureToMaterial(), CopyTexture(), CreateMaterial(), GetMaterialByName(), GetTextureByName(), GetTextureName(), IncrementTextureCount(), SBS::SBS::InstanceNumber, manual_textures, SBS::ObjectBase::Name, RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::ToString(), and SBS::SBS::Verbose.
Real SBS::TextureManager::AutoSize | ( | Real | n1, |
Real | n2, | ||
bool | iswidth, | ||
Real | offset, | ||
bool | enable_force, | ||
bool | force_mode ) |
Definition at line 1052 of file texture.cpp.
Referenced by CalculateSizing().
|
private |
Definition at line 1539 of file texture.cpp.
References MapIndex, MapMethod, MapUV, MapVerts1, OldMapIndex, OldMapMethod, OldMapUV, OldMapVerts1, OldPlanarFlat, OldPlanarRotate, OldRevX, OldRevY, OldRevZ, PlanarFlat, PlanarRotate, RevX, RevY, and RevZ.
Referenced by SetPlanarMapping(), SetTextureMapping(), and SetTextureMapping2().
Ogre::TextureUnitState * SBS::TextureManager::BindTextureToMaterial | ( | Ogre::MaterialPtr | mMat, |
std::string | texture_name, | ||
bool | has_alpha ) |
Definition at line 2235 of file texture.cpp.
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), LoadAlphaBlendTexture(), LoadAnimatedTexture(), LoadTexture(), and LoadTextureCropped().
Vector2 SBS::TextureManager::CalculateSizing | ( | const std::string & | texture, |
const Vector3 & | v1, | ||
const Vector3 & | v2, | ||
const Vector3 & | v3, | ||
int | direction, | ||
Real | tw, | ||
Real | th ) |
Definition at line 1089 of file texture.cpp.
References AutoSize(), and GetTextureForce().
Referenced by SBS::PolyMesh::CreateMesh().
bool SBS::TextureManager::ComputeTextureMap | ( | Matrix3 & | t_matrix, |
Vector3 & | t_vector, | ||
PolyArray & | vertices, | ||
const Vector3 & | p1, | ||
const Vector3 & | p2, | ||
const Vector3 & | p3, | ||
Real | tw, | ||
Real | th ) |
Definition at line 36 of file texmap.cpp.
References ComputeTextureSpace(), MapUV, SBS::ObjectBase::ReportError(), SBS::Round(), and SMALL_EPSILON.
Referenced by SBS::PolyMesh::CreateMesh().
|
private |
Calculate the matrix using two vertices (which are preferably on the plane of the polygon and are possibly (but not necessarily) two vertices of the polygon). The first vertex is seen as the origin and the second as the u-axis of the texture space coordinate system. The v-axis is calculated on the plane of the polygon and orthogonal to the given u-axis. The length of the u-axis and the v-axis is given as the 'len1' parameter.
For example, if 'len1' is equal to 2 this means that texture will be tiled exactly two times between vertex 'v_orig' and 'v1'. I hope this explanation is clear since I can't seem to make it any clearer :-)
Use 'v1' and 'len1' for the u-axis and 'v2' and 'len2' for the v-axis.
Definition at line 137 of file texmap.cpp.
Referenced by ComputeTextureMap().
void SBS::TextureManager::CopyTexture | ( | Ogre::TexturePtr | source, |
Ogre::TexturePtr | destination ) |
Definition at line 2289 of file texture.cpp.
References CopyTexture().
Referenced by AddTextToTexture(), AddTextureOverlay(), CopyTexture(), and LoadTextureCropped().
void SBS::TextureManager::CopyTexture | ( | Ogre::TexturePtr | source, |
Ogre::TexturePtr | destination, | ||
const Ogre::Box & | srcBox, | ||
const Ogre::Box & | dstBox ) |
Definition at line 2299 of file texture.cpp.
References SBS::SBS::mRoot, SBS::ObjectBase::ReportError(), and SBS::ObjectBase::sbs.
Ogre::MaterialPtr SBS::TextureManager::CreateMaterial | ( | const std::string & | name, |
const std::string & | path ) |
Definition at line 2178 of file texture.cpp.
References EnableLighting(), EnableShadows(), IncrementMaterialCount(), SBS::SBS::InstanceNumber, SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::ToString(), UnloadMaterial(), and UnregisterTextureInfo().
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), LoadAlphaBlendTexture(), LoadAnimatedTexture(), LoadTexture(), and LoadTextureCropped().
void SBS::TextureManager::DecrementMaterialCount | ( | ) |
Definition at line 2093 of file texture.cpp.
References materialcount.
Referenced by UnloadMaterial().
void SBS::TextureManager::DecrementTextureCount | ( | ) |
Definition at line 2083 of file texture.cpp.
References texturecount.
Referenced by UnloadTexture().
void SBS::TextureManager::DecrementTextureUsage | ( | const std::string & | name | ) |
Definition at line 1660 of file texture.cpp.
References textureinfo.
Referenced by SBS::Polygon::ChangeTexture(), SBS::Polygon::ReplaceTexture(), and SBS::Polygon::~Polygon().
void SBS::TextureManager::EnableLighting | ( | const std::string & | material_name, |
bool | value ) |
Definition at line 2207 of file texture.cpp.
References SBS::SBS::AmbientB, SBS::SBS::AmbientG, SBS::SBS::AmbientR, SBS::SBS::GetConfigBool(), GetMaterialByName(), and SBS::ObjectBase::sbs.
Referenced by SBS::ButtonPanel::AddButton(), SBS::CallStation::CreateCallButtons(), CreateMaterial(), SBS::DirectionalIndicator::DirectionalIndicator(), SBS::FloorIndicator::FloorIndicator(), SBS::FloorIndicator::Update(), and SBS::Indicator::Update().
void SBS::TextureManager::EnableShadows | ( | const std::string & | material_name, |
bool | value ) |
Definition at line 2364 of file texture.cpp.
References GetMaterialByName().
Referenced by CreateMaterial().
void SBS::TextureManager::FreeTextureBoxes | ( | ) |
Definition at line 2342 of file texture.cpp.
References textureboxes.
Referenced by Skyscraper::ScriptProcessor::Run(), and ~TextureManager().
void SBS::TextureManager::FreeTextureImages | ( | ) |
Definition at line 1044 of file texture.cpp.
Referenced by Skyscraper::ScriptProcessor::TexturesSection::Run().
void SBS::TextureManager::GetAutoSize | ( | bool & | x, |
bool & | y ) |
Definition at line 1082 of file texture.cpp.
Referenced by SBS::ElevatorCar::AddElevatorIDSigns(), SBS::ElevatorCar::AddFloorSigns(), and SBS::Elevator::CreateCounterweight().
Ogre::MaterialPtr SBS::TextureManager::GetMaterialByName | ( | const std::string & | name, |
const std::string & | group = "General" ) |
Definition at line 2224 of file texture.cpp.
References SBS::SBS::InstanceNumber, SBS::ObjectBase::sbs, and SBS::ToString().
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), SBS::DynamicMesh::Mesh::ChangeTexture(), EnableLighting(), EnableShadows(), GetTextureMaterial(), Skyscraper::TextureManager::GetTextureName(), LoadMaterial(), RotateAnimTexture(), RotateTexture(), ScaleTexture(), ScrollAnimTexture(), ScrollTexture(), SetCulling(), SBS::DynamicMesh::Mesh::SetMaterial(), TransformTexture(), and UnloadMaterial().
int SBS::TextureManager::GetMaterialCount | ( | ) |
Definition at line 1038 of file texture.cpp.
References materialcount.
Referenced by Skyscraper::Stats::Loop().
size_t SBS::TextureManager::GetMemoryUsage | ( | ) |
Definition at line 2396 of file texture.cpp.
References textureinfo.
void SBS::TextureManager::GetPlanarMapping | ( | bool & | flat, |
bool & | FlipX, | ||
bool & | FlipY, | ||
bool & | FlipZ, | ||
bool & | rotate ) |
Definition at line 1488 of file texture.cpp.
References PlanarFlat, PlanarRotate, RevX, RevY, and RevZ.
bool SBS::TextureManager::GetPlanarRotate | ( | ) |
Definition at line 2359 of file texture.cpp.
References PlanarRotate.
Ogre::TexturePtr SBS::TextureManager::GetTextureByName | ( | const std::string & | name, |
const std::string & | group = "General" ) |
Definition at line 2268 of file texture.cpp.
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), LoadTexture(), UnloadTexture(), and WriteToTexture().
int SBS::TextureManager::GetTextureCount | ( | ) |
Definition at line 1032 of file texture.cpp.
References texturecount.
bool SBS::TextureManager::GetTextureForce | ( | const std::string & | texture, |
bool & | enable_force, | ||
bool & | force_mode ) |
Definition at line 1017 of file texture.cpp.
References textureinfo.
Referenced by CalculateSizing().
bool SBS::TextureManager::GetTextureImage | ( | Ogre::TexturePtr | texture | ) |
Definition at line 2069 of file texture.cpp.
References SaveTexture().
Referenced by Skyscraper::TextureManager::On_TextureList_Select().
bool SBS::TextureManager::GetTextureInfo | ( | int | index, |
TextureManager::TextureInfo & | info ) |
Definition at line 1626 of file texture.cpp.
References textureinfo.
Referenced by Skyscraper::TextureManager::Loop(), Skyscraper::TextureManager::On_bExport_Click(), Skyscraper::TextureManager::On_bSave_Click(), Skyscraper::TextureManager::On_bUnload_Click(), and Skyscraper::TextureManager::On_TextureList_Select().
int SBS::TextureManager::GetTextureInfoCount | ( | ) |
Definition at line 1621 of file texture.cpp.
References textureinfo.
Referenced by Skyscraper::TextureManager::Loop().
bool SBS::TextureManager::GetTextureMapping | ( | PolyArray & | vertices, |
Vector3 & | v1, | ||
Vector3 & | v2, | ||
Vector3 & | v3, | ||
int & | direction ) |
Definition at line 1109 of file texture.cpp.
References SBS::Utility::ComputePlane(), SBS::Utility::GetExtents(), SBS::SBS::GetUtility(), MapIndex, MapMethod, MapVerts1, MapVerts2, MapVerts3, PlanarFlat, PlanarRotate, SBS::ReplaceAll(), RevX, RevY, RevZ, SBS::ObjectBase::sbs, SBS::SetCase(), SBS::ToFloat(), SBS::ToInt(), and SBS::ToString().
Referenced by SBS::PolyMesh::CreateMesh().
std::string SBS::TextureManager::GetTextureMaterial | ( | const std::string & | name, |
bool & | result, | ||
bool | report = true, | ||
const std::string & | polygon_name = "" ) |
Definition at line 906 of file texture.cpp.
References GetMaterialByName(), prev_material, SBS::ObjectBase::ReportError(), and textureinfo.
Referenced by SBS::Wall::AddPolygon(), SBS::PolyMesh::CreateMesh(), RotateAnimTexture(), RotateTexture(), ScaleTexture(), ScrollAnimTexture(), ScrollTexture(), and TransformTexture().
std::string SBS::TextureManager::GetTextureName | ( | Ogre::MaterialPtr | mMat | ) |
Definition at line 2257 of file texture.cpp.
References GetTextureUnitState().
Referenced by AddTextToTexture(), AddTextureOverlay(), and WriteToTexture().
Definition at line 1002 of file texture.cpp.
References textureinfo.
Referenced by AddTextToTexture(), and SBS::PolyMesh::CreateMesh().
Ogre::TextureUnitState * SBS::TextureManager::GetTextureUnitState | ( | Ogre::MaterialPtr | mMat | ) |
Definition at line 2251 of file texture.cpp.
Referenced by GetTextureName(), RotateAnimTexture(), RotateTexture(), ScaleTexture(), ScrollAnimTexture(), ScrollTexture(), and TransformTexture().
void SBS::TextureManager::IncrementMaterialCount | ( | ) |
Definition at line 2088 of file texture.cpp.
References materialcount.
Referenced by CreateMaterial().
void SBS::TextureManager::IncrementTextureCount | ( | ) |
Definition at line 2078 of file texture.cpp.
References texturecount.
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), loadChromaKeyedTexture(), LoadTexture(), and LoadTextureCropped().
void SBS::TextureManager::IncrementTextureUsage | ( | const std::string & | name | ) |
Definition at line 1648 of file texture.cpp.
References SBS::TextureManager::TextureInfo::dependencies, and textureinfo.
Referenced by SBS::Polygon::ChangeTexture(), SBS::Polygon::Polygon(), and SBS::Polygon::ReplaceTexture().
std::string SBS::TextureManager::ListTextures | ( | bool | show_filename = false | ) |
Definition at line 1600 of file texture.cpp.
References textureinfo.
Referenced by Skyscraper::ParameterViewer::On_bTextures_Click().
bool SBS::TextureManager::LoadAlphaBlendTexture | ( | const std::string & | filename, |
const std::string & | specular_filename, | ||
const std::string & | blend_filename, | ||
const std::string & | name, | ||
bool | spherical, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false, | ||
int | mipmaps = -1, | ||
bool | use_alpha_color = false, | ||
Ogre::ColourValue | alpha_color = Ogre::ColourValue::Black ) |
Definition at line 221 of file texture.cpp.
References BindTextureToMaterial(), CreateMaterial(), LoadTexture(), RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::TrimStringCopy(), SBS::SBS::Verbose, and SBS::SBS::VerifyFile().
bool SBS::TextureManager::LoadAnimatedTexture | ( | std::vector< std::string > | filenames, |
const std::string & | name, | ||
Real | duration, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false, | ||
int | mipmaps = -1, | ||
bool | use_alpha_color = false, | ||
Ogre::ColourValue | alpha_color = Ogre::ColourValue::Black ) |
Definition at line 157 of file texture.cpp.
References BindTextureToMaterial(), CreateMaterial(), LoadTexture(), RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::sbs, SBS::ToString(), SBS::TrimString(), SBS::TrimStringCopy(), SBS::SBS::Verbose, and SBS::SBS::VerifyFile().
Ogre::TexturePtr SBS::TextureManager::loadChromaKeyedTexture | ( | const std::string & | filename, |
const std::string & | resGroup, | ||
const std::string & | name, | ||
const Ogre::ColourValue & | keyCol = Ogre::ColourValue::Black, | ||
int | numMipmaps = -1, | ||
Real | threshold = 0.003 ) |
Utility function that generates a texture with transparency based on a certain colour value
filename | The name of the image file this texture will be based on, residing in resGroup |
keyCol | The colour value which should cause transparency (alpha component is ignored) |
resGroup | The resource group the base image file belongs and the generated texture will belong to |
prefix | The generated texture will be accessible via the name prefix+filename |
numMipmaps | Usually you leave that on default, but if you never intend to scale the texture, you can set it to 0 |
threshold | If the difference between the pixel colour of the image and keyCol is less than this, it gets transparent. It should be between 0 and 1. The default value is less than (1 / 256), which means that for an 8 Bit channels input file, only the EXACT keyCol gets transparent. |
Definition at line 1693 of file texture.cpp.
References IncrementTextureCount(), and SBS::SetCase().
Referenced by LoadTexture().
bool SBS::TextureManager::LoadMaterial | ( | const std::string & | filename, |
const std::string & | name, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false ) |
Definition at line 280 of file texture.cpp.
References GetMaterialByName(), RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.
bool SBS::TextureManager::LoadTexture | ( | const std::string & | filename, |
const std::string & | name, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false, | ||
int | mipmaps = -1, | ||
bool | use_alpha_color = false, | ||
Ogre::ColourValue | alpha_color = Ogre::ColourValue::Black ) |
Definition at line 123 of file texture.cpp.
References BindTextureToMaterial(), CreateMaterial(), LoadTexture(), RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::sbs, SBS::ToString(), SBS::TrimStringCopy(), SBS::SBS::Verbose, and SBS::SBS::VerifyFile().
Referenced by LoadAlphaBlendTexture(), LoadAnimatedTexture(), LoadTexture(), LoadTextureCropped(), and TextureManager().
|
private |
Definition at line 2098 of file texture.cpp.
References SBS::SBS::GetMountPath(), GetTextureByName(), IncrementTextureCount(), loadChromaKeyedTexture(), SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::SetCase(), and SBS::SBS::Verbose.
bool SBS::TextureManager::LoadTextureCropped | ( | const std::string & | filename, |
const std::string & | name, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force = false, | ||
bool | force_mode = false ) |
Definition at line 374 of file texture.cpp.
References BindTextureToMaterial(), CopyTexture(), CreateMaterial(), IncrementTextureCount(), SBS::SBS::InstanceNumber, LoadTexture(), manual_textures, RegisterTextureInfo(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), SBS::ObjectBase::sbs, SBS::ToString(), SBS::SBS::Verbose, and SBS::SBS::VerifyFile().
Definition at line 959 of file texture.cpp.
References bottomflip, FlipTexture, heightscale, mainnegflip, mainposflip, sidenegflip, sideposflip, topflip, and widthscale.
void SBS::TextureManager::RegisterTextureInfo | ( | const std::string & | name, |
const std::string & | material_name, | ||
const std::string & | filename, | ||
Real | widthmult, | ||
Real | heightmult, | ||
bool | enable_force, | ||
bool | force_mode, | ||
size_t | tex_size, | ||
size_t | mat_size ) |
Definition at line 303 of file texture.cpp.
References SBS::TextureManager::TextureInfo::dependencies, SBS::TextureManager::TextureInfo::enable_force, SBS::TextureManager::TextureInfo::filename, SBS::TextureManager::TextureInfo::force_mode, SBS::TextureManager::TextureInfo::heightmult, SBS::TextureManager::TextureInfo::mat_size, SBS::TextureManager::TextureInfo::material_name, SBS::TextureManager::TextureInfo::name, SBS::TextureManager::TextureInfo::tex_size, textureinfo, SBS::TrimStringCopy(), and SBS::TextureManager::TextureInfo::widthmult.
Referenced by AddTextToTexture(), AddTextureOverlay(), SBS::CameraTexture::CameraTexture(), LoadAlphaBlendTexture(), LoadAnimatedTexture(), LoadMaterial(), LoadTexture(), and LoadTextureCropped().
void SBS::TextureManager::ResetTextureMapping | ( | bool | todefaults = false | ) |
Definition at line 1444 of file texture.cpp.
References DefaultMapper, OldMapIndex, OldMapMethod, OldMapUV, OldMapVerts1, OldMapVerts2, OldMapVerts3, OldPlanarFlat, OldPlanarRotate, OldRevX, OldRevY, OldRevZ, SetPlanarMapping(), SetTextureMapping(), and SetTextureMapping2().
Referenced by SBS::Door::AddDoorComponent(), SBS::ElevatorDoor::AddDoorComponent(), SBS::Stairwell::Level::AddStairs(), SBS::ButtonPanel::ButtonPanel(), SBS::Escalator::CreateSteps(), SBS::MovingWalkway::CreateSteps(), SBS::DirectionalIndicator::DirectionalIndicator(), SBS::ElevatorDoor::FinishDoors(), SBS::RevolvingDoor::RevolvingDoor(), and TextureManager().
bool SBS::TextureManager::RotateAnimTexture | ( | const std::string & | name, |
Real | speed ) |
Definition at line 476 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().
bool SBS::TextureManager::RotateTexture | ( | const std::string & | name, |
Real | angle ) |
Definition at line 447 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().
void SBS::TextureManager::SaveTexture | ( | Ogre::TexturePtr | texture, |
const std::string & | filename ) |
Definition at line 2060 of file texture.cpp.
Referenced by GetTextureImage(), and Skyscraper::TextureManager::On_bExport_Click().
Definition at line 563 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().
bool SBS::TextureManager::ScrollAnimTexture | ( | const std::string & | name, |
Real | x_speed, | ||
Real | y_speed ) |
Definition at line 534 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().
Definition at line 505 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().
void SBS::TextureManager::SetAutoSize | ( | bool | x, |
bool | y ) |
Definition at line 1075 of file texture.cpp.
Referenced by SBS::ElevatorCar::AddElevatorIDSigns(), SBS::ElevatorCar::AddFloorSigns(), and SBS::Elevator::CreateCounterweight().
Ogre::MaterialPtr SBS::TextureManager::SetCulling | ( | const std::string & | material_name, |
const std::string & | name, | ||
int | mode ) |
void SBS::TextureManager::SetCulling | ( | const std::string & | material_name, |
int | mode = 1 ) |
Definition at line 2373 of file texture.cpp.
References GetMaterialByName(), and SBS::ObjectBase::ReportError().
void SBS::TextureManager::SetPlanarMapping | ( | bool | flat, |
bool | FlipX, | ||
bool | FlipY, | ||
bool | FlipZ, | ||
bool | rotate ) |
Definition at line 1467 of file texture.cpp.
References BackupMapping(), MapMethod, MapUV, PlanarFlat, PlanarRotate, RevX, RevY, and RevZ.
Referenced by ResetTextureMapping().
void SBS::TextureManager::SetPlanarRotate | ( | bool | value | ) |
Definition at line 2354 of file texture.cpp.
References PlanarRotate.
void SBS::TextureManager::SetTextureFlip | ( | int | mainneg, |
int | mainpos, | ||
int | sideneg, | ||
int | sidepos, | ||
int | top, | ||
int | bottom ) |
Definition at line 1569 of file texture.cpp.
References bottomflip, FlipTexture, mainnegflip, mainposflip, sidenegflip, sideposflip, and topflip.
Referenced by SBS::Door::AddDoorComponent(), and SBS::RevolvingDoor::RevolvingDoor().
bool SBS::TextureManager::SetTextureInfo | ( | int | index, |
TextureManager::TextureInfo & | info ) |
Definition at line 1637 of file texture.cpp.
References textureinfo.
Referenced by Skyscraper::TextureManager::On_bSave_Click().
void SBS::TextureManager::SetTextureMapping | ( | int | vertindex1, |
Vector2 | uv1, | ||
int | vertindex2, | ||
Vector2 | uv2, | ||
int | vertindex3, | ||
Vector2 | uv3 ) |
Definition at line 1501 of file texture.cpp.
References BackupMapping(), MapIndex, MapMethod, and MapUV.
Referenced by ResetTextureMapping().
void SBS::TextureManager::SetTextureMapping2 | ( | const std::string & | x1, |
const std::string & | y1, | ||
const std::string & | z1, | ||
Vector2 | uv1, | ||
const std::string & | x2, | ||
const std::string & | y2, | ||
const std::string & | z2, | ||
Vector2 | uv2, | ||
const std::string & | x3, | ||
const std::string & | y3, | ||
const std::string & | z3, | ||
Vector2 | uv3 ) |
Definition at line 1517 of file texture.cpp.
References BackupMapping(), MapMethod, MapUV, MapVerts1, MapVerts2, and MapVerts3.
Referenced by ResetTextureMapping().
void SBS::TextureManager::SetTextureOverride | ( | const std::string & | mainneg, |
const std::string & | mainpos, | ||
const std::string & | sideneg, | ||
const std::string & | sidepos, | ||
const std::string & | top, | ||
const std::string & | bottom ) |
Definition at line 1587 of file texture.cpp.
References bottomtex, mainnegtex, mainpostex, sidenegtex, sidepostex, TextureOverride, toptex, and SBS::TrimStringCopy().
bool SBS::TextureManager::TransformTexture | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | wave_type, | ||
Real | base, | ||
Real | frequency, | ||
Real | phase, | ||
Real | amplitude ) |
Definition at line 592 of file texture.cpp.
References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), SBS::SetCase(), and SBS::TrimStringCopy().
bool SBS::TextureManager::UnloadMaterial | ( | const std::string & | name, |
const std::string & | group ) |
Definition at line 359 of file texture.cpp.
References DecrementMaterialCount(), GetMaterialByName(), and SBS::ObjectBase::Report().
Referenced by CreateMaterial(), Skyscraper::TextureManager::On_bUnload_Click(), and SBS::CameraTexture::~CameraTexture().
|
private |
Definition at line 2279 of file texture.cpp.
References SBS::SBS::InstanceNumber, SBS::ObjectBase::sbs, textureinfo, and SBS::ToString().
Referenced by ~TextureManager().
bool SBS::TextureManager::UnloadTexture | ( | const std::string & | name, |
const std::string & | group ) |
Definition at line 344 of file texture.cpp.
References DecrementTextureCount(), GetTextureByName(), and SBS::ObjectBase::Report().
Referenced by SBS::CameraTexture::~CameraTexture().
bool SBS::TextureManager::UnregisterTextureInfo | ( | std::string | name, |
std::string | material_name = "" ) |
Definition at line 328 of file texture.cpp.
References textureinfo, and SBS::TrimString().
Referenced by CreateMaterial(), Skyscraper::TextureManager::On_bUnload_Click(), and SBS::CameraTexture::~CameraTexture().
|
private |
Definition at line 1809 of file texture.cpp.
References GetTextureByName(), GetTextureName(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), and textureboxes.
Referenced by AddTextToTexture().
|
private |
Definition at line 147 of file texture.h.
Referenced by AutoSize(), GetAutoSize(), SetAutoSize(), and TextureManager().
|
private |
Definition at line 147 of file texture.h.
Referenced by AutoSize(), GetAutoSize(), SetAutoSize(), and TextureManager().
int SBS::TextureManager::bottomflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::bottomtex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
|
private |
Definition at line 154 of file texture.h.
Referenced by ResetTextureMapping(), and TextureManager().
bool SBS::TextureManager::FlipTexture |
Definition at line 40 of file texture.h.
Referenced by ProcessTextureFlip(), Skyscraper::ScriptProcessor::Run(), SetTextureFlip(), and TextureManager().
std::vector<Real> SBS::TextureManager::heightscale |
Definition at line 117 of file texture.h.
Referenced by ProcessTextureFlip(), and TextureManager().
int SBS::TextureManager::mainnegflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::mainnegtex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
int SBS::TextureManager::mainposflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::mainpostex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
|
private |
Definition at line 163 of file texture.h.
Referenced by AddTextToTexture(), AddTextureOverlay(), LoadTextureCropped(), and ~TextureManager().
|
private |
Definition at line 137 of file texture.h.
Referenced by BackupMapping(), GetTextureMapping(), SetTextureMapping(), and TextureManager().
|
private |
Definition at line 148 of file texture.h.
Referenced by BackupMapping(), GetTextureMapping(), SetPlanarMapping(), SetTextureMapping(), SetTextureMapping2(), and TextureManager().
|
private |
Definition at line 139 of file texture.h.
Referenced by BackupMapping(), ComputeTextureMap(), SetPlanarMapping(), SetTextureMapping(), SetTextureMapping2(), and TextureManager().
|
private |
Definition at line 141 of file texture.h.
Referenced by BackupMapping(), GetTextureMapping(), SetTextureMapping2(), and TextureManager().
|
private |
Definition at line 142 of file texture.h.
Referenced by GetTextureMapping(), SetTextureMapping2(), and TextureManager().
|
private |
Definition at line 143 of file texture.h.
Referenced by GetTextureMapping(), SetTextureMapping2(), and TextureManager().
|
private |
Definition at line 167 of file texture.h.
Referenced by DecrementMaterialCount(), GetMaterialCount(), IncrementMaterialCount(), and TextureManager().
|
private |
Definition at line 138 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 149 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 140 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 144 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 145 of file texture.h.
Referenced by ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 146 of file texture.h.
Referenced by ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 152 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 153 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 151 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 151 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 151 of file texture.h.
Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().
|
private |
Definition at line 152 of file texture.h.
Referenced by BackupMapping(), GetPlanarMapping(), GetTextureMapping(), SetPlanarMapping(), and TextureManager().
|
private |
Definition at line 153 of file texture.h.
Referenced by BackupMapping(), GetPlanarMapping(), GetPlanarRotate(), GetTextureMapping(), SetPlanarMapping(), SetPlanarRotate(), and TextureManager().
|
private |
Definition at line 178 of file texture.h.
Referenced by GetTextureMaterial().
|
private |
Definition at line 150 of file texture.h.
Referenced by BackupMapping(), GetPlanarMapping(), GetTextureMapping(), SetPlanarMapping(), and TextureManager().
|
private |
Definition at line 150 of file texture.h.
Referenced by BackupMapping(), GetPlanarMapping(), GetTextureMapping(), SetPlanarMapping(), and TextureManager().
|
private |
Definition at line 150 of file texture.h.
Referenced by BackupMapping(), GetPlanarMapping(), GetTextureMapping(), SetPlanarMapping(), and TextureManager().
int SBS::TextureManager::sidenegflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::sidenegtex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
int SBS::TextureManager::sideposflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::sidepostex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
|
private |
Definition at line 175 of file texture.h.
Referenced by FreeTextureBoxes(), WriteToTexture(), and ~TextureManager().
|
private |
Definition at line 166 of file texture.h.
Referenced by DecrementTextureCount(), GetTextureCount(), IncrementTextureCount(), and TextureManager().
|
private |
Definition at line 162 of file texture.h.
Referenced by DecrementTextureUsage(), GetMemoryUsage(), GetTextureForce(), GetTextureInfo(), GetTextureInfoCount(), GetTextureMaterial(), GetTextureTiling(), IncrementTextureUsage(), ListTextures(), RegisterTextureInfo(), SetTextureInfo(), UnloadMaterials(), UnregisterTextureInfo(), and ~TextureManager().
bool SBS::TextureManager::TextureOverride |
Definition at line 39 of file texture.h.
Referenced by Skyscraper::ScriptProcessor::Run(), SetTextureOverride(), and TextureManager().
int SBS::TextureManager::topflip |
Definition at line 115 of file texture.h.
Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().
std::string SBS::TextureManager::toptex |
Definition at line 112 of file texture.h.
Referenced by SetTextureOverride().
std::vector<Real> SBS::TextureManager::widthscale |
Definition at line 116 of file texture.h.
Referenced by ProcessTextureFlip(), and TextureManager().