Skyscraper 2.0
SBS::TextureManager Class Reference

#include <texture.h>

Inheritance diagram for SBS::TextureManager:
Collaboration diagram for SBS::TextureManager:

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)
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
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< Realwidthscale
 
std::vector< Realheightscale
 

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< Vector2MapUV
 
std::vector< Vector2OldMapUV
 
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< TextureInfotextureinfo
 
std::vector< Ogre::TexturePtr > manual_textures
 
int texturecount
 
int materialcount
 
std::vector< TexturePixelBoxtextureboxes
 
std::string prev_material
 

Additional Inherited Members

- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 33 of file texture.h.

Constructor & Destructor Documentation

◆ TextureManager()

◆ ~TextureManager()

SBS::TextureManager::~TextureManager ( )

Definition at line 103 of file texture.cpp.

References FreeTextureBoxes(), manual_textures, textureboxes, textureinfo, and UnloadMaterials().

Here is the call graph for this function:

Member Function Documentation

◆ AddTextToTexture()

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 )

◆ AddTextureOverlay()

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 )

◆ AutoSize()

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.

References AutoX, and AutoY.

Referenced by CalculateSizing().

◆ BackupMapping()

void SBS::TextureManager::BackupMapping ( )
private

◆ BindTextureToMaterial()

Ogre::TextureUnitState * SBS::TextureManager::BindTextureToMaterial ( Ogre::MaterialPtr mMat,
std::string texture_name,
bool has_alpha )

◆ CalculateSizing()

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().

Here is the call graph for this function:

◆ ComputeTextureMap()

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().

Here is the call graph for this function:

◆ ComputeTextureSpace()

bool SBS::TextureManager::ComputeTextureSpace ( Matrix3 & m,
Vector3 & v,
const Vector3 & v_orig,
const Vector3 & v1,
Real len1,
const Vector3 & v2,
Real len2 )
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().

◆ CopyTexture() [1/2]

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().

Here is the call graph for this function:

◆ CopyTexture() [2/2]

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.

Here is the call graph for this function:

◆ CreateMaterial()

Ogre::MaterialPtr SBS::TextureManager::CreateMaterial ( const std::string & name,
const std::string & path )

◆ DecrementMaterialCount()

void SBS::TextureManager::DecrementMaterialCount ( )

Definition at line 2093 of file texture.cpp.

References materialcount.

Referenced by UnloadMaterial().

◆ DecrementTextureCount()

void SBS::TextureManager::DecrementTextureCount ( )

Definition at line 2083 of file texture.cpp.

References texturecount.

Referenced by UnloadTexture().

◆ DecrementTextureUsage()

void SBS::TextureManager::DecrementTextureUsage ( const std::string & name)

◆ EnableLighting()

◆ EnableShadows()

void SBS::TextureManager::EnableShadows ( const std::string & material_name,
bool value )

Definition at line 2364 of file texture.cpp.

References GetMaterialByName().

Referenced by CreateMaterial().

Here is the call graph for this function:

◆ FreeTextureBoxes()

void SBS::TextureManager::FreeTextureBoxes ( )

Definition at line 2342 of file texture.cpp.

References textureboxes.

Referenced by Skyscraper::ScriptProcessor::Run(), and ~TextureManager().

◆ FreeTextureImages()

void SBS::TextureManager::FreeTextureImages ( )

Definition at line 1044 of file texture.cpp.

Referenced by Skyscraper::ScriptProcessor::TexturesSection::Run().

◆ GetAutoSize()

void SBS::TextureManager::GetAutoSize ( bool & x,
bool & y )

◆ GetMaterialByName()

◆ GetMaterialCount()

int SBS::TextureManager::GetMaterialCount ( )

Definition at line 1038 of file texture.cpp.

References materialcount.

Referenced by Skyscraper::Stats::Loop().

◆ GetMemoryUsage()

size_t SBS::TextureManager::GetMemoryUsage ( )

Definition at line 2396 of file texture.cpp.

References textureinfo.

◆ GetPlanarMapping()

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.

◆ GetPlanarRotate()

bool SBS::TextureManager::GetPlanarRotate ( )

Definition at line 2359 of file texture.cpp.

References PlanarRotate.

◆ GetTextureByName()

