In file libs/cs3d/software/soft_txt.h:

## class csTextureManagerSoftware : public csTextureManager

> Software version of the texture manager

## Inheritance:

### Public Fields

static UShort alpha_mask
  Alpha mask used for 16-bit mode.
int force_txtMode
  Force value (set by commandline) (-1 = no force)
TextureTablesAlpha* lt_alpha
  Lookup table.
PalIdxLookup* lt_light
  For optimization: points to tables in lt_truergb or in lt_truergb_priv.
TextureTablesPalette* lt_pal
  Lookup table.
unsigned char* lt_palette_table
  For optimization: points to table in lt_pal.
TextureTablesTrueRgb* lt_truergb
  Lookup table.
TextureTablesTrueRgbPriv* lt_truergb_private
  Lookup table.
TextureTablesWhite16* lt_white16
  Lookup table.
TextureTablesWhite8* lt_white8
  Lookup table.
int txtMode
  How are texture represented internally.

### Public Methods

int add_light_blue_private(int b, int l)
int add_light_green_private(int g, int l)
int add_light_red_private(int r, int l)
  Add some light to some light component
int alloc_rgb(int r, int g, int b, int dist)
  Allocate a new RGB color
STDMETHODIMP AllocPalette()
  Really allocate the palette on the system.
virtual void clear()
void compute_light_tables()
  Compute the light tables using the previously compute palette
void compute_palette()
  Compute the 'best' palette for all loaded textures
csTextureManagerSoftware(ISystem* piSystem, IGraphics2D* piG2D)
virtual int find_color(int r, int g, int b)
  Return the index for some color
int find_rgb(int r, int g, int b)
  Find an rgb value using the faster lookup tables
int find_rgb_real(int r, int g, int b)
  This version of find_rgb finds some r,g,b value AFTER gamma correction is applied
int find_rgb_slow(int r, int g, int b)
  Find an rgb value using the palette directly (not use the faster lookup tables)
bool force_mixing(char* mix)
bool force_txtmode(char* txtmode)
STDMETHODIMP FreeImages()
const RGBcolor* get_palette()
  Get the palette
STDMETHODIMP Initialize()
virtual void InitSystem()
STDMETHODIMP MergeTexture(ITextureHandle* handle)
int mix_lights(int r, int g, int b, int p)
  GAC: Use a slower method of mixing lights that produces a better result Accepts 16
UShort mix_lights_16(int r, int g, int b, int p)
  Version of mix_lights for 16-bit mode
csTextureMMSoftware* new_texture(IImageFile* image)
  Create a new texture.
STDMETHODIMP Prepare()
STDMETHODIMP RegisterTexture(IImageFile* image, ITextureHandle** handle, bool for3d, bool for2d)
STDMETHODIMP ReserveColor(int r, int g, int b)
void SetConfig(csIniFile* newconfig)
  Set configuration file for use inside Initialize() call
STDMETHODIMP UnregisterTexture(ITextureHandle* handle)
virtual ~csTextureManagerSoftware()

### Private Fields

int alloc[256]
  Which colors are allocated and which are not?
csIniFile* config
  The configuration file (duplicate! should not be freed)
bool initialized
  Did we initialized?
RGBcolor pal[256]
  The shared palette
int prefered_col_dist
  Configuration values for color matching.
int prefered_dist
  Configuration values for color matching.
bool truecolor
  True if truecolor mode is enabled.

### Private Methods

void create_lt_alpha()
  Create the alpha tables
void create_lt_palette()
  Create the palette lookup table
void create_lt_truergb()
  Create the truergb 16-bit tables
void create_lt_truergb_private()
  Create the truergb 16-bit tables for TXT_PRIVATE mode
void create_lt_white16()
  Create the lookup tables for the white tables in 16-bit display mode
void create_lt_white8()
  Create the lookup tables for the white tables in 8-bit display mode
ULong encode_rgb(int r, int g, int b)
  Encode RGB values to a 16-bit word (for 16-bit mode)
ULong encode_rgb_safe(int r, int g, int b)
  Encode RGB values to 16-bit word (safe mode)
int find_rgb_map(int r, int g, int b, int map_type, int l)
  Find rgb for a specific map type and apply an intensity
csTexture* get_texture(int idx, int lev)
void read_config()
  Read configuration values from config file.

### Inherited from csTextureManager:

### Public Fields

static Filter3x3 blend_filter
bool do_blend_mipmap0
bool do_lightmapgrid
bool do_lightmaponly
csTextureFactory* factory_2d
csTextureFactory* factory_3d
int force_mix
float Gamma
IGraphics2D* m_piG2D
ISystem* m_piSystem
static Filter3x3 mipmap_filter_1
static Filter5x5 mipmap_filter_2
int mipmap_nice
int mixing
bool use_rgb
bool verbose

### Public Methods

int black()
int blue()
STDMETHODIMP FindRGB(int r, int g, int b, int& color)
int get_almost_black()
int get_display_depth()
STDMETHODIMP GetVeryNice(bool& result)
int green()
const csPixelFormat& pixel_format()
int red()
STDMETHODIMP SetVerbose(bool vb)
int white()
int yellow()

### Protected Fields

csPixelFormat pfmt
int red_color
csVector textures

## Documentation

