#include <palettePage.h>
Inheritance diagram for PalettePage:
Public Member Functions | |
PalettePage (PaletteGroup *group, const TextureProperties &properties) | |
PaletteGroup * | get_group () const |
Returns the group this particular PalettePage belongs to. | |
const TextureProperties & | get_properties () const |
Returns the texture grouping properties that all textures in this page share. | |
void | assign (TexturePlacement *placement) |
Adds the indicated texture to the list of textures to consider placing on the page. | |
void | place_all () |
Assigns all the textures to their final home in a PaletteImage somewhere. | |
void | place (TexturePlacement *placement) |
Assigns the particular TexturePlacement to a PaletteImage where it fits. | |
void | unplace (TexturePlacement *placement) |
Removes the TexturePlacement from wherever it has been placed. | |
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. | |
void | optimal_resize () |
Attempts to resize each PalettteImage down to its smallest possible size. | |
void | reset_images () |
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made more optimal). | |
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 | update_images (bool redo_all) |
Regenerates each PaletteImage on this page that needs it. | |
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. | |
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 TypeHandle | get_type () const |
virtual void | finalize () |
virtual TypeHandle | force_init_type (void) |
int | get_type_index () const |
bool | is_of_type (TypeHandle handle) const |
bool | is_exact_type (TypeHandle handle) const |
void | set_name (const string &name) |
void | clear_name () |
bool | has_name () const |
const string & | get_name () const |
void | output (ostream &out) const |
Static Public Member Functions | |
void | register_with_read_factory () |
Registers the current object as something that can be read from a Bam file. | |
TypeHandle | get_class_type () |
void | init_type () |
Static Public Attributes | |
TypedWritable *const | Null |
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 | |
TypedWritable * | make_PalettePage (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. | |
Protected Attributes | |
string | _name |
Private Types | |
typedef pvector< TexturePlacement * > | Assigned |
typedef pvector< PaletteImage * > | Images |
Private Member Functions | |
PalettePage () | |
The default constructor is only for the convenience of the Bam reader. | |
Private Attributes | |
PaletteGroup * | _group |
TextureProperties | _properties |
Assigned | _assigned |
Images | _images |
int | _num_images |
Static Private Attributes | |
TypeHandle | _type_handle |
The textures on the same page may therefore all be placed on the same set of PaletteImages together.
Definition at line 51 of file palettePage.h.
|
Definition at line 76 of file palettePage.h. |
|
Definition at line 79 of file palettePage.h. |
|
The default constructor is only for the convenience of the Bam reader.
Definition at line 49 of file palettePage.cxx. |
|
Definition at line 61 of file palettePage.cxx. References _group. |
|
Adds the indicated texture to the list of textures to consider placing on the page.
Definition at line 109 of file palettePage.cxx. |
|
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 371 of file palettePage.cxx. |
|
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
Reimplemented from TypedWritable. Definition at line 430 of file palettePage.cxx. Referenced by register_with_read_factory(). |
|
Reimplemented from Namable. Definition at line 99 of file palettePage.h. Referenced by reset_images(). |
|
Returns the group this particular PalettePage belongs to.
Definition at line 79 of file palettePage.cxx. |
|
Returns the texture grouping properties that all textures in this page share.
Definition at line 94 of file palettePage.cxx. |
|
Reimplemented from TypedWritable. Definition at line 109 of file palettePage.h. |
|
Reimplemented from Namable. Definition at line 102 of file palettePage.h. References _type_handle. |
|
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.
Definition at line 407 of file palettePage.cxx. Referenced by reset_images(). |
|
Attempts to resize each PalettteImage down to its smallest possible size.
Definition at line 235 of file palettePage.cxx. |
|
Assigns the particular TexturePlacement to a PaletteImage where it fits.
Definition at line 159 of file palettePage.cxx. References TexturePlacement::get_image(), TexturePlacement::get_page(), TexturePlacement::is_placed(), nassertv, and PaletteImage::unplace(). Referenced by get_properties(). |
|
Assigns all the textures to their final home in a PaletteImage somewhere.
Definition at line 125 of file palettePage.cxx. References _images, TexturePlacement::get_omit_reason(), nassertv, OR_working, and PaletteImage::place(). |
|
Registers the current object as something that can be read from a Bam file.
Definition at line 320 of file palettePage.cxx. References fillin(), params, and parse_params(). |
|
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made more optimal).
Definition at line 256 of file palettePage.cxx. References get_class_type(), BamReader::get_factory(), and make_PalettePage(). |
|
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 282 of file palettePage.cxx. |
|
Removes the TexturePlacement from wherever it has been placed.
Definition at line 193 of file palettePage.cxx. References _images, and PaletteImage::optimal_resize(). Referenced by PaletteGroup::get_dependency_order(). |
|
Regenerates each PaletteImage on this page that needs it.
Definition at line 301 of file palettePage.cxx. References _group, DCAST_INTO_R, and NULL. |
|
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 338 of file palettePage.cxx. References _num_images, _properties, TextureProperties::fillin(), TypedWritable::fillin(), DatagramIterator::get_string(), DatagramIterator::get_uint32(), BamReader::read_pointer(), BamReader::read_pointers(), and Namable::set_name(). |
|
Writes a list of the PaletteImages associated with this page, and all of their textures, to the indicated output stream.
Definition at line 211 of file palettePage.cxx. References _images. Referenced by PaletteGroup::increment_egg_count(). |
|
Definition at line 77 of file palettePage.h. Referenced by get_properties(). |
|
Definition at line 73 of file palettePage.h. Referenced by PalettePage(), and update_images(). |
|
Definition at line 80 of file palettePage.h. Referenced by place_all(), setup_shadow_images(), unplace(), and write_image_info(). |
|
Definition at line 96 of file palettePage.h. Referenced by write_datagram(). |
|
Definition at line 74 of file palettePage.h. Referenced by write_datagram(). |
|
Reimplemented from Namable. Definition at line 36 of file palettePage.cxx. Referenced by init_type(). |