Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
TextureClass Class Reference

#include <texture.h>

Inherits TextureBaseClass.

Inherited by AlphaEdgeTextureClass, AlphaTerrainTextureClass, CloudMapTerrainTextureClass, CubeTextureClass, LightMapTerrainTextureClass, ScorchTextureClass, TerrainTextureClass, and VolumeTextureClass.

Public Member Functions

 TextureClass (unsigned width, unsigned height, WW3DFormat format, MipCountType mip_level_count=MIP_LEVELS_ALL, PoolType pool=POOL_MANAGED, bool rendertarget=false, bool allow_reduction=true)
 
 TextureClass (const char *name, const char *full_path=NULL, MipCountType mip_level_count=MIP_LEVELS_ALL, WW3DFormat texture_format=WW3D_FORMAT_UNKNOWN, bool allow_compression=true, bool allow_reduction=true)
 
 TextureClass (SurfaceClass *surface, MipCountType mip_level_count=MIP_LEVELS_ALL)
 
 TextureClass (IDirect3DBaseTexture8 *d3d_texture)
 
 TextureClass (unsigned width, unsigned height, MipCountType mip_level_count=MIP_LEVELS_ALL, PoolType pool=POOL_MANAGED, bool rendertarget=false, WW3DFormat format=WW3D_FORMAT_UNKNOWN, bool allow_reduction=true)
 
virtual TexAssetType Get_Asset_Type () const
 
virtual void Init ()
 Initialise the texture.
 
virtual void Apply_New_Surface (IDirect3DBaseTexture8 *tex, bool initialized, bool disable_auto_invalidation=false)
 Apply new surface to texture.
 
SurfaceClassGet_Surface_Level (unsigned int level=0)
 Get surface from mip level.
 
IDirect3DSurface8 * Get_D3D_Surface_Level (unsigned int level=0)
 Get D3D surface from mip level.
 
void Get_Level_Description (SurfaceClass::SurfaceDescription &desc, unsigned int level=0)
 Get surface description for a mip level.
 
TextureFilterClassGet_Filter ()
 
WW3DFormat Get_Texture_Format () const
 
virtual void Apply (unsigned int stage)
 Apply texture states.
 
virtual unsigned Get_Texture_Memory_Usage () const
 Get texture memory usage.
 
virtual TextureClassAs_TextureClass ()
 
- Public Member Functions inherited from TextureBaseClass
 TextureBaseClass (unsigned width, unsigned height, MipCountType mip_level_count=MIP_LEVELS_ALL, PoolType pool=POOL_MANAGED, bool rendertarget=false, bool reducible=true)
 
virtual ~TextureBaseClass ()
 Base texture class destructor.
 
void Set_Texture_Name (const char *name)
 Set texture name.
 
void Set_Full_Path (const char *path)
 
const StringClassGet_Texture_Name (void) const
 
const StringClassGet_Full_Path (void) const
 
unsigned Get_ID () const
 
unsigned int Get_Mip_Level_Count (void) const
 
int Get_Width () const
 
int Get_Height () const
 
void Set_Inactivation_Time (unsigned time)
 
int Get_Inactivation_Time () const
 
unsigned int Get_Priority (void)
 Get priority.
 
unsigned int Set_Priority (unsigned int priority)
 Set priority.
 
bool Is_Initialized () const
 
bool Is_Lightmap () const
 
bool Is_Procedural () const
 
bool Is_Reducible () const
 
void Invalidate ()
 Invalidate this texture.
 
IDirect3DBaseTexture8 * Peek_D3D_Base_Texture () const
 Returns a pointer to the d3d texture.
 
void Set_D3D_Base_Texture (IDirect3DBaseTexture8 *tex)
 Set the d3d texture pointer. Handles ref counts properly.
 
PoolType Get_Pool () const
 
bool Is_Missing_Texture ()
 Is missing texture.
 
bool Is_Dirty ()
 
void Set_Dirty ()
 
void Clean ()
 