> Software version of the texture manager. This instance of the texture manager is probably the most involved of all 3D rasterizer specific texture manager implementations because it needs to do a lot of work regarding palette management and the creation of lots of lookup tables.

`csIniFile* config`
  The configuration file (duplicate! should not be freed)

`bool initialized`
  Did we initialized?

`bool truecolor`
  True if truecolor mode is enabled.

`RGBcolor pal[256]`
  The shared palette. This palette is also used in truecolor (16-bit) mode. It then contains the single palette that is shared by all textures.

`int alloc[256]`
  Which colors are allocated and which are not?

`int prefered_dist`
  Configuration values for color matching.

`int prefered_col_dist`
  Configuration values for color matching.

`void read_config()`
  Read configuration values from config file.

`ULong encode_rgb(int r, int g, int b)`
  Encode RGB values to a 16-bit word (for 16-bit mode)

`ULong encode_rgb_safe(int r, int g, int b)`
  Encode RGB values to 16-bit word (safe mode)

`void create_lt_palette()`
  Create the palette lookup table. The colormap must be created before this can be used.

`void create_lt_white16()`
  Create the lookup tables for the white tables in 16-bit display mode

`void create_lt_white8()`
  Create the lookup tables for the white tables in 8-bit display mode. The tables are cached if needed (with the name 'table_white8').

`void create_lt_truergb()`
  Create the truergb 16-bit tables

`void create_lt_truergb_private()`
  Create the truergb 16-bit tables for TXT_PRIVATE mode

`void create_lt_alpha()`
  Create the alpha tables. The tables are cached if needed (with the name 'table_alpha').

`csTexture* get_texture(int idx, int lev)`

`int find_rgb_map(int r, int g, int b, int map_type, int l)`
  Find rgb for a specific map type and apply an intensity. 'map_type' is one of TABLE_....

`unsigned char* lt_palette_table`
  For optimization: points to table in lt_pal.

`PalIdxLookup* lt_light`
  For optimization: points to tables in lt_truergb or in lt_truergb_priv.

`TextureTablesTrueRgb* lt_truergb`
  Lookup table.

`TextureTablesTrueRgbPriv* lt_truergb_private`
  Lookup table.

`TextureTablesWhite16* lt_white16`
  Lookup table.

`TextureTablesWhite8* lt_white8`
  Lookup table.

`TextureTablesPalette* lt_pal`
  Lookup table.

`TextureTablesAlpha* lt_alpha`
  Lookup table.

`static UShort alpha_mask`
  Alpha mask used for 16-bit mode.

`int txtMode`
  How are texture represented internally.

`int force_txtMode`
  Force value (set by commandline) (-1 = no force)

`csTextureManagerSoftware(ISystem* piSystem, IGraphics2D* piG2D)`

`virtual ~csTextureManagerSoftware()`

`virtual void InitSystem()`

`virtual void clear()`

`STDMETHODIMP Initialize()`

`STDMETHODIMP Prepare()`

`STDMETHODIMP RegisterTexture(IImageFile* image, ITextureHandle** handle, bool for3d, bool for2d)`

`STDMETHODIMP UnregisterTexture(ITextureHandle* handle)`

`STDMETHODIMP MergeTexture(ITextureHandle* handle)`

`STDMETHODIMP FreeImages()`

`STDMETHODIMP ReserveColor(int r, int g, int b)`

`STDMETHODIMP AllocPalette()`
  Really allocate the palette on the system.

`csTextureMMSoftware* new_texture(IImageFile* image)`
  Create a new texture.

`int find_rgb_slow(int r, int g, int b)`
  Find an rgb value using the palette directly (not use the faster lookup tables)

`int alloc_rgb(int r, int g, int b, int dist)`
  Allocate a new RGB color

`bool force_mixing(char* mix)`

`bool force_txtmode(char* txtmode)`

`int find_rgb(int r, int g, int b)`
  Find an rgb value using the faster lookup tables

`virtual int find_color(int r, int g, int b)`
  Return the index for some color. This works in 8-bit (returns an index in the 256-color table) and in 15/16-bit (returns a 15/16-bit encoded RGB value).

`int find_rgb_real(int r, int g, int b)`
  This version of find_rgb finds some r,g,b value AFTER gamma correction is applied. This is useful for console messages that always need the same color regardless of the gamma correction.

`void compute_palette()`
  Compute the 'best' palette for all loaded textures. This function will exactly behave the same in 16-bit mode since we still need the common 256-color palette (although it will not be installed on the display).

`void compute_light_tables()`
  Compute the light tables using the previously compute palette

`const RGBcolor* get_palette()`
  Get the palette

`int mix_lights(int r, int g, int b, int p)`
  GAC: Use a slower method of mixing lights that produces a better result Accepts 16.16 rgb values and a palette entry Returns palette entry of color with lights added Assumes lights are RGB format (Not WRB).

`int add_light_red_private(int r, int l)`
  Add some light to some light component. This is used for TXT_PRIVATE mode. This returns a 16-bit truecolor component for the specific color.

`int add_light_green_private(int g, int l)`

`int add_light_blue_private(int b, int l)`

`UShort mix_lights_16(int r, int g, int b, int p)`
  Version of mix_lights for 16-bit mode. This is slightly faster since the last lookup is not needed.

`void SetConfig(csIniFile* newconfig)`
  Set configuration file for use inside Initialize() call

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de