|
|
|
This is the particular reference of a texture filename by an egg file.
More...
#include "textureReference.h"
List of all members.
Public Member Functions |
| void | apply_properties_to_source () |
| | Applies the texture properties as read from the egg file to the source image's properties.
|
| void | clear_placement () |
| | Removes any reference to a TexturePlacement.
|
| 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.
|
| void | from_egg (EggFile *egg_file, EggData *data, EggTexture *egg_tex) |
| | Sets up the TextureReference using information extracted from an egg file.
|
| void | from_egg_quick (const TextureReference &other) |
| | Sets up the pointers within the TextureReference to the same egg file pointers indicated by the other TextureReference object, without changing any of the other internal data stored here regarding the egg structures.
|
| EggFile * | get_egg_file () const |
| | Returns the EggFile that references this texture.
|
| const LTexCoordd & | get_max_uv () const |
| | Returns the maximum UV coordinate in use for the texture by this reference.
|
| const LTexCoordd & | get_min_uv () const |
| | Returns the minimum UV coordinate in use for the texture by this reference.
|
| TexturePlacement * | get_placement () const |
| | Returns the particular TexturePlacement that is appropriate for this egg file.
|
| SourceTextureImage * | get_source () const |
| | Returns the SourceTextureImage that this object refers to.
|
| TextureImage * | get_texture () const |
| | Returns the TextureImage that this object refers to.
|
| const string & | get_tref_name () const |
| | Returns the name of the EggTexture entry that references this texture.
|
|
virtual TypeHandle | get_type () const |
| EggTexture::WrapMode | get_wrap_u () const |
| | Returns the specification for the wrapping in the U direction.
|
| EggTexture::WrapMode | get_wrap_v () const |
| | Returns the specification for the wrapping in the V direction.
|
| bool | has_uvs () const |
| | Returns true if this TextureReference actually uses the texture on geometry, with UV's and everything, or false otherwise.
|
| bool | is_equivalent (const TextureReference &other) const |
| | Returns true if all essential properties of this TextureReference are the same as that of the other, or false if any of them differ.
|
| void | mark_egg_stale () |
| | Marks the egg file that shares this reference as stale.
|
| bool | operator< (const TextureReference &other) const |
| | Defines an ordering of TextureReference pointers in alphabetical order by their tref name.
|
|
void | output (ostream &out) const |
| void | rebind_egg_data (EggData *data, EggTexture *egg_tex) |
| | After an EggData has previously been released via release_egg_data(), this can be called to indicate that the egg file has been reloaded and we should assign the indicated pointers.
|
| void | release_egg_data () |
| | Called to indicate that the EggData previously passed to from_egg() is about to be deallocated, and all of its pointers should be cleared.
|
| void | set_placement (TexturePlacement *placement) |
| | Sets the particular TexturePlacement that is appropriate for this egg file.
|
| void | update_egg () |
| | Updates the egg file with all the relevant information to reference the texture in its new home, wherever that might be.
|
|
void | write (ostream &out, int indent_level=0) const |
| 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.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
| 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_TextureReference (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 is the particular reference of a texture filename by an egg file.
It also includes information about the way in which the egg file uses the texture; e.g. does it repeat.
Definition at line 43 of file textureReference.h.
Member Function Documentation
| void TextureReference::apply_properties_to_source |
( |
| ) |
|
| void TextureReference::clear_placement |
( |
| ) |
|
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 940 of file textureReference.cxx.
References TextureProperties::complete_pointers().
Sets up the TextureReference using information extracted from an egg file.
Definition at line 79 of file textureReference.cxx.
References EggTexture::determine_wrap_u(), EggTexture::determine_wrap_v(), EggTexture::get_alpha_file_channel(), EggTexture::get_alpha_filename(), EggRenderMode::get_alpha_mode(), EggTexture::get_anisotropic_degree(), Filename::get_basename_wo_extension(), EggFilenameNode::get_filename(), ImageFile::get_num_channels(), SourceTextureImage::get_size(), TextureImage::get_source(), Palettizer::get_texture(), EggTransform::get_transform2d(), EggTexture::has_alpha_channel(), EggTexture::has_alpha_filename(), EggTransform::has_transform2d(), LMatrix3d::ident_mat(), LMatrix3d::invert_from(), and ImageFile::update_properties().
Referenced by EggFile::scan_textures().
Sets up the pointers within the TextureReference to the same egg file pointers indicated by the other TextureReference object, without changing any of the other internal data stored here regarding the egg structures.
This is intended for use when we have already shown that the two TextureReferences describe equivalent data.
Definition at line 157 of file textureReference.cxx.
Referenced by EggFile::scan_textures().
| EggFile * TextureReference::get_egg_file |
( |
| ) |
const |
| const LTexCoordd & TextureReference::get_max_uv |
( |
| ) |
const |
| const LTexCoordd & TextureReference::get_min_uv |
( |
| ) |
const |
| const string & TextureReference::get_tref_name |
( |
| ) |
const |
| EggTexture::WrapMode TextureReference::get_wrap_u |
( |
| ) |
const |
| EggTexture::WrapMode TextureReference::get_wrap_v |
( |
| ) |
const |
| bool TextureReference::has_uvs |
( |
| ) |
const |
| static void TextureReference::init_type |
( |
| ) |
[inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from TypedWritable.
Definition at line 127 of file textureReference.h.
| void TextureReference::mark_egg_stale |
( |
| ) |
|
| void TextureReference::register_with_read_factory |
( |
| ) |
[static] |
| void TextureReference::release_egg_data |
( |
| ) |
|
| void TextureReference::update_egg |
( |
| ) |
|
Updates the egg file with all the relevant information to reference the texture in its new home, wherever that might be.
Definition at line 413 of file textureReference.cxx.
References TexturePlacement::compute_tex_matrix(), TextureImage::get_alpha_mode(), Filename::get_basename(), TexturePlacement::get_dest(), EggFilenameNode::get_filename(), TexturePlacement::get_image(), ImageFile::get_num_channels(), TexturePlacement::get_omit_reason(), get_texture(), TextureImage::get_txa_wrap_u(), TextureImage::get_txa_wrap_v(), EggTexture::has_alpha_channel(), ImageFile::has_num_channels(), EggRenderMode::set_alpha_mode(), EggTransform::set_transform2d(), and ImageFile::update_egg_tex().
Referenced by EggFile::update_egg().
| void TextureReference::write_datagram |
( |
BamWriter * |
writer, |
|
|
Datagram & |
datagram |
|
) |
| [virtual] |
The documentation for this class was generated from the following files:
| | |