void Set_HSV_Shift (const Vector3 &hsv_shift)
 
const Vector3Get_HSV_Shift ()
 
bool Is_Compression_Allowed () const
 
unsigned Get_Reduction () const
 Get reduction mip levels.
 
virtual CubeTextureClassAs_CubeTextureClass ()
 
virtual VolumeTextureClassAs_VolumeTextureClass ()
 
IDirect3DTexture8 * Peek_D3D_Texture () const
 
IDirect3DVolumeTexture8 * Peek_D3D_VolumeTexture () const
 
IDirect3DCubeTexture8 * Peek_D3D_CubeTexture () const
 
- Public Member Functions inherited from RefCountClass
 RefCountClass (void)
 
 RefCountClass (const RefCountClass &)
 
void Add_Ref (void) const
 
WWINLINE void Release_Ref (void) const
 
int Num_Refs (void) const
 
virtual void Delete_This (void)
 

Protected Attributes

WW3DFormat TextureFormat
 
TextureFilterClass Filter
 
- Protected Attributes inherited from TextureBaseClass
bool Initialized
 
bool IsLightmap
 
bool IsCompressionAllowed
 
bool IsProcedural
 
bool IsReducible
 
unsigned InactivationTime
 
unsigned ExtendedInactivationTime
 
unsigned LastInactivationSyncTime
 
unsigned LastAccessed
 
Vector3 HSVShift
 
int Width
 
int Height
 

Additional Inherited Members

- Public Types inherited from TextureBaseClass
enum  PoolType { POOL_DEFAULT =0 , POOL_MANAGED , POOL_SYSTEMMEM }
 
enum  TexAssetType { TEX_REGULAR , TEX_CUBEMAP , TEX_VOLUME }
 
- Static Public Member Functions inherited from TextureBaseClass
static int _Get_Total_Locked_Surface_Size ()
 Get total locked surface size.
 
static int _Get_Total_Texture_Size ()
 Get total texture size.
 
static int _Get_Total_Lightmap_Texture_Size ()
 Get total lightmap texture size.
 
static int _Get_Total_Procedural_Texture_Size ()
 Get total procedural texture size.
 
static int _Get_Total_Locked_Surface_Count ()
 Get total locked surface count.
 
static int _Get_Total_Texture_Count ()
 Get total texture count.
 
static int _Get_Total_Lightmap_Texture_Count ()
 Get total light map texture count.
 
static int _Get_Total_Procedural_Texture_Count ()
 Get total procedural texture count.
 
static void Invalidate_Old_Unused_Textures (unsigned inactive_time_override)
 Invalidate old unused textures.
 
static void Apply_Null (unsigned int stage)
 Apply NULL texture state.
 
- Static Public Member Functions inherited from RefCountClass
static int Total_Refs (void)
 
static RefCountClassAdd_Active_Ref (RefCountClass *obj)
 
static RefCountClassSet_Ref_Owner (RefCountClass *obj, char *file, int line)
 
static void Remove_Active_Ref (RefCountClass *obj)
 
static bool Validate_Active_Ref (RefCountClass *obj)
 
- Public Attributes inherited from TextureBaseClass
MipCountType MipLevelCount
 
- Public Attributes inherited from RefCountClass
RefCountNodeClass ActiveRefNode
 
ActiveRefStruct ActiveRefInfo
 
- Static Public Attributes inherited from RefCountClass
static RefCountListClass ActiveRefList
 
- Protected Member Functions inherited from TextureBaseClass
void Load_Locked_Surface ()
 Load locked surface.
 
void Poke_Texture (IDirect3DBaseTexture8 *tex)
 
- Protected Member Functions inherited from RefCountClass
virtual ~RefCountClass (void)
 

Detailed Description

Definition at line 270 of file texture.h.

Constructor & Destructor Documentation

◆ TextureClass() [1/5]