Ogre::TexturePtr SBS::TextureManager::GetTextureByName ( const std::string & name,
const std::string & group = "General" )

◆ GetTextureCount()

int SBS::TextureManager::GetTextureCount ( )

Definition at line 1032 of file texture.cpp.

References texturecount.

◆ GetTextureForce()

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().

◆ GetTextureImage()

bool SBS::TextureManager::GetTextureImage ( Ogre::TexturePtr texture)

Definition at line 2069 of file texture.cpp.

References SaveTexture().

Referenced by Skyscraper::TextureManager::On_TextureList_Select().

Here is the call graph for this function:

◆ GetTextureInfo()

◆ GetTextureInfoCount()

int SBS::TextureManager::GetTextureInfoCount ( )

Definition at line 1621 of file texture.cpp.

References textureinfo.

Referenced by Skyscraper::TextureManager::Loop().

◆ GetTextureMapping()

bool SBS::TextureManager::GetTextureMapping ( PolyArray & vertices,
Vector3 & v1,
Vector3 & v2,
Vector3 & v3,
int & direction )

◆ GetTextureMaterial()

std::string SBS::TextureManager::GetTextureMaterial ( const std::string & name,
bool & result,
bool report = true,
const std::string & polygon_name = "" )

◆ GetTextureName()

std::string SBS::TextureManager::GetTextureName ( Ogre::MaterialPtr mMat)

Definition at line 2257 of file texture.cpp.

References GetTextureUnitState().

Referenced by AddTextToTexture(), AddTextureOverlay(), and WriteToTexture().

Here is the call graph for this function:

◆ GetTextureTiling()

bool SBS::TextureManager::GetTextureTiling ( const std::string & texture,
Real & tw,
Real & th )

Definition at line 1002 of file texture.cpp.

References textureinfo.

Referenced by AddTextToTexture(), and SBS::PolyMesh::CreateMesh().

◆ GetTextureUnitState()

Ogre::TextureUnitState * SBS::TextureManager::GetTextureUnitState ( Ogre::MaterialPtr mMat)

◆ IncrementMaterialCount()

void SBS::TextureManager::IncrementMaterialCount ( )

Definition at line 2088 of file texture.cpp.

References materialcount.

Referenced by CreateMaterial().

◆ IncrementTextureCount()

void SBS::TextureManager::IncrementTextureCount ( )

◆ IncrementTextureUsage()

void SBS::TextureManager::IncrementTextureUsage ( const std::string & name)

◆ ListTextures()

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().

◆ LoadAlphaBlendTexture()

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 )

◆ LoadAnimatedTexture()

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 )

◆ loadChromaKeyedTexture()

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

Remarks
The generated texture will either have full opacity or full transparency values
Parameters
filenameThe name of the image file this texture will be based on, residing in resGroup
keyColThe colour value which should cause transparency (alpha component is ignored)
resGroupThe resource group the base image file belongs and the generated texture will belong to
prefixThe generated texture will be accessible via the name prefix+filename
numMipmapsUsually you leave that on default, but if you never intend to scale the texture, you can set it to 0
thresholdIf 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.
Returns
Returns the name of the texture resource the generated texture can be addressed by (is prefix+filename)

Definition at line 1693 of file texture.cpp.

References IncrementTextureCount(), and SBS::SetCase().

Referenced by LoadTexture().

Here is the call graph for this function:

◆ LoadMaterial()

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.

Here is the call graph for this function:

◆ LoadTexture() [1/2]

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 )

◆ LoadTexture() [2/2]

Ogre::TexturePtr SBS::TextureManager::LoadTexture ( const std::string & filename,
int mipmaps,
bool & has_alpha,
bool use_alpha_color = false,
Ogre::ColourValue alpha_color = Ogre::ColourValue::Black )
private

◆ LoadTextureCropped()

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 )

◆ ProcessTextureFlip()

void SBS::TextureManager::ProcessTextureFlip ( Real tw,
Real th )

◆ RegisterTextureInfo()

◆ ResetTextureMapping()

◆ RotateAnimTexture()

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().

Here is the call graph for this function:

◆ RotateTexture()

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().

Here is the call graph for this function:

◆ SaveTexture()

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().

◆ ScaleTexture()

