|
|
|
This represents a single egg file known to the palettizer.
More...
#include "eggFile.h"
List of all members.
Public Member Functions |
| void | apply_properties_to_source () |
| | Calls apply_properties_to_source() for each texture reference, updating all the referenced source textures with the complete set of property information from this egg file.
|
| void | build_cross_links () |
| | Calls TextureImage::note_egg_file() and SourceTextureImage::increment_egg_count() for each texture the egg file references, and PaletteGroup::increment_egg_count() for each palette group it wants.
|
| void | choose_placements () |
| | Once all the textures have been assigned to groups (but before they may actually be placed), chooses a suitable TexturePlacement for each texture that appears in the egg file.
|
| void | clear_surprise () |
| | Removes the 'surprise' flag; this file has been successfully matched against a line in the .txa 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.
|
| bool | from_command_line (EggData *data, const Filename &source_filename, const Filename &dest_filename, const string &egg_comment) |
| | Accepts the information about the egg file as supplied from the command line.
|
| const PaletteGroups & | get_complete_groups () const |
| | Returns the complete set of PaletteGroups that the egg file is assigned to.
|
| PaletteGroup * | get_default_group () const |
| | Returns the PaletteGroup that was specified as the default group on the command line at the time the egg file last appeared on the command line.
|
| const PaletteGroups & | get_explicit_groups () const |
| | Returns the set of PaletteGroups that the egg file has been explicitly assigned to in the .txa file.
|
| const Filename & | get_source_filename () const |
| | Returns the filename this egg file was read from.
|
| void | get_textures (pset< TextureImage * > &result) const |
| | Fills up the indicated set with the set of textures referenced by this egg file.
|
|
virtual TypeHandle | get_type () const |
| bool | had_data () const |
| | Returns true if the EggData for this EggFile has ever been loaded in this session.
|
| bool | has_data () const |
| | Returns true if the EggData for this EggFile has been loaded, and not yet released.
|
| bool | is_stale () const |
| | Returns true if the egg file needs to be updated, i.e.
|
| bool | is_surprise () const |
| | Returns true if this particular egg file is a 'surprise', i.e.
|
| void | mark_stale () |
| | Marks this particular egg file as stale, meaning that something has changed, such as the location of a texture within its palette, which causes the egg file to need to be regenerated.
|
| void | match_txa_groups (const PaletteGroups &groups) |
| | Adds the indicated set of groups, read from the .txa file, to the set of groups to which the egg file is assigned.
|
| void | post_txa_file () |
| | Once the egg file has been matched against all of the matching lines the .txa file, do whatever adjustment is necessary.
|
| void | pre_txa_file () |
| | Does some processing prior to scanning the .txa file.
|
| bool | read_egg (bool noabs) |
| | Reads in the egg file from its _source_filename.
|
| void | release_egg_data () |
| | Releases the memory that was loaded by a previous call to read_egg().
|
| void | remove_egg () |
| | Removes this egg file from all things that reference it, in preparation for removing it from the database.
|
| void | scan_textures () |
| | Scans the egg file for texture references and updates the _textures list appropriately.
|
| void | update_egg () |
| | Once all textures have been placed appropriately, updates the egg file with all the information to reference the new textures.
|
| 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_description (ostream &out, int indent_level=0) const |
| | Writes a one-line description of the egg file and its group assignments to the indicated output stream.
|
| bool | write_egg () |
| | Writes out the egg file to its _dest_filename.
|
| void | write_texture_refs (ostream &out, int indent_level=0) const |
| | Writes the list of texture references to the indicated output stream, one per line.
|
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_EggFile (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.
|
Detailed Description
This represents a single egg file known to the palettizer.
It may reference a number of textures, and may also be assigned to a number of groups. All of its textures will try to assign themselves to one of its groups.
Definition at line 39 of file eggFile.h.
Member Function Documentation
Calls TextureImage::note_egg_file() and SourceTextureImage::increment_egg_count() for each texture the egg file references, and PaletteGroup::increment_egg_count() for each palette group it wants.
This sets up some of the back references to support determining an ideal texture assignment.
Definition at line 373 of file eggFile.cxx.
References PaletteGroups::begin(), PaletteGroups::clear(), PaletteGroups::empty(), PaletteGroups::end(), TextureReference::get_source(), TextureReference::get_texture(), SourceTextureImage::increment_egg_count(), PaletteGroups::insert(), PaletteGroups::make_complete(), and TextureImage::note_egg_file().
Once all the textures have been assigned to groups (but before they may actually be placed), chooses a suitable TexturePlacement for each texture that appears in the egg file.
This will be necessary to do at some point before writing out the egg file anyway, and doing it before the textures are placed allows us to decide what the necessary UV range is for each to-be-placed texture.
Definition at line 437 of file eggFile.cxx.
References PaletteGroups::begin(), PaletteGroups::count(), PaletteGroups::empty(), get_complete_groups(), TexturePlacement::get_group(), TextureImage::get_groups(), TextureImage::get_placement(), TextureReference::get_placement(), TextureReference::get_texture(), PaletteGroups::make_intersection(), and TextureReference::set_placement().
Referenced by Palettizer::read_stale_eggs().
Removes the 'surprise' flag; this file has been successfully matched against a line in the .txa file.
Definition at line 320 of file eggFile.cxx.
Referenced by TxaLine::match_egg().
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 836 of file eggFile.cxx.
References PaletteGroups::complete_pointers().
Returns true if this particular egg file is a 'surprise', i.e.
it wasn't matched by a line in the .txa file that didn't include the keyword 'cont'.
Definition at line 332 of file eggFile.cxx.
Referenced by Palettizer::report_pi().
Marks this particular egg file as stale, meaning that something has changed, such as the location of a texture within its palette, which causes the egg file to need to be regenerated.
Definition at line 345 of file eggFile.cxx.
Referenced by TextureReference::mark_egg_stale().
The documentation for this class was generated from the following files:
| | |