TextureClass::TextureClass ( unsigned width,
unsigned height,
WW3DFormat format,
MipCountType mip_level_count = MIP_LEVELS_ALL,
PoolType pool = POOL_MANAGED,
bool rendertarget = false,
bool allow_reduction = true )

Definition at line 596 of file texture.cpp.

◆ TextureClass() [2/5]

TextureClass::TextureClass ( const char * name,
const char * full_path = NULL,
MipCountType mip_level_count = MIP_LEVELS_ALL,
WW3DFormat texture_format = WW3D_FORMAT_UNKNOWN,
bool allow_compression = true,
bool allow_reduction = true )

Definition at line 668 of file texture.cpp.

◆ TextureClass() [3/5]

TextureClass::TextureClass ( SurfaceClass * surface,
MipCountType mip_level_count = MIP_LEVELS_ALL )

Definition at line 766 of file texture.cpp.

◆ TextureClass() [4/5]

TextureClass::TextureClass ( IDirect3DBaseTexture8 * d3d_texture)

Definition at line 807 of file texture.cpp.

◆ TextureClass() [5/5]

TextureClass::TextureClass ( unsigned width,
unsigned height,
MipCountType mip_level_count = MIP_LEVELS_ALL,
PoolType pool = POOL_MANAGED,
bool rendertarget = false,
WW3DFormat format = WW3D_FORMAT_UNKNOWN,
bool allow_reduction = true )
inline

Definition at line 312 of file texture.h.

Member Function Documentation

◆ Apply()

void TextureClass::Apply ( unsigned int stage)
virtual

◆ Apply_New_Surface()

void TextureClass::Apply_New_Surface ( IDirect3DBaseTexture8 * tex,
bool initialized,
bool disable_auto_invalidation = false )
virtual

Apply new surface to texture.

Implements TextureBaseClass.

Reimplemented in CubeTextureClass, and VolumeTextureClass.

Definition at line 894 of file texture.cpp.

◆ As_TextureClass()

virtual TextureClass * TextureClass::As_TextureClass ( )
inlinevirtual

Reimplemented from TextureBaseClass.

Definition at line 344 of file texture.h.

◆ Get_Asset_Type()

virtual TexAssetType TextureClass::Get_Asset_Type ( ) const
inlinevirtual

Implements TextureBaseClass.

Reimplemented in CubeTextureClass, and VolumeTextureClass.

Definition at line 324 of file texture.h.

◆ Get_D3D_Surface_Level()

IDirect3DSurface8 * TextureClass::Get_D3D_Surface_Level ( unsigned int level = 0)

Get D3D surface from mip level.

Definition at line 1019 of file texture.cpp.

◆ Get_Filter()

TextureFilterClass & TextureClass::Get_Filter ( )
inline

Definition at line 336 of file texture.h.

◆ Get_Level_Description()

void TextureClass::Get_Level_Description ( SurfaceClass::SurfaceDescription & desc,
unsigned int level = 0 )

Get surface description for a mip level.

Definition at line 1006 of file texture.cpp.

◆ Get_Surface_Level()

SurfaceClass * TextureClass::Get_Surface_Level ( unsigned int level = 0)

Get surface from mip level.

Definition at line 986 of file texture.cpp.

◆ Get_Texture_Format()

WW3DFormat TextureClass::Get_Texture_Format ( ) const
inline

Definition at line 338 of file texture.h.

◆ Get_Texture_Memory_Usage()

unsigned TextureClass::Get_Texture_Memory_Usage ( ) const
virtual

Get texture memory usage.

Implements TextureBaseClass.

Definition at line 1036 of file texture.cpp.

◆ Init()

void TextureClass::Init ( )
virtual

Initialise the texture.

Implements TextureBaseClass.

Definition at line 848 of file texture.cpp.

Member Data Documentation

◆ Filter

TextureFilterClass TextureClass::Filter
protected

Definition at line 351 of file texture.h.

◆ TextureFormat

WW3DFormat TextureClass::TextureFormat
protected

Definition at line 348 of file texture.h.


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