bool SBS::TextureManager::ScaleTexture ( const std::string & name,
Real x_scale,
Real y_scale )

Definition at line 563 of file texture.cpp.

References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().

Here is the call graph for this function:

◆ ScrollAnimTexture()

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().

Here is the call graph for this function:

◆ ScrollTexture()

bool SBS::TextureManager::ScrollTexture ( const std::string & name,
Real x_offset,
Real y_offset )

Definition at line 505 of file texture.cpp.

References GetMaterialByName(), GetTextureMaterial(), GetTextureUnitState(), SBS::ObjectBase::ReportError(), and SBS::TrimStringCopy().

Here is the call graph for this function:

◆ SetAutoSize()

void SBS::TextureManager::SetAutoSize ( bool x,
bool y )

◆ SetCulling() [1/2]

Ogre::MaterialPtr SBS::TextureManager::SetCulling ( const std::string & material_name,
const std::string & name,
int mode )

◆ SetCulling() [2/2]

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().

Here is the call graph for this function:

◆ SetPlanarMapping()

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().

Here is the call graph for this function:

◆ SetPlanarRotate()

void SBS::TextureManager::SetPlanarRotate ( bool value)

Definition at line 2354 of file texture.cpp.

References PlanarRotate.

◆ SetTextureFlip()

void SBS::TextureManager::SetTextureFlip ( int mainneg,
int mainpos,
int sideneg,
int sidepos,
int top,
int bottom )

◆ SetTextureInfo()

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().

◆ SetTextureMapping()

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().

Here is the call graph for this function:

◆ SetTextureMapping2()

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().

Here is the call graph for this function:

◆ SetTextureOverride()

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().

Here is the call graph for this function:

◆ TransformTexture()

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().

Here is the call graph for this function:

◆ UnloadMaterial()

bool SBS::TextureManager::UnloadMaterial ( const std::string & name,
const std::string & group )

◆ UnloadMaterials()

void SBS::TextureManager::UnloadMaterials ( )
private

Definition at line 2279 of file texture.cpp.

References SBS::SBS::InstanceNumber, SBS::ObjectBase::sbs, textureinfo, and SBS::ToString().

Referenced by ~TextureManager().

Here is the call graph for this function:

◆ UnloadTexture()

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().

Here is the call graph for this function:

◆ UnregisterTextureInfo()

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().

Here is the call graph for this function:

◆ WriteToTexture()

bool SBS::TextureManager::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 )
private

Definition at line 1809 of file texture.cpp.

References GetTextureByName(), GetTextureName(), SBS::ObjectBase::Report(), SBS::ObjectBase::ReportError(), and textureboxes.

Referenced by AddTextToTexture().

Here is the call graph for this function:

Member Data Documentation

◆ AutoX

bool SBS::TextureManager::AutoX
private

Definition at line 147 of file texture.h.

Referenced by AutoSize(), GetAutoSize(), SetAutoSize(), and TextureManager().

◆ AutoY

bool SBS::TextureManager::AutoY
private

Definition at line 147 of file texture.h.

Referenced by AutoSize(), GetAutoSize(), SetAutoSize(), and TextureManager().

◆ bottomflip

int SBS::TextureManager::bottomflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ bottomtex

std::string SBS::TextureManager::bottomtex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ DefaultMapper

int SBS::TextureManager::DefaultMapper
private

Definition at line 154 of file texture.h.

Referenced by ResetTextureMapping(), and TextureManager().

◆ FlipTexture

bool SBS::TextureManager::FlipTexture

◆ heightscale

std::vector<Real> SBS::TextureManager::heightscale

Definition at line 117 of file texture.h.

Referenced by ProcessTextureFlip(), and TextureManager().

◆ mainnegflip

int SBS::TextureManager::mainnegflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ mainnegtex

std::string SBS::TextureManager::mainnegtex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ mainposflip

int SBS::TextureManager::mainposflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ mainpostex

std::string SBS::TextureManager::mainpostex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ manual_textures

std::vector<Ogre::TexturePtr> SBS::TextureManager::manual_textures
private

◆ MapIndex

std::vector<int> SBS::TextureManager::MapIndex
private

Definition at line 137 of file texture.h.

Referenced by BackupMapping(), GetTextureMapping(), SetTextureMapping(), and TextureManager().

