Panda3D
 All Classes Functions Variables Enumerations
textureStage.cxx
1 // Filename: textureStage.cxx
2 // Created by: MAsaduzz (16Jul04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "textureStage.h"
16 #include "internalName.h"
17 #include "bamReader.h"
18 #include "bamWriter.h"
19 
20 PT(TextureStage) TextureStage::_default_stage;
21 UpdateSeq TextureStage::_sort_seq;
22 
23 TypeHandle TextureStage::_type_handle;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: TextureStage::Constructor
27 // Access: Published
28 // Description: Initialize the texture stage at construction
29 ////////////////////////////////////////////////////////////////////
31 TextureStage(const string &name) {
32  _name = name;
33  _sort = 0;
34  _priority = 0;
35  _texcoord_name = InternalName::get_texcoord();
36  _mode = M_modulate;
37  _color.set(0.0f, 0.0f, 0.0f, 1.0f);
38  _rgb_scale = 1;
39  _alpha_scale = 1;
40  _saved_result = false;
41  _tex_view_offset = 0;
42  _combine_rgb_mode = CM_undefined;
43  _num_combine_rgb_operands = 0;
44  _combine_rgb_source0 = CS_undefined;
45  _combine_rgb_operand0 = CO_undefined;
46  _combine_rgb_source1 = CS_undefined;
47  _combine_rgb_operand1 = CO_undefined;
48  _combine_rgb_source2 = CS_undefined;
49  _combine_rgb_operand2 = CO_undefined;
50  _combine_alpha_mode = CM_undefined;
51  _num_combine_alpha_operands = 0;
52  _combine_alpha_source0 = CS_undefined;
53  _combine_alpha_operand0 = CO_undefined;
54  _combine_alpha_source1 = CS_undefined;
55  _combine_alpha_operand1 = CO_undefined;
56  _combine_alpha_source2 = CS_undefined;
57  _combine_alpha_operand2 = CO_undefined;
58 
59  _uses_color = false;
60  _involves_color_scale = false;
61 }
62 
63 ////////////////////////////////////////////////////////////////////
64 // Function: TextureStage::operator =
65 // Access: Published
66 // Description: just copy the members of other to this
67 ////////////////////////////////////////////////////////////////////
68 void TextureStage::
69 operator = (const TextureStage &other) {
70  _name = other._name;
71  _sort = other._sort;
72  _priority = other._priority;
73  _texcoord_name = other._texcoord_name;
74  _mode = other._mode;
75  _color = other._color;
76  _rgb_scale = other._rgb_scale;
77  _alpha_scale = other._alpha_scale;
78  _saved_result = other._saved_result;
79  _tex_view_offset = other._tex_view_offset;
80 
81  _combine_rgb_mode = other._combine_rgb_mode;
82  _combine_rgb_source0 = other._combine_rgb_source0;
83  _combine_rgb_operand0 = other._combine_rgb_operand0;
84  _combine_rgb_source1 = other._combine_rgb_source1;
85  _combine_rgb_operand1 = other._combine_rgb_operand1;
86  _combine_rgb_source2 = other._combine_rgb_source2;
87  _combine_rgb_operand2 = other._combine_rgb_operand2;
88  _combine_alpha_mode = other._combine_alpha_mode;
89  _combine_alpha_source0 = other._combine_alpha_source0;
90  _combine_alpha_operand0 = _combine_alpha_operand0;
91  _combine_alpha_source1 = other._combine_alpha_source1;
92  _combine_alpha_operand1 = other._combine_alpha_operand1;
93  _combine_alpha_source2 = other._combine_alpha_source2;
94  _combine_alpha_operand2 = other._combine_alpha_operand2;
95 
96  _uses_color = other._uses_color;
97  _involves_color_scale = other._involves_color_scale;
98 }
99 
100 ////////////////////////////////////////////////////////////////////
101 // Function: TextureStage::Destructor
102 // Access: Published, Virtual
103 // Description:
104 ////////////////////////////////////////////////////////////////////
105 TextureStage::
106 ~TextureStage() {
107 }
108 
109 ////////////////////////////////////////////////////////////////////
110 // Function: TextureStage::compare_to
111 // Access: Published
112 // Description: Returns a number less than zero if this TextureStage
113 // sorts before the other one, greater than zero if it
114 // sorts after, or zero if they are equivalent. The
115 // sorting order is arbitrary and largely meaningless,
116 // except to differentiate different stages.
117 ////////////////////////////////////////////////////////////////////
118 int TextureStage::
119 compare_to(const TextureStage &other) const {
120  // We put the sort parameter first, so that we sorting a list of
121  // TextureStages will happen to put them in sorted order, even
122  // though we don't promise to do that. But there's no reason not to
123  // do so, and it might be more convenient for the developer.
124  if (get_sort() != other.get_sort()) {
125  return get_sort() < other.get_sort() ? -1 : 1;
126  }
127 
128  // The remaining parameters are arbitrary. We start with the name,
129  // because that's most likely to be consistent between similar
130  // TextureStages, and different between different TextureStages.
131  int compare = strcmp(get_name().c_str(), other.get_name().c_str());
132  if (compare != 0) {
133  return compare;
134  }
135 
136  if (get_priority() != other.get_priority()) {
137  return get_priority() < other.get_priority() ? -1 : 1;
138  }
139  if (get_texcoord_name() != other.get_texcoord_name()) {
140  return get_texcoord_name() < other.get_texcoord_name() ? -1 : 1;
141  }
142  if (get_mode() != other.get_mode()) {
143  return get_mode() < other.get_mode() ? -1 : 1;
144  }
145  if (get_rgb_scale() != other.get_rgb_scale()) {
146  return get_rgb_scale() < other.get_rgb_scale() ? -1 : 1;
147  }
148  if (get_alpha_scale() != other.get_alpha_scale()) {
149  return get_alpha_scale() < other.get_alpha_scale() ? -1 : 1;
150  }
151  if (get_saved_result() != other.get_saved_result()) {
152  return get_saved_result() < other.get_saved_result() ? -1 : 1;
153  }
154  if (get_tex_view_offset() != other.get_tex_view_offset()) {
155  return get_tex_view_offset() < other.get_tex_view_offset() ? -1 : 1;
156  }
157  if (get_mode() == M_combine) {
158  if (get_combine_rgb_mode() != other.get_combine_rgb_mode()) {
159  return get_combine_rgb_mode() < other.get_combine_rgb_mode() ? -1 : 1;
160  }
161 
164  }
165  if (get_num_combine_rgb_operands() >= 1) {
167  return get_combine_rgb_source0() < other.get_combine_rgb_source0() ? -1 : 1;
168  }
170  return get_combine_rgb_operand0() < other.get_combine_rgb_operand0() ? -1 : 1;
171  }
172  }
173  if (get_num_combine_rgb_operands() >= 2) {
175  return get_combine_rgb_source1() < other.get_combine_rgb_source1() ? -1 : 1;
176  }
178  return get_combine_rgb_operand1() < other.get_combine_rgb_operand1() ? -1 : 1;
179  }
180  }
181  if (get_num_combine_rgb_operands() >= 3) {
183  return get_combine_rgb_source2() < other.get_combine_rgb_source2() ? -1 : 1;
184  }
186  return get_combine_rgb_operand2() < other.get_combine_rgb_operand2() ? -1 : 1;
187  }
188  }
190  return get_combine_alpha_mode() < other.get_combine_alpha_mode() ? -1 : 1;
191  }
192 
195  }
196  if (get_num_combine_alpha_operands() >= 1) {
198  return get_combine_alpha_source0() < other.get_combine_alpha_source0() ? -1 : 1;
199  }
201  return get_combine_alpha_operand0() < other.get_combine_alpha_operand0() ? -1 : 1;
202  }
203  }
204  if (get_num_combine_alpha_operands() >= 2) {
206  return get_combine_alpha_source1() < other.get_combine_alpha_source1() ? -1 : 1;
207  }
209  return get_combine_alpha_operand1() < other.get_combine_alpha_operand1() ? -1 : 1;
210  }
211  }
212  if (get_num_combine_alpha_operands() >= 3) {
214  return get_combine_alpha_source2() < other.get_combine_alpha_source2() ? -1 : 1;
215  }
217  return get_combine_alpha_operand2() < other.get_combine_alpha_operand2() ? -1 : 1;
218  }
219  }
220  }
221 
222  return 0;
223 }
224 
225 ////////////////////////////////////////////////////////////////////
226 // Function: TextureStage::Destructor
227 // Access: Published
228 // Description: Writes the details of this stage
229 ////////////////////////////////////////////////////////////////////
230 void TextureStage::
231 write(ostream &out) const {
232  out << "TextureStage " << get_name() << ", sort = " << get_sort() << ", priority = " << get_priority() << "\n"
233  << " texcoords = " << get_texcoord_name()->get_name()
234  << ", mode = " << get_mode() << ", color = " << get_color()
235  << ", scale = " << get_rgb_scale() << ", " << get_alpha_scale()
236  << ", saved_result = " << get_saved_result()
237  << ", tex_view_offset = " << get_tex_view_offset() << "\n";
238 
239  if (get_mode() == M_combine) {
240  out << " RGB combine mode = " << get_combine_rgb_mode() << "\n";
241  if (get_num_combine_rgb_operands() >= 1) {
242  out << " 0: " << get_combine_rgb_source0() << ", "
243  << get_combine_rgb_operand0() << "\n";
244  }
245  if (get_num_combine_rgb_operands() >= 2) {
246  out << " 1: " << get_combine_rgb_source1() << ", "
247  << get_combine_rgb_operand1() << "\n";
248  }
249  if (get_num_combine_rgb_operands() >= 3) {
250  out << " 2: " << get_combine_rgb_source2() << ", "
251  << get_combine_rgb_operand2() << "\n";
252  }
253  out << " alpha combine mode = " << get_combine_alpha_mode() << "\n";
254  if (get_num_combine_alpha_operands() >= 1) {
255  out << " 0: " << get_combine_alpha_source0() << ", "
256  << get_combine_alpha_operand0() << "\n";
257  }
258  if (get_num_combine_alpha_operands() >= 2) {
259  out << " 1: " << get_combine_alpha_source1() << ", "
260  << get_combine_alpha_operand1() << "\n";
261  }
262  if (get_num_combine_alpha_operands() >= 3) {
263  out << " 2: " << get_combine_alpha_source2() << ", "
264  << get_combine_alpha_operand2() << "\n";
265  }
266  }
267 }
268 
269 ////////////////////////////////////////////////////////////////////
270 // Function: TextureStage::Destructor
271 // Access: Published
272 // Description: Just a single line output
273 ////////////////////////////////////////////////////////////////////
274 void TextureStage::
275 output(ostream &out) const {
276  out << "TextureStage " << get_name();
277 }
278 
279 ////////////////////////////////////////////////////////////////////
280 // Function: TextureStage::get_expected_num_combine_operands
281 // Access: Private, Static
282 // Description: Returns the number of combine operands expected with
283 // the indicated combine mode (0, 1, 2, or 3).
284 ////////////////////////////////////////////////////////////////////
285 int TextureStage::
286 get_expected_num_combine_operands(TextureStage::CombineMode cm) {
287  switch (cm) {
288  case CM_undefined:
289  return 0;
290 
291  case CM_replace:
292  return 1;
293 
294  case CM_modulate:
295  case CM_add:
296  case CM_add_signed:
297  case CM_subtract:
298  case CM_dot3_rgb:
299  case CM_dot3_rgba:
300  return 2;
301 
302  case CM_interpolate:
303  return 3;
304  }
305 
306  return 0;
307 }
308 
309 ////////////////////////////////////////////////////////////////////
310 // Function: TextureStage::operand_valid_for_rgb
311 // Access: Private, Static
312 // Description: Returns true if the indicated CombineOperand is valid
313 // for one of the RGB modes, false otherwise.
314 ////////////////////////////////////////////////////////////////////
315 bool TextureStage::
316 operand_valid_for_rgb(TextureStage::CombineOperand co) {
317  switch (co) {
318  case CO_undefined:
319  return false;
320 
321  case CO_src_color:
322  case CO_one_minus_src_color:
323  case CO_src_alpha:
324  case CO_one_minus_src_alpha:
325  return true;
326  }
327 
328  return false;
329 }
330 
331 ////////////////////////////////////////////////////////////////////
332 // Function: TextureStage::operand_valid_for_alpha
333 // Access: Private, Static
334 // Description: Returns true if the indicated CombineOperand is valid
335 // for one of the alpha modes, false otherwise.
336 ////////////////////////////////////////////////////////////////////
337 bool TextureStage::
338 operand_valid_for_alpha(TextureStage::CombineOperand co) {
339  switch (co) {
340  case CO_undefined:
341  case CO_src_color:
342  case CO_one_minus_src_color:
343  return false;
344 
345  case CO_src_alpha:
346  case CO_one_minus_src_alpha:
347  return true;
348  }
349 
350  return false;
351 }
352 
353 ////////////////////////////////////////////////////////////////////
354 // Function: TextureStage::register_with_read_factory
355 // Access: Public, Static
356 // Description: Factory method to generate a TextureStage object
357 ////////////////////////////////////////////////////////////////////
358 void TextureStage::
361 }
362 
363 ////////////////////////////////////////////////////////////////////
364 // Function: TextureStage::make_TextureStage
365 // Access: Protected
366 // Description: Factory method to generate a TextureStage object
367 ////////////////////////////////////////////////////////////////////
370  DatagramIterator scan;
371  BamReader *manager;
372 
373  parse_params(params, scan, manager);
374 
375  bool is_default = scan.get_bool();
376  if (is_default) {
377  return get_default();
378  } else {
379  TextureStage *me = new TextureStage("");
380  me->fillin(scan, manager);
381  return me;
382  }
383 }
384 
385 ////////////////////////////////////////////////////////////////////
386 // Function: TextureStage::fillin
387 // Access: Protected
388 // Description: Function that reads out of the datagram (or asks
389 // manager to read) all of the data that is needed to
390 // re-create this object and stores it in the appropiate
391 // place
392 ////////////////////////////////////////////////////////////////////
393 void TextureStage::
394 fillin(DatagramIterator &scan, BamReader *manager) {
395  _name = scan.get_string();
396  _sort = scan.get_int32();
397  _priority = scan.get_int32();
398 
399  manager->read_pointer(scan);
400 
401  _mode = (TextureStage::Mode) scan.get_uint8();
402  _color.read_datagram(scan);
403 
404  _rgb_scale = scan.get_uint8();
405  _alpha_scale = scan.get_uint8();
406  _saved_result = scan.get_bool();
407  _tex_view_offset = 0;
408  if (manager->get_file_minor_ver() >= 26) {
409  _tex_view_offset = scan.get_int32();
410  }
411 
412  _combine_rgb_mode = (TextureStage::CombineMode) scan.get_uint8();
413  _num_combine_rgb_operands = scan.get_uint8();
414  _combine_rgb_source0 = (TextureStage::CombineSource) scan.get_uint8();
415  _combine_rgb_operand0 = (TextureStage::CombineOperand) scan.get_uint8();
416  _combine_rgb_source1 = (TextureStage::CombineSource) scan.get_uint8();
417  _combine_rgb_operand1 = (TextureStage::CombineOperand) scan.get_uint8();
418  _combine_rgb_source2 = (TextureStage::CombineSource) scan.get_uint8();
419  _combine_rgb_operand2 = (TextureStage::CombineOperand) scan.get_uint8();
420 
421  _combine_alpha_mode = (TextureStage::CombineMode) scan.get_uint8();
422  _num_combine_alpha_operands = scan.get_uint8();
423  _combine_alpha_source0 = (TextureStage::CombineSource) scan.get_uint8();
424  _combine_alpha_operand0 = (TextureStage::CombineOperand) scan.get_uint8();
425  _combine_alpha_source1 = (TextureStage::CombineSource) scan.get_uint8();
426  _combine_alpha_operand1 = (TextureStage::CombineOperand) scan.get_uint8();
427  _combine_alpha_source2 = (TextureStage::CombineSource) scan.get_uint8();
428  _combine_alpha_operand2 = (TextureStage::CombineOperand) scan.get_uint8();
429 
430  update_color_flags();
431 }
432 
433 ////////////////////////////////////////////////////////////////////
434 // Function: TextureStage::complete_pointers
435 // Access: Public, Virtual
436 // Description: Receives an array of pointers, one for each time
437 // manager->read_pointer() was called in fillin().
438 // Returns the number of pointers processed.
439 ////////////////////////////////////////////////////////////////////
440 int TextureStage::
442  int pi = TypedWritableReferenceCount::complete_pointers(p_list, manager);
443 
444  _texcoord_name = DCAST(InternalName, p_list[pi++]);
445 
446  return pi;
447 }
448 
449 ////////////////////////////////////////////////////////////////////
450 // Function: TextureStage::write_datagram
451 // Access: Public
452 // Description: Function to write the important information in
453 // the particular object to a Datagram
454 ////////////////////////////////////////////////////////////////////
455 void TextureStage::
457  // These properties are read in again by fillin(), above.
458  if (this == get_default()) {
459  me.add_bool(true);
460  } else {
461  me.add_bool(false);
462  me.add_string(_name);
463  me.add_int32(_sort);
464  me.add_int32(_priority);
465 
466  manager->write_pointer(me, _texcoord_name);
467 
468  me.add_uint8(_mode);
469  _color.write_datagram(me);
470  me.add_uint8(_rgb_scale);
471  me.add_uint8(_alpha_scale);
472  me.add_bool(_saved_result);
473  me.add_int32(_tex_view_offset);
474 
475  me.add_uint8(_combine_rgb_mode);
476  me.add_uint8(_num_combine_rgb_operands);
477  me.add_uint8(_combine_rgb_source0);
478  me.add_uint8(_combine_rgb_operand0);
479  me.add_uint8(_combine_rgb_source1);
480  me.add_uint8(_combine_rgb_operand1);
481  me.add_uint8(_combine_rgb_source2);
482  me.add_uint8(_combine_rgb_operand2);
483 
484  me.add_uint8(_combine_alpha_mode);
485  me.add_uint8(_num_combine_alpha_operands);
486  me.add_uint8(_combine_alpha_source0);
487  me.add_uint8(_combine_alpha_operand0);
488  me.add_uint8(_combine_alpha_source1);
489  me.add_uint8(_combine_alpha_operand1);
490  me.add_uint8(_combine_alpha_source2);
491  me.add_uint8(_combine_alpha_operand2);
492  }
493 }
494 
495 ostream &
496 operator << (ostream &out, TextureStage::Mode mode) {
497  switch (mode) {
498  case TextureStage::M_modulate:
499  return out << "modulate";
500 
501  case TextureStage::M_decal:
502  return out << "decal";
503 
504  case TextureStage::M_blend:
505  return out << "blend";
506 
507  case TextureStage::M_replace:
508  return out << "replace";
509 
510  case TextureStage::M_add:
511  return out << "add";
512 
513  case TextureStage::M_combine:
514  return out << "combine";
515 
516  case TextureStage::M_blend_color_scale:
517  return out << "blend_color_scale";
518 
519  case TextureStage::M_modulate_glow:
520  return out << "modulate_glow";
521 
522  case TextureStage::M_modulate_gloss:
523  return out << "modulate_gloss";
524 
525  case TextureStage::M_normal:
526  return out << "normal";
527 
528  case TextureStage::M_normal_height:
529  return out << "normal_height";
530 
531  case TextureStage::M_glow:
532  return out << "glow";
533 
534  case TextureStage::M_gloss:
535  return out << "gloss";
536 
537  case TextureStage::M_height:
538  return out << "height";
539 
540  case TextureStage::M_selector:
541  return out << "selector";
542 
543  case TextureStage::M_normal_gloss:
544  return out << "normal_gloss";
545  }
546 
547  return out << "**invalid Mode(" << (int)mode << ")**";
548 }
549 
550 ostream &
551 operator << (ostream &out, TextureStage::CombineMode cm) {
552  switch (cm) {
553  case TextureStage::CM_undefined:
554  return out << "undefined";
555 
556  case TextureStage::CM_replace:
557  return out << "replace";
558 
559  case TextureStage::CM_modulate:
560  return out << "modulate";
561 
562  case TextureStage::CM_add:
563  return out << "add";
564 
565  case TextureStage::CM_add_signed:
566  return out << "add_signed";
567 
568  case TextureStage::CM_interpolate:
569  return out << "interpolate";
570 
571  case TextureStage::CM_subtract:
572  return out << "subtract";
573 
574  case TextureStage::CM_dot3_rgb:
575  return out << "dot3_rgb";
576 
577  case TextureStage::CM_dot3_rgba:
578  return out << "dot3_rgba";
579  }
580 
581  return out << "**invalid CombineMode(" << (int)cm << ")**";
582 }
583 
584 ostream &
585 operator << (ostream &out, TextureStage::CombineSource cs) {
586  switch (cs) {
587  case TextureStage::CS_undefined:
588  return out << "undefined";
589 
590  case TextureStage::CS_texture:
591  return out << "texture";
592 
593  case TextureStage::CS_constant:
594  return out << "constant";
595 
596  case TextureStage::CS_primary_color:
597  return out << "primary_color";
598 
599  case TextureStage::CS_previous:
600  return out << "previous";
601 
602  case TextureStage::CS_constant_color_scale:
603  return out << "constant_color_scale";
604 
605  case TextureStage::CS_last_saved_result:
606  return out << "last_saved_result";
607  }
608 
609  return out << "**invalid CombineSource(" << (int)cs << ")**";
610 }
611 
612 ostream &
613 operator << (ostream &out, TextureStage::CombineOperand co) {
614  switch (co) {
615  case TextureStage::CO_undefined:
616  return out << "undefined";
617 
618  case TextureStage::CO_src_color:
619  return out << "src_color";
620 
621  case TextureStage::CO_one_minus_src_color:
622  return out << "one_minus_src_color";
623 
624  case TextureStage::CO_src_alpha:
625  return out << "src_alpha";
626 
627  case TextureStage::CO_one_minus_src_alpha:
628  return out << "one_minus_src_alpha";
629  }
630 
631  return out << "**invalid CombineOperand(" << (int)co << ")**";
632 }
int get_rgb_scale() const
See set_rgb_scale().
Definition: textureStage.I:264
void add_uint8(PN_uint8 value)
Adds an unsigned 8-bit integer to the datagram.
Definition: datagram.I:138
Mode get_mode() const
Return the mode of this stage.
Definition: textureStage.I:206
int get_alpha_scale() const
See set_alpha_scale().
Definition: textureStage.I:289
static TypedWritable * make_TextureStage(const FactoryParams &params)
Factory method to generate a TextureStage object.
bool get_bool()
Extracts a boolean value.
void add_string(const string &str)
Adds a variable-length string to the datagram.
Definition: datagram.I:351
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
CombineSource get_combine_alpha_source0() const
Get source0 of combine_alpha_mode.
Definition: textureStage.I:627
CombineMode get_combine_alpha_mode() const
Get combine_alpha_mode.
Definition: textureStage.I:605
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
const string & get_name() const
Returns the name of this texture stage.
Definition: textureStage.I:32
int compare_to(const TextureStage &other) const
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if...
CombineOperand get_combine_alpha_operand2() const
Get operand2 of combine_alpha_mode.
Definition: textureStage.I:677
TextureStage(const string &name)
Initialize the texture stage at construction.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
PN_int32 get_int32()
Extracts a signed 32-bit integer.
PN_uint8 get_uint8()
Extracts an unsigned 8-bit integer.
int get_sort() const
Returns the sort order of this texture stage.
Definition: textureStage.I:75
string get_string()
Extracts a variable-length string.
LColor get_color() const
return the color for this stage
Definition: textureStage.I:238
CombineMode get_combine_rgb_mode() const
Get the combine_rgb_mode.
Definition: textureStage.I:441
InternalName * get_texcoord_name() const
See set_texcoord_name.
Definition: textureStage.I:148
int get_num_combine_rgb_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get...
Definition: textureStage.I:453
void add_bool(bool value)
Adds a boolean value to the datagram.
Definition: datagram.I:118
void output(ostream &out) const
Just a single line output.
static void register_with_read_factory()
Factory method to generate a TextureStage object.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager-&gt;read_pointer() was called in fillin()...
CombineOperand get_combine_rgb_operand2() const
Get operand2 of combine_rgb_mode.
Definition: textureStage.I:513
CombineSource get_combine_rgb_source0() const
Get source0 of combine_rgb_mode.
Definition: textureStage.I:463
CombineOperand get_combine_alpha_operand1() const
Get operand1 of combine_alpha_mode.
Definition: textureStage.I:657
CombineSource get_combine_alpha_source2() const
Get source2 of combine_alpha_mode.
Definition: textureStage.I:667
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
void read_datagram(DatagramIterator &source)
Reads the vector from the Datagram using get_stdfloat().
Definition: lvecBase4.h:1442
void write(ostream &out) const
Writes the details of this stage.
CombineOperand get_combine_alpha_operand0() const
Get operand0 of combine_alpha_mode.
Definition: textureStage.I:637
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
Definition: factory.I:90
int get_tex_view_offset() const
Returns the current setting of the tex_view_offset.
Definition: textureStage.I:349
void write_datagram(Datagram &destination) const
Writes the vector to the Datagram using add_stdfloat().
Definition: lvecBase4.h:1422
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
Definition: bamReader.I:213
CombineOperand get_combine_rgb_operand1() const
Get operand1 of combine_rgb_mode.
Definition: textureStage.I:493
void operator=(const TextureStage &copy)
just copy the members of other to this
bool get_saved_result() const
Returns the current setting of the saved_result flag.
Definition: textureStage.I:321
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager-&gt;read_pointer() was called in fillin()...
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
int get_priority() const
Returns the priority associated with this stage.
Definition: textureStage.I:113
void add_int32(PN_int32 value)
Adds a signed 32-bit integer to the datagram.
Definition: datagram.I:159
A class to retrieve the individual data elements previously stored in a Datagram. ...
int get_num_combine_alpha_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and g...
Definition: textureStage.I:617
CombineOperand get_combine_rgb_operand0() const
Get operand0 of combine_rgb_mode.
Definition: textureStage.I:473
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
Definition: bamReader.I:105
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is a sequence number that increments monotonically.
Definition: updateSeq.h:43
static TextureStage * get_default()
Returns the default TextureStage that will be used for all texturing that does not name a particular ...
Definition: textureStage.I:766
Defines the properties of a named stage of the multitexture pipeline.
Definition: textureStage.h:38
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
CombineSource get_combine_rgb_source2() const
Get source2 of combine_rgb_mode.
Definition: textureStage.I:503
CombineSource get_combine_rgb_source1() const
Get source1 of combine_rgb_mode.
Definition: textureStage.I:483
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
Definition: bamWriter.cxx:279
void read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
Definition: bamReader.cxx:652
CombineSource get_combine_alpha_source1() const
Get source1 of combine_alpha_mode.
Definition: textureStage.I:647