Panda3D
|
This is the highest level of grouping for TextureImages. More...
#include "paletteGroup.h"
Public Member Functions | |
void | add_texture_swap_info (const string sourceTextureName, const vector_string &swapTextures) |
Store textureswap information from textures.txa. | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
void | clear_depends () |
Eliminates all the dependency information for this group. | |
void | clear_name () |
Resets the Namable's name to empty. | |
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. | |
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. | |
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. | |
virtual void | finalize (BamReader *manager) |
This method is called by the BamReader after all pointers everywhere in the world have been completely read in. | |
virtual TypeHandle | force_init_type () |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. | |
int | get_best_parent_from_Set (const std::set< int > &) const |
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. | |
const string & | get_name () const |
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 |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
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. | |
bool | has_name () const |
Returns true if the Namable has a nonempty name set, false if the name is empty. | |
void | increment_egg_count () |
Increments by one the number of egg files that are known to reference this PaletteGroup. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_none_texture_swap () const |
Returns textureswap information is set or not, True if it's not set. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
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 | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void | optimal_resize () |
Attempts to resize each PalettteImage down to its smallest possible size. | |
void | output (ostream &out) const |
Outputs the Namable. | |
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. | |
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. | |
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 | set_name (const string &name) |
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. | |
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. | |
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 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. | |
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. | |
Static Public Attributes | |
static TypedWritable *const | Null = (TypedWritable*)0L |
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 |
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.
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.
ReferenceCount * TypedWritable::as_reference_count | ( | ) | [virtual, inherited] |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
Reimplemented in PandaNode, and TypedWritableReferenceCount.
Definition at line 155 of file typedWritable.cxx.
Referenced by BamReader::change_pointer(), BamReader::register_change_this(), and BamReader::resolve().
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
void PaletteGroup::clear_depends | ( | ) |
Eliminates all the dependency information for this group.
Definition at line 90 of file paletteGroup.cxx.
References PaletteGroups::clear().
Referenced by Palettizer::read_txa_file().
void Namable::clear_name | ( | ) | [inline, inherited] |
int PaletteGroup::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [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 713 of file paletteGroup.cxx.
References PaletteGroups::complete_pointers().
bool TypedWritable::decode_raw_from_bam_stream | ( | TypedWritable *& | ptr, |
ReferenceCount *& | ref_ptr, | ||
const string & | data, | ||
BamReader * | reader = NULL |
||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
Returns true on success, false on on error.
This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.
Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.
If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.
Definition at line 353 of file typedWritable.cxx.
References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().
string TypedWritable::encode_to_bam_stream | ( | ) | const [inline, inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 86 of file typedWritable.I.
bool TypedWritable::encode_to_bam_stream | ( | string & | data, |
BamWriter * | writer = NULL |
||
) | const [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
Definition at line 283 of file typedWritable.cxx.
References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().
void PaletteGroup::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
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 791 of file paletteGroup.cxx.
References PaletteGroups::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_int16(), DatagramIterator::get_int32(), DatagramIterator::get_string(), DatagramIterator::get_uint32(), and BamReader::read_pointers().
Referenced by make_PaletteGroup().
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().
UpdateSeq TypedWritable::get_bam_modified | ( | ) | const [inline, inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
Definition at line 66 of file typedWritable.I.
Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().
void PaletteGroup::get_complete_placements | ( | pvector< TexturePlacement * > & | placements | ) | const |
Adds the set of TexturePlacements associated with this group and all dependent groups to the indicated vector.
See get_placements().
Definition at line 181 of file paletteGroup.cxx.
References PaletteGroups::begin(), PaletteGroups::end(), get_placements(), and PaletteGroups::make_complete().
Referenced by Palettizer::report_statistics().
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 |
Returns the dependency order of this group.
This is similar in principle to the dependency level, but it represents the inverse concept: if group a depends on group b, then a->get_dependency_order() > b->get_dependency_order().
This is not exactly the same thing as n - get_dependency_level(). In particular, this can be used to sort the groups into an ordering such that all the groups that group a depends on appear before group a in the list.
Definition at line 321 of file paletteGroup.cxx.
Referenced by is_preferred_over(), and set_dependency_order().
const string & PaletteGroup::get_dirname | ( | ) | const |
Returns the directory name associated with the palette group.
See set_dirname().
Definition at line 79 of file paletteGroup.cxx.
Referenced by set_dependency_order(), and ImageFile::set_filename().
int PaletteGroup::get_dirname_order | ( | ) | const |
Returns the dependency order of this group.
This is similar in principle to the dependency level, but it represents the inverse concept: if group a depends on group b, then a->get_dirname_order() > b->get_dirname_order().
This is not exactly the same thing as n - get_dependency_level(). In particular, this can be used to sort the groups into an ordering such that all the groups that group a depends on appear before group a in the list.
Definition at line 341 of file paletteGroup.cxx.
Referenced by is_preferred_over(), and set_dependency_order().
int PaletteGroup::get_egg_count | ( | ) | const |
Returns the number of egg files that share this PaletteGroup.
Definition at line 387 of file paletteGroup.cxx.
Referenced by is_preferred_over().
const PaletteGroups & PaletteGroup::get_groups | ( | ) | const |
Returns the set of groups this group depends on.
Definition at line 120 of file paletteGroup.cxx.
Referenced by Palettizer::report_pi(), and Palettizer::report_statistics().
int PaletteGroup::get_margin_override | ( | ) | const |
Returns the set of groups this group depends on.
Definition at line 130 of file paletteGroup.cxx.
PalettePage * PaletteGroup::get_page | ( | const TextureProperties & | properties | ) |
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().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
void PaletteGroup::group_with | ( | PaletteGroup * | other | ) |
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 |
Returns true if the directory name has been explicitly set for this group.
If it has not, get_dirname() returns an empty string.
Definition at line 68 of file paletteGroup.cxx.
Referenced by Palettizer::get_default_group().
bool PaletteGroup::has_margin_override | ( | ) | const |
Returns the set of groups this group depends on.
Definition at line 151 of file paletteGroup.cxx.
bool Namable::has_name | ( | ) | const [inline, inherited] |
Returns true if the Namable has a nonempty name set, false if the name is empty.
Definition at line 75 of file namable.I.
Referenced by XFileNode::add_child(), EggComponentData::add_name(), Texture::do_read_dds_file(), Texture::do_read_one(), Character::fillin(), EggGroupUniquifier::get_category(), EggXfmSAnim::optimize(), NodePathComponent::output(), AsyncTask::output(), EggNamedObject::output(), EggSAnimData::write(), EggPrimitive::write_body(), ParametricCurveCollection::write_egg(), ParametricCurve::write_egg(), EggNamedObject::write_header(), XFileDataNodeTemplate::write_text(), and XFileDataDef::write_text().
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 TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool PaletteGroup::is_none_texture_swap | ( | ) | const |
Returns textureswap information is set or not, True if it's not set.
Definition at line 834 of file paletteGroup.cxx.
Referenced by TexturePlacement::determine_size().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
bool PaletteGroup::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.
In other words, this is a more specific group than the other one.
Definition at line 354 of file paletteGroup.cxx.
References get_dependency_order(), get_dirname_order(), and get_egg_count().
Referenced by TextureImage::assign_groups().
TypedWritable * PaletteGroup::make_PaletteGroup | ( | const FactoryParams & | params | ) | [static, protected] |
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 772 of file paletteGroup.cxx.
References fillin(), and BamReader::register_finalize().
Referenced by register_with_read_factory().
void TypedWritable::mark_bam_modified | ( | ) | [inline, inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
Definition at line 54 of file typedWritable.I.
Referenced by PandaNode::add_child(), PandaNode::add_stashed(), PandaNode::adjust_draw_mask(), PandaNode::apply_attribs_to_vertices(), PandaNode::clear_attrib(), PandaNode::clear_effect(), PandaNode::clear_tag(), PandaNode::copy_all_properties(), PandaNode::copy_tags(), PandaNode::disable_cull_callback(), PandaNode::force_bounds_stale(), PandaNode::remove_all_children(), PandaNode::remove_child(), PandaNode::remove_stashed(), PandaNode::reset_all_prev_transform(), PandaNode::reset_prev_transform(), PandaNode::set_attrib(), PandaNode::set_bounds(), PandaNode::set_bounds_type(), PandaNode::set_cull_callback(), PandaNode::set_effect(), PandaNode::set_effects(), PandaNode::set_final(), PandaNode::set_internal_bounds(), PandaNode::set_into_collide_mask(), PandaNode::set_prev_transform(), PandaNode::set_state(), PandaNode::set_tag(), PandaNode::set_transform(), PandaNode::stash_child(), and PandaNode::unstash_child().
void PaletteGroup::optimal_resize | ( | ) |
Attempts to resize each PalettteImage down to its smallest possible size.
Definition at line 601 of file paletteGroup.cxx.
References PalettePage::optimal_resize().
Referenced by Palettizer::optimal_resize().
void Namable::output | ( | ostream & | out | ) | const [inline, inherited] |
Outputs the Namable.
This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.
Reimplemented in AnimBundle, AnimChannelFixed< SwitchType >, AnimChannelMatrixFixed, AnimControl, AnimGroup, PartBundle, CollisionNode, CollisionTraverser, ButtonNode, EggNamedObject, AsyncTask, AsyncTaskChain, AsyncTaskManager, AdaptiveLru, Material, SimpleLru, HermiteCurve, RopeNode, SheetNode, Fog, GeomNode, LensNode, Loader, PandaNode, PlaneNode, PolylightNode, PortalNode, CallbackNode, FadeLODNode, LODNode, ForceNode, Thread, MouseRecorder, TextNode, MouseWatcherRegion, WebcamVideo, and MayaShader.
void PaletteGroup::place_all | ( | ) |
Once all the textures have been assigned to this group, try to place them all onto suitable PaletteImages.
Definition at line 489 of file paletteGroup.cxx.
References PalettePage::assign(), TexturePlacement::get_omit_reason(), get_page(), TexturePlacement::get_properties(), and PalettePage::place_all().
Referenced by Palettizer::process_all(), and Palettizer::process_command_line_eggs().
TexturePlacement * PaletteGroup::prepare | ( | TextureImage * | texture | ) |
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] |
Registers the current object as something that can be read from a Bam file.
Definition at line 664 of file paletteGroup.cxx.
References BamReader::get_factory(), and make_PaletteGroup().
bool TypedWritable::require_fully_complete | ( | ) | const [virtual, inherited] |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).
Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.
Definition at line 118 of file typedWritable.cxx.
void PaletteGroup::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().
Definition at line 203 of file paletteGroup.cxx.
Referenced by Palettizer::read_txa_file().
void PaletteGroup::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 617 of file paletteGroup.cxx.
References PalettePage::reset_images().
Referenced by Palettizer::reset_images().
void PaletteGroup::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.
Also cascades to all dependent groups. See get_dependency_level().
This call recurses to correctly set the dependency level of all PaletteGroups in the hierarchy.
Definition at line 222 of file paletteGroup.cxx.
References PaletteGroups::begin(), PaletteGroups::end(), and set_dependency_level().
Referenced by Palettizer::read_txa_file(), and set_dependency_level().
bool PaletteGroup::set_dependency_order | ( | ) |
Updates the dependency order of this group.
This number is the inverse of the dependency level, and can be used to rank the groups in order so that all the groups that a given group depends on will appear first in the list. See get_dependency_order().
This function returns true if anything was changed, false otherwise.
Definition at line 246 of file paletteGroup.cxx.
References PaletteGroups::begin(), PaletteGroups::end(), get_dependency_order(), get_dirname(), get_dirname_order(), and set_dependency_order().
Referenced by Palettizer::read_txa_file(), and set_dependency_order().
void PaletteGroup::set_dirname | ( | const string & | dirname | ) |
Sets the directory name associated with the palette group.
This is an optional feature that can be used to place the maps for the different palette groups into different install directories.
Definition at line 56 of file paletteGroup.cxx.
Referenced by Palettizer::get_default_group(), and Palettizer::read_txa_file().
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 | ( | ) |
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 634 of file paletteGroup.cxx.
References PalettePage::setup_shadow_images().
Referenced by Palettizer::all_params_set().
void PaletteGroup::unplace | ( | TexturePlacement * | placement | ) |
Removes the texture from its position on a PaletteImage, if it has been so placed.
Definition at line 467 of file paletteGroup.cxx.
References TexturePlacement::get_group(), TexturePlacement::get_page(), TexturePlacement::is_placed(), and PalettePage::unplace().
void TypedWritable::update_bam_nested | ( | BamWriter * | manager | ) | [virtual, inherited] |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
Reimplemented in CFDoCullCommand, and PandaNode.
Definition at line 77 of file typedWritable.cxx.
void PaletteGroup::update_images | ( | bool | redo_all | ) |
Regenerates each PaletteImage on this group that needs it.
Definition at line 649 of file paletteGroup.cxx.
References PalettePage::update_images().
Referenced by Palettizer::generate_images().
void PaletteGroup::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.
This may be necessary before we can properly place all of the textures.
Definition at line 519 of file paletteGroup.cxx.
References TexturePlacement::determine_size(), TexturePlacement::get_texture(), TextureImage::got_txa_file(), TexturePlacement::is_size_known(), TxaFile::match_texture(), TextureImage::post_txa_file(), and TextureImage::pre_txa_file().
Referenced by Palettizer::process_all(), and Palettizer::process_command_line_eggs().
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 677 of file paletteGroup.cxx.
References Datagram::add_bool(), Datagram::add_int16(), Datagram::add_int32(), Datagram::add_string(), Datagram::add_uint32(), PaletteGroups::write_datagram(), and BamWriter::write_pointer().
void PaletteGroup::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.
Definition at line 548 of file paletteGroup.cxx.
References TexturePlacement::get_omit_reason(), TexturePlacement::get_texture(), TexturePlacement::get_uv_area(), TexturePlacement::get_x_size(), TexturePlacement::get_y_size(), and PalettePage::write_image_info().
Referenced by Palettizer::report_pi().