14 #ifndef PALETTEGROUP_H 15 #define PALETTEGROUP_H 96 int _dependency_level;
97 int _dependency_order;
126 bool _has_margin_override;
127 int _margin_override;
134 static void init_type() {
135 TypedWritable::init_type();
136 Namable::init_type();
138 TypedWritable::get_class_type(),
139 Namable::get_class_type());
142 return get_class_type();
void setup_shadow_images()
Ensures that each PaletteImage's _shadow_image has the correct filename and image types,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 i...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 PaletteIm...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static void register_with_read_factory()
Registers the current object as something that can be read from a Bam file.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
This is the highest level of grouping for TextureImages.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void unplace(TexturePlacement *placement)
Removes the texture from its position on a PaletteImage, if it has been so placed.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void group_with(PaletteGroup *other)
Indicates a dependency of this group on some other group.
This is a particular collection of textures, within a PaletteGroup, that all share the same TexturePr...
bool has_margin_override() const
Returns the set of groups this group depends on.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_none_texture_swap() const
Returns textureswap information is set or not, True if it's not set.
void reset_dependency_level()
Unconditionally sets the dependency level and order of this group to zero, in preparation for a later...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_dirname_order() const
Returns the dependency order of this group.
A base class for all things which can have a name.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
const std::string & get_dirname() const
Returns the directory name associated with the palette group.
This corresponds to a particular assignment of a TextureImage with a PaletteGroup,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void update_images(bool redo_all)
Regenerates each PaletteImage on this group that needs it.
int get_dependency_level() const
Returns the dependency level of this group.
void add_texture_swap_info(const std::string sourceTextureName, const vector_string &swapTextures)
Store textureswap information from textures.txa.
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...
void set_dependency_level(int level)
Sets the dependency level of this group to the indicated level, provided that level is not lower than...
PalettePage * get_page(const TextureProperties &properties)
Returns the page associated with the indicated properties.
void set_dirname(const std::string &dirname)
Sets the directory name associated with the palette group.
void reset_images()
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made m...
bool set_dependency_order()
Updates the dependency order of this group.
void get_placements(pvector< TexturePlacement * > &placements) const
Adds the set of TexturePlacements associated with this group to the indicated vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool has_dirname() const
Returns true if the directory name has been explicitly set for this group.
void get_complete_placements(pvector< TexturePlacement * > &placements) const
Adds the set of TexturePlacements associated with this group and all dependent groups to the indicate...
void increment_egg_count()
Increments by one the number of egg files that are known to reference this PaletteGroup.
bool is_preferred_over(const PaletteGroup &other) const
Returns true if this group should be preferred for adding textures over the other group,...
virtual void finalize(BamReader *manager)
This method is called by the BamReader after all pointers everywhere in the world have been completel...
TexturePlacement * prepare(TextureImage *texture)
Marks the indicated Texture as ready for placing somewhere within this group, and returns a placehold...
A class to retrieve the individual data elements previously stored in a Datagram.
This represents a single source texture that is referenced by one or more egg files.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void write_datagram(BamWriter *writer, Datagram &datagram)
Fills the indicated datagram up with a binary representation of the current object,...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
const PaletteGroups & get_groups() const
Returns the set of groups this group depends on.
int get_egg_count() const
Returns the number of egg files that share this PaletteGroup.
void clear_depends()
Eliminates all the dependency information for this group.
int get_dependency_order() const
Returns the dependency order of this group.
This represents a single egg file known to the palettizer.
This represents the .txa file (usually textures.txa) that contains the user instructions for resizing...
int get_margin_override() const
Returns the set of groups this group depends on.
void set_margin_override(const int override)
Returns the set of groups this group depends on.
void write_image_info(std::ostream &out, int indent_level=0) const
Writes a list of the PaletteImages associated with this group, and all of their textures,...
This is the set of characteristics of a texture that, if different from another texture,...