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