◆ MapMethod

int SBS::TextureManager::MapMethod
private

◆ MapUV

std::vector<Vector2> SBS::TextureManager::MapUV
private

◆ MapVerts1

std::vector<std::string> SBS::TextureManager::MapVerts1
private

Definition at line 141 of file texture.h.

Referenced by BackupMapping(), GetTextureMapping(), SetTextureMapping2(), and TextureManager().

◆ MapVerts2

std::vector<std::string> SBS::TextureManager::MapVerts2
private

Definition at line 142 of file texture.h.

Referenced by GetTextureMapping(), SetTextureMapping2(), and TextureManager().

◆ MapVerts3

std::vector<std::string> SBS::TextureManager::MapVerts3
private

Definition at line 143 of file texture.h.

Referenced by GetTextureMapping(), SetTextureMapping2(), and TextureManager().

◆ materialcount

int SBS::TextureManager::materialcount
private

◆ OldMapIndex

std::vector<int> SBS::TextureManager::OldMapIndex
private

Definition at line 138 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldMapMethod

int SBS::TextureManager::OldMapMethod
private

Definition at line 149 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldMapUV

std::vector<Vector2> SBS::TextureManager::OldMapUV
private

Definition at line 140 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldMapVerts1

std::vector<std::string> SBS::TextureManager::OldMapVerts1
private

Definition at line 144 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldMapVerts2

std::vector<std::string> SBS::TextureManager::OldMapVerts2
private

Definition at line 145 of file texture.h.

Referenced by ResetTextureMapping(), and TextureManager().

◆ OldMapVerts3

std::vector<std::string> SBS::TextureManager::OldMapVerts3
private

Definition at line 146 of file texture.h.

Referenced by ResetTextureMapping(), and TextureManager().

◆ OldPlanarFlat

bool SBS::TextureManager::OldPlanarFlat
private

Definition at line 152 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldPlanarRotate

bool SBS::TextureManager::OldPlanarRotate
private

Definition at line 153 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldRevX

bool SBS::TextureManager::OldRevX
private

Definition at line 151 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldRevY

bool SBS::TextureManager::OldRevY
private

Definition at line 151 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ OldRevZ

bool SBS::TextureManager::OldRevZ
private

Definition at line 151 of file texture.h.

Referenced by BackupMapping(), ResetTextureMapping(), and TextureManager().

◆ PlanarFlat

bool SBS::TextureManager::PlanarFlat
private

◆ PlanarRotate

bool SBS::TextureManager::PlanarRotate
private

◆ prev_material

std::string SBS::TextureManager::prev_material
private

Definition at line 178 of file texture.h.

Referenced by GetTextureMaterial().

◆ RevX

bool SBS::TextureManager::RevX
private

◆ RevY

bool SBS::TextureManager::RevY
private

◆ RevZ

bool SBS::TextureManager::RevZ
private

◆ sidenegflip

int SBS::TextureManager::sidenegflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ sidenegtex

std::string SBS::TextureManager::sidenegtex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ sideposflip

int SBS::TextureManager::sideposflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ sidepostex

std::string SBS::TextureManager::sidepostex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ textureboxes

std::vector<TexturePixelBox> SBS::TextureManager::textureboxes
private

Definition at line 175 of file texture.h.

Referenced by FreeTextureBoxes(), WriteToTexture(), and ~TextureManager().

◆ texturecount

int SBS::TextureManager::texturecount
private

◆ textureinfo

◆ TextureOverride

bool SBS::TextureManager::TextureOverride

Definition at line 39 of file texture.h.

Referenced by Skyscraper::ScriptProcessor::Run(), SetTextureOverride(), and TextureManager().

◆ topflip

int SBS::TextureManager::topflip

Definition at line 115 of file texture.h.

Referenced by ProcessTextureFlip(), SetTextureFlip(), and TextureManager().

◆ toptex

std::string SBS::TextureManager::toptex

Definition at line 112 of file texture.h.

Referenced by SetTextureOverride().

◆ widthscale

std::vector<Real> SBS::TextureManager::widthscale

Definition at line 116 of file texture.h.

Referenced by ProcessTextureFlip(), and TextureManager().


The documentation for this class was generated from the following files: