17 INLINE
void EggTexture::
18 set_texture_type(TextureType texture_type) {
19 _texture_type = texture_type;
21 bool pattern_filename =
22 (_texture_type == TT_3d_texture || _texture_type == TT_cube_map);
24 _filename.set_pattern(pattern_filename);
25 _fullpath.set_pattern(pattern_filename);
31 INLINE EggTexture::TextureType EggTexture::
32 get_texture_type()
const {
39 INLINE
void EggTexture::
40 set_format(Format format) {
47 INLINE EggTexture::Format EggTexture::
55 INLINE
void EggTexture::
56 set_compression_mode(CompressionMode mode) {
57 _compression_mode = mode;
63 INLINE EggTexture::CompressionMode EggTexture::
64 get_compression_mode()
const {
65 return _compression_mode;
71 INLINE
void EggTexture::
72 set_wrap_mode(WrapMode mode) {
79 INLINE EggTexture::WrapMode EggTexture::
80 get_wrap_mode()
const {
87 INLINE
void EggTexture::
88 set_wrap_u(WrapMode mode) {
108 return (_wrap_u == WM_unspecified) ? get_wrap_mode() :
get_wrap_u();
114 INLINE
void EggTexture::
115 set_wrap_v(WrapMode mode) {
135 return (_wrap_v == WM_unspecified) ? get_wrap_mode() :
get_wrap_v();
141 INLINE
void EggTexture::
142 set_wrap_w(WrapMode mode) {
162 return (_wrap_w == WM_unspecified) ? get_wrap_mode() :
get_wrap_w();
168 INLINE
void EggTexture::
169 set_minfilter(FilterType type) {
176 INLINE EggTexture::FilterType EggTexture::
177 get_minfilter()
const {
184 INLINE
void EggTexture::
185 set_magfilter(FilterType type) {
192 INLINE EggTexture::FilterType EggTexture::
193 get_magfilter()
const {
203 _anisotropic_degree = anisotropic_degree;
204 _flags |= F_has_anisotropic_degree;
212 _anisotropic_degree = 0;
213 _flags &= ~F_has_anisotropic_degree;
222 return (_flags & F_has_anisotropic_degree) != 0;
233 return _anisotropic_degree;
239 INLINE
void EggTexture::
240 set_env_type(EnvType type) {
247 INLINE EggTexture::EnvType EggTexture::
248 get_env_type()
const {
255 INLINE
void EggTexture::
256 set_combine_mode(CombineChannel channel, CombineMode cm) {
257 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
258 _combiner[channel]._mode = cm;
264 INLINE EggTexture::CombineMode EggTexture::
265 get_combine_mode(CombineChannel channel)
const {
266 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CM_unspecified);
267 return _combiner[channel]._mode;
273 INLINE
void EggTexture::
274 set_combine_source(CombineChannel channel,
int n, CombineSource cs) {
275 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
276 nassertv(n >= 0 && n < (
int)CI_num_indices);
277 _combiner[channel]._ops[n]._source = cs;
283 INLINE EggTexture::CombineSource EggTexture::
284 get_combine_source(CombineChannel channel,
int n)
const {
285 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CS_unspecified);
286 nassertr(n >= 0 && n < (
int)CI_num_indices, CS_unspecified);
287 return _combiner[channel]._ops[n]._source;
293 INLINE
void EggTexture::
294 set_combine_operand(CombineChannel channel,
int n, CombineOperand co) {
295 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
296 nassertv(n >= 0 && n < (
int)CI_num_indices);
297 _combiner[channel]._ops[n]._operand = co;
303 INLINE EggTexture::CombineOperand EggTexture::
304 get_combine_operand(CombineChannel channel,
int n)
const {
305 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CO_unspecified);
306 nassertr(n >= 0 && n < (
int)CI_num_indices, CO_unspecified);
307 return _combiner[channel]._ops[n]._operand;
325 _saved_result = saved_result;
334 return _saved_result;
340 INLINE
void EggTexture::
341 set_tex_gen(TexGen tex_gen) {
348 INLINE EggTexture::TexGen EggTexture::
349 get_tex_gen()
const {
356 INLINE
void EggTexture::
357 set_quality_level(QualityLevel quality_level) {
358 _quality_level = quality_level;
364 INLINE EggTexture::QualityLevel EggTexture::
365 get_quality_level()
const {
366 return _quality_level;
380 _stage_name = stage_name;
381 _flags |= F_has_stage_name;
389 _stage_name = std::string();
390 _flags &= ~F_has_stage_name;
399 return (_flags & F_has_stage_name) != 0;
418 _priority = priority;
419 _flags |= F_has_priority;
429 _flags &= ~F_has_priority;
438 return (_flags & F_has_priority) != 0;
453 INLINE
void EggTexture::
454 set_color(
const LColor &color) {
456 _flags |= F_has_color;
462 INLINE
void EggTexture::
464 _color.set(0.0f, 0.0f, 0.0f, 1.0f);
465 _flags &= ~F_has_color;
473 return (_flags & F_has_color) != 0;
488 INLINE
void EggTexture::
489 set_border_color(
const LColor &border_color) {
490 _border_color = border_color;
491 _flags |= F_has_border_color;
497 INLINE
void EggTexture::
498 clear_border_color() {
499 _border_color.set(0.0f, 0.0f, 0.0f, 1.0f);
500 _flags &= ~F_has_border_color;
508 return (_flags & F_has_border_color) != 0;
517 return _border_color;
530 if (uv_name ==
"default" || uv_name.empty()) {
534 _flags |= F_has_uv_name;
544 _uv_name = std::string();
545 _flags &= ~F_has_uv_name;
554 return (_flags & F_has_uv_name) != 0;
575 _rgb_scale = rgb_scale;
576 _flags |= F_has_rgb_scale;
586 _flags &= ~F_has_rgb_scale;
595 return (_flags & F_has_rgb_scale) != 0;
616 _alpha_scale = alpha_scale;
617 _flags |= F_has_alpha_scale;
627 _flags &= ~F_has_alpha_scale;
636 return (_flags & F_has_alpha_scale) != 0;
655 _alpha_filename = alpha_filename;
656 _alpha_fullpath = alpha_filename;
657 _flags |= F_has_alpha_filename;
663 INLINE
void EggTexture::
664 clear_alpha_filename() {
667 _flags &= ~F_has_alpha_filename;
676 return (_flags & F_has_alpha_filename) != 0;
687 return _alpha_filename;
702 return _alpha_fullpath;
711 _alpha_fullpath = alpha_fullpath;
724 _alpha_file_channel = alpha_file_channel;
725 _flags |= F_has_alpha_file_channel;
734 _alpha_file_channel = 0;
735 _flags &= ~F_has_alpha_file_channel;
744 return (_flags & F_has_alpha_file_channel) != 0;
754 return _alpha_file_channel;
769 _multiview = multiview;
787 _num_views = num_views;
788 _flags |= F_has_num_views;
798 _flags &= ~F_has_num_views;
807 return (_flags & F_has_num_views) != 0;
833 _read_mipmaps = read_mipmaps;
842 return _read_mipmaps;
851 _flags |= F_has_min_lod;
860 _flags &= ~F_has_min_lod;
869 return (_flags & F_has_min_lod) != 0;
886 _flags |= F_has_max_lod;
895 _flags &= ~F_has_max_lod;
904 return (_flags & F_has_max_lod) != 0;
920 _lod_bias = lod_bias;
921 _flags |= F_has_lod_bias;
930 _flags &= ~F_has_lod_bias;
939 return (_flags & F_has_lod_bias) != 0;
959 return _multitexture_sort;
965 INLINE EggTexture::SourceAndOperand::
967 _source(CS_unspecified),
968 _operand(CO_unspecified)
975 INLINE EggTexture::Combiner::
977 _mode(CM_unspecified)
984 INLINE UniqueEggTextures::
985 UniqueEggTextures(
int eq) : _eq(eq) {
991 INLINE
bool UniqueEggTextures::