This is a particular collection of textures, within a PaletteGroup, that all share the same TextureProperties. More...
#include "palettePage.h"
Public Member Functions | |
PalettePage (PaletteGroup *group, const TextureProperties &properties) | |
void | assign (TexturePlacement *placement) |
Adds the indicated texture to the list of textures to consider placing on the page. More... | |
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. More... | |
PaletteGroup * | get_group () const |
Returns the group this particular PalettePage belongs to. More... | |
const TextureProperties & | get_properties () const |
Returns the texture grouping properties that all textures in this page share. More... | |
virtual TypeHandle | get_type () const |
void | optimal_resize () |
Attempts to resize each PalettteImage down to its smallest possible size. More... | |
void | place (TexturePlacement *placement) |
Assigns the particular TexturePlacement to a PaletteImage where it fits. More... | |
void | place_all () |
Assigns all the textures to their final home in a PaletteImage somewhere. More... | |
void | reset_images () |
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made more optimal). More... | |
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. More... | |
void | unplace (TexturePlacement *placement) |
Removes the TexturePlacement from wherever it has been placed. More... | |
void | update_images (bool redo_all) |
Regenerates each PaletteImage on this page that needs it. More... | |
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. More... | |
void | write_image_info (ostream &out, int indent_level=0) const |
Writes a list of the PaletteImages associated with this page, and all of their textures, to the indicated output stream. More... | |
![]() | |
TypedWritable (const TypedWritable ©) | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More... | |
string | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. More... | |
bool | encode_to_bam_stream (string &data, BamWriter *writer=NULL) const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More... | |
virtual void | finalize (BamReader *manager) |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More... | |
virtual TypeHandle | force_init_type () |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. More... | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More... | |
void | operator= (const TypedWritable ©) |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More... | |
virtual void | update_bam_nested (BamWriter *manager) |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More... | |
![]() | |
TypedObject (const TypedObject ©) | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
void | operator= (const TypedObject ©) |
![]() | |
Namable (const string &initial_name="") | |
Namable (const Namable ©) | |
void | clear_name () |
Resets the Namable's name to empty. More... | |
const string & | get_name () const |
bool | has_name () const |
Returns true if the Namable has a nonempty name set, false if the name is empty. More... | |
Namable & | operator= (const Namable &other) |
void | output (ostream &out) const |
Outputs the Namable. More... | |
void | set_name (const string &name) |
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. More... | |
![]() | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. More... | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
Additional Inherited Members | |
![]() | |
static TypedWritable *const | Null = (TypedWritable*)0L |
This is a particular collection of textures, within a PaletteGroup, that all share the same TextureProperties.
The textures on the same page may therefore all be placed on the same set of PaletteImages together.
Definition at line 37 of file palettePage.h.
void PalettePage::assign | ( | TexturePlacement * | placement | ) |
Adds the indicated texture to the list of textures to consider placing on the page.
Definition at line 84 of file palettePage.cxx.
Referenced by PaletteGroup::place_all().
|
virtual |
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 294 of file palettePage.cxx.
References TypedWritable::complete_pointers(), and TextureProperties::complete_pointers().
PaletteGroup * PalettePage::get_group | ( | ) | const |
Returns the group this particular PalettePage belongs to.
Definition at line 62 of file palettePage.cxx.
const TextureProperties & PalettePage::get_properties | ( | ) | const |
Returns the texture grouping properties that all textures in this page share.
Definition at line 73 of file palettePage.cxx.
Referenced by PaletteGroup::finalize().
void PalettePage::optimal_resize | ( | ) |
Attempts to resize each PalettteImage down to its smallest possible size.
Definition at line 189 of file palettePage.cxx.
References PaletteImage::optimal_resize().
Referenced by PaletteGroup::optimal_resize().
void PalettePage::place | ( | TexturePlacement * | placement | ) |
Assigns the particular TexturePlacement to a PaletteImage where it fits.
Definition at line 126 of file palettePage.cxx.
References TexturePlacement::get_omit_reason(), and PaletteImage::place().
Referenced by place_all().
void PalettePage::place_all | ( | ) |
Assigns all the textures to their final home in a PaletteImage somewhere.
Definition at line 96 of file palettePage.cxx.
References PaletteImage::check_solitary(), and place().
Referenced by PaletteGroup::place_all().
|
static |
Registers the current object as something that can be read from a Bam file.
Definition at line 255 of file palettePage.cxx.
References BamReader::get_factory().
void PalettePage::reset_images | ( | ) |
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made more optimal).
Definition at line 205 of file palettePage.cxx.
References PaletteImage::reset_image().
Referenced by PaletteGroup::reset_images().
void PalettePage::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.
Definition at line 225 of file palettePage.cxx.
References PaletteImage::setup_shadow_image().
Referenced by PaletteGroup::setup_shadow_images().
void PalettePage::unplace | ( | TexturePlacement * | placement | ) |
Removes the TexturePlacement from wherever it has been placed.
Definition at line 156 of file palettePage.cxx.
References TexturePlacement::get_image(), TexturePlacement::get_page(), TexturePlacement::is_placed(), and PaletteImage::unplace().
Referenced by PaletteGroup::unplace().
void PalettePage::update_images | ( | bool | redo_all | ) |
Regenerates each PaletteImage on this page that needs it.
Definition at line 240 of file palettePage.cxx.
References PaletteImage::update_image().
Referenced by PaletteGroup::update_images().
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
Reimplemented from TypedWritable.
Definition at line 268 of file palettePage.cxx.
References Datagram::add_string(), Datagram::add_uint32(), TypedWritable::write_datagram(), TextureProperties::write_datagram(), and BamWriter::write_pointer().
void PalettePage::write_image_info | ( | ostream & | out, |
int | indent_level = 0 |
||
) | const |
Writes a list of the PaletteImages associated with this page, and all of their textures, to the indicated output stream.
Definition at line 169 of file palettePage.cxx.
References PaletteImage::is_empty(), ImageFile::output_filename(), and PaletteImage::write_placements().
Referenced by PaletteGroup::write_image_info().