Panda3D
 All Classes Functions Variables Enumerations
eggAnimPreload.I
1 // Filename: eggAnimPreload.I
2 // Created by: drose (06Aug08)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggAnimPreload::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggAnimPreload::
22 EggAnimPreload(const string &name) : EggNode(name) {
23  _has_fps = false;
24  _has_num_frames = false;
25 }
26 
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: EggAnimPreload::Copy constructor
30 // Access: Public
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 INLINE EggAnimPreload::
34 EggAnimPreload(const EggAnimPreload &copy) :
35  EggNode(copy),
36  _fps(copy._fps),
37  _has_fps(copy._has_fps),
38  _num_frames(copy._num_frames),
39  _has_num_frames(copy._has_num_frames)
40 {
41 }
42 
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: EggAnimPreload::Copy assignment operator
46 // Access: Public
47 // Description:
48 ////////////////////////////////////////////////////////////////////
49 INLINE EggAnimPreload &EggAnimPreload::
50 operator = (const EggAnimPreload &copy) {
51  EggNode::operator = (copy);
52  _fps = copy._fps;
53  _has_fps = copy._has_fps;
54  _num_frames = copy._num_frames;
55  _has_num_frames = copy._has_num_frames;
56 
57  return *this;
58 }
59 
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: EggAnimPreload::set_fps
63 // Access: Public
64 // Description:
65 ////////////////////////////////////////////////////////////////////
66 INLINE void EggAnimPreload::
67 set_fps(double fps) {
68  _fps = fps;
69  _has_fps = true;
70 }
71 
72 
73 ////////////////////////////////////////////////////////////////////
74 // Function: EggAnimPreload::clear_fps
75 // Access: Public
76 // Description:
77 ////////////////////////////////////////////////////////////////////
78 INLINE void EggAnimPreload::
79 clear_fps() {
80  _has_fps = false;
81 }
82 
83 ////////////////////////////////////////////////////////////////////
84 // Function: EggAnimPreload::has_fps
85 // Access: Public
86 // Description:
87 ////////////////////////////////////////////////////////////////////
88 INLINE bool EggAnimPreload::
89 has_fps() const {
90  return _has_fps;
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: EggAnimPreload::get_fps
95 // Access: Public
96 // Description: This is only valid if has_fps() returns true.
97 ////////////////////////////////////////////////////////////////////
98 INLINE double EggAnimPreload::
99 get_fps() const {
100  nassertr(has_fps(), 0.0);
101  return _fps;
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: EggAnimPreload::set_num_frames
106 // Access: Public
107 // Description:
108 ////////////////////////////////////////////////////////////////////
109 INLINE void EggAnimPreload::
110 set_num_frames(int num_frames) {
111  _num_frames = num_frames;
112  _has_num_frames = true;
113 }
114 
115 
116 ////////////////////////////////////////////////////////////////////
117 // Function: EggAnimPreload::clear_num_frames
118 // Access: Public
119 // Description:
120 ////////////////////////////////////////////////////////////////////
121 INLINE void EggAnimPreload::
122 clear_num_frames() {
123  _has_num_frames = false;
124 }
125 
126 ////////////////////////////////////////////////////////////////////
127 // Function: EggAnimPreload::has_num_frames
128 // Access: Public
129 // Description:
130 ////////////////////////////////////////////////////////////////////
131 INLINE bool EggAnimPreload::
132 has_num_frames() const {
133  return _has_num_frames;
134 }
135 
136 ////////////////////////////////////////////////////////////////////
137 // Function: EggAnimPreload::get_num_frames
138 // Access: Public
139 // Description: This is only valid if has_num_frames() returns true.
140 ////////////////////////////////////////////////////////////////////
141 INLINE int EggAnimPreload::
142 get_num_frames() const {
143  nassertr(has_num_frames(), 0);
144  return _num_frames;
145 }
This corresponds to an <AnimPreload> entry.
int get_num_frames() const
This is only valid if has_num_frames() returns true.
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38
double get_fps() const
This is only valid if has_fps() returns true.