|
|
|
This is the highest level of grouping for TextureImages.
More...
#include "paletteGroup.h"
List of all members.
Public Member Functions |
| void | add_texture_swap_info (const string sourceTextureName, const vector_string &swapTextures) |
| | Store textureswap information from textures.txa.
|
| void | clear_depends () |
| | Eliminates all the dependency information for this group.
|
| virtual int | complete_pointers (TypedWritable **p_list, BamReader *manager) |
| | Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.
|
| virtual void | finalize (BamReader *manager) |
| | This method is called by the BamReader after all pointers everywhere in the world have been completely read in.
|
| void | get_complete_placements (pvector< TexturePlacement * > &placements) const |
| | Adds the set of TexturePlacements associated with this group and all dependent groups to the indicated vector.
|
| int | get_dependency_level () const |
| | Returns the dependency level of this group.
|
| int | get_dependency_order () const |
| | Returns the dependency order of this group.
|
| const string & | get_dirname () const |
| | Returns the directory name associated with the palette group.
|
| int | get_dirname_order () const |
| | Returns the dependency order of this group.
|
| int | get_egg_count () const |
| | Returns the number of egg files that share this PaletteGroup.
|
| const PaletteGroups & | get_groups () const |
| | Returns the set of groups this group depends on.
|
| int | get_margin_override () const |
| | Returns the set of groups this group depends on.
|
| PalettePage * | get_page (const TextureProperties &properties) |
| | Returns the page associated with the indicated properties.
|
| void | get_placements (pvector< TexturePlacement * > &placements) const |
| | Adds the set of TexturePlacements associated with this group to the indicated vector.
|
|
virtual TypeHandle | get_type () const |
| void | group_with (PaletteGroup *other) |
| | Indicates a dependency of this group on some other group.
|
| bool | has_dirname () const |
| | Returns true if the directory name has been explicitly set for this group.
|
| bool | has_margin_override () const |
| | Returns the set of groups this group depends on.
|
| void | increment_egg_count () |
| | Increments by one the number of egg files that are known to reference this PaletteGroup.
|
| bool | is_none_texture_swap () const |
| | Returns textureswap information is set or not, True if it's not set.
|
| bool | is_preferred_over (const PaletteGroup &other) const |
| | Returns true if this group should be preferred for adding textures over the other group, if both are available.
|
| void | optimal_resize () |
| | Attempts to resize each PalettteImage down to its smallest possible size.
|
| void | place_all () |
| | Once all the textures have been assigned to this group, try to place them all onto suitable PaletteImages.
|
| TexturePlacement * | prepare (TextureImage *texture) |
| | Marks the indicated Texture as ready for placing somewhere within this group, and returns a placeholder TexturePlacement object.
|
| void | reset_dependency_level () |
| | Unconditionally sets the dependency level and order of this group to zero, in preparation for a later call to set_dependency_level().
|
| void | reset_images () |
| | Throws away all of the current PaletteImages, so that new ones may be created (and the packing made more optimal).
|
| void | set_dependency_level (int level) |
| | Sets the dependency level of this group to the indicated level, provided that level is not lower than the level that was set previously.
|
| bool | set_dependency_order () |
| | Updates the dependency order of this group.
|
| void | set_dirname (const string &dirname) |
| | Sets the directory name associated with the palette group.
|
| void | set_margin_override (const int override) |
| | Returns the set of groups this group depends on.
|
| void | setup_shadow_images () |
| | Ensures that each PaletteImage's _shadow_image has the correct filename and image types, based on what was supplied on the command line and in the .txa file.
|
| void | unplace (TexturePlacement *placement) |
| | Removes the texture from its position on a PaletteImage, if it has been so placed.
|
| void | update_images (bool redo_all) |
| | Regenerates each PaletteImage on this group that needs it.
|
| void | update_unknown_textures (const TxaFile &txa_file) |
| | Checks for new information on any textures within the group for which some of the saved information is incomplete.
|
| virtual void | write_datagram (BamWriter *writer, Datagram &datagram) |
| | Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
|
| void | write_image_info (ostream &out, int indent_level=0) const |
| | Writes a list of the PaletteImages associated with this group, and all of their textures, to the indicated output stream.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
| static void | register_with_read_factory () |
| | Registers the current object as something that can be read from a Bam file.
|
Protected Member Functions |
| void | fillin (DatagramIterator &scan, BamReader *manager) |
| | Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
|
Static Protected Member Functions |
| static TypedWritable * | make_PaletteGroup (const FactoryParams ¶ms) |
| | This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read.
|
Friends |
|
class | PaletteGroups |
Detailed Description
This is the highest level of grouping for TextureImages.
Textures are assigned to one or several PaletteGroups based on the information in the .txa file; each PaletteGroup is conceptually a collection of textures that are to be moved around (into texture memory, downloaded, etc.) in one big chunk. It is the set of all textures that may be displayed together at any given time.
Definition at line 47 of file paletteGroup.h.
Member Function Documentation
| void PaletteGroup::add_texture_swap_info |
( |
const string |
sourceTextureName, |
|
|
const vector_string & |
swapTextures |
|
) |
| |
Store textureswap information from textures.txa.
Definition at line 819 of file paletteGroup.cxx.
| void PaletteGroup::clear_depends |
( |
| ) |
|
Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.
The return value is the number of pointers processed from the list.
Reimplemented from TypedWritable.
Definition at line 713 of file paletteGroup.cxx.
References PaletteGroups::complete_pointers().
| void PaletteGroup::finalize |
( |
BamReader * |
manager | ) |
[virtual] |
This method is called by the BamReader after all pointers everywhere in the world have been completely read in.
It's a hook at which the object can do whatever final setup it requires that depends on other pointers being valid.
Reimplemented from TypedWritable.
Definition at line 750 of file paletteGroup.cxx.
References PalettePage::get_properties().
| void PaletteGroup::get_complete_placements |
( |
pvector< TexturePlacement * > & |
placements | ) |
const |
| int PaletteGroup::get_dependency_level |
( |
| ) |
const |
Returns the dependency level of this group.
This is a measure of how specific the group is; the lower the dependency level, the more specific the group.
Groups depend on other groups in a hierarchical relationship. In general, if group a depends on group b, then b->get_dependency_level() > a->get_dependency_level().
Thus, groups that lots of other groups depend on have a higher dependency level; groups that no one else depends on have a low dependency level. This is important when deciding which groups are best suited for assigning a texture to; in general, the texture should be assigned to the most specific suitable group (i.e. the one with the lowest dependency level).
Definition at line 301 of file paletteGroup.cxx.
| int PaletteGroup::get_dependency_order |
( |
| ) |
const |
| const string & PaletteGroup::get_dirname |
( |
| ) |
const |
| int PaletteGroup::get_dirname_order |
( |
| ) |
const |
| int PaletteGroup::get_egg_count |
( |
| ) |
const |
| int PaletteGroup::get_margin_override |
( |
| ) |
const |
Returns the set of groups this group depends on.
Definition at line 130 of file paletteGroup.cxx.
Returns the page associated with the indicated properties.
If no page object has yet been created, creates one.
Definition at line 399 of file paletteGroup.cxx.
Referenced by place_all().
| void PaletteGroup::get_placements |
( |
pvector< TexturePlacement * > & |
placements | ) |
const |
Adds the set of TexturePlacements associated with this group to the indicated vector.
The vector is not cleared before this operation; if the user wants to retrieve the set of placements particular to this group only, it is the user's responsibility to clear the vector first.
Definition at line 166 of file paletteGroup.cxx.
Referenced by get_complete_placements(), and Palettizer::report_statistics().
Indicates a dependency of this group on some other group.
This means that the textures assigned to this group may be considered successfully assigned if they are actually placed in the other group. In practice, this means that the textures associated with the other palette group will always be resident at runtime when textures from this palette group are required.
Definition at line 110 of file paletteGroup.cxx.
References PaletteGroups::insert().
| bool PaletteGroup::has_dirname |
( |
| ) |
const |
| bool PaletteGroup::has_margin_override |
( |
| ) |
const |
Returns the set of groups this group depends on.
Definition at line 151 of file paletteGroup.cxx.
| void PaletteGroup::increment_egg_count |
( |
| ) |
|
Increments by one the number of egg files that are known to reference this PaletteGroup.
This is designed to aid the heuristics in texture placing; it's useful to know how many different egg files are sharing a particular PaletteGroup.
Definition at line 376 of file paletteGroup.cxx.
| bool PaletteGroup::is_none_texture_swap |
( |
| ) |
const |
| bool PaletteGroup::is_preferred_over |
( |
const PaletteGroup & |
other | ) |
const |
| void PaletteGroup::optimal_resize |
( |
| ) |
|
| void PaletteGroup::place_all |
( |
| ) |
|
Marks the indicated Texture as ready for placing somewhere within this group, and returns a placeholder TexturePlacement object.
The texture is not placed immediately, but may be placed later when place_all() is called; at this time, the TexturePlacement fields will be filled in as appropriate.
Definition at line 423 of file paletteGroup.cxx.
References ImageFile::get_alpha_file_channel(), ImageFile::get_alpha_filename(), Filename::get_dirname(), Filename::get_extension(), ImageFile::get_filename(), TextureImage::get_preferred_source(), TextureImage::get_source(), and Palettizer::get_texture().
| void PaletteGroup::register_with_read_factory |
( |
| ) |
[static] |
| void PaletteGroup::reset_dependency_level |
( |
| ) |
|
| void PaletteGroup::reset_images |
( |
| ) |
|
| void PaletteGroup::set_dependency_level |
( |
int |
level | ) |
|
| bool PaletteGroup::set_dependency_order |
( |
| ) |
|
| void PaletteGroup::set_dirname |
( |
const string & |
dirname | ) |
|
| void PaletteGroup::set_margin_override |
( |
const int |
override | ) |
|
Returns the set of groups this group depends on.
Definition at line 140 of file paletteGroup.cxx.
| void PaletteGroup::setup_shadow_images |
( |
| ) |
|
| void PaletteGroup::update_images |
( |
bool |
redo_all | ) |
|
| void PaletteGroup::update_unknown_textures |
( |
const TxaFile & |
txa_file | ) |
|
| void PaletteGroup::write_datagram |
( |
BamWriter * |
writer, |
|
|
Datagram & |
datagram |
|
) |
| [virtual] |
| void PaletteGroup::write_image_info |
( |
ostream & |
out, |
|
|
int |
indent_level = 0 |
|
) |
| const |
The documentation for this class was generated from the following files:
| | |