00001 // Filename: eggAnimPreload.I 00002 // Created by: drose (06Aug08) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: EggAnimPreload::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE EggAnimPreload:: 00022 EggAnimPreload(const string &name) : EggNode(name) { 00023 _has_fps = false; 00024 _has_num_frames = false; 00025 } 00026 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: EggAnimPreload::Copy constructor 00030 // Access: Public 00031 // Description: 00032 //////////////////////////////////////////////////////////////////// 00033 INLINE EggAnimPreload:: 00034 EggAnimPreload(const EggAnimPreload ©) : 00035 EggNode(copy), 00036 _fps(copy._fps), 00037 _has_fps(copy._has_fps), 00038 _num_frames(copy._num_frames), 00039 _has_num_frames(copy._has_num_frames) 00040 { 00041 } 00042 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: EggAnimPreload::Copy assignment operator 00046 // Access: Public 00047 // Description: 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE EggAnimPreload &EggAnimPreload:: 00050 operator = (const EggAnimPreload ©) { 00051 EggNode::operator = (copy); 00052 _fps = copy._fps; 00053 _has_fps = copy._has_fps; 00054 _num_frames = copy._num_frames; 00055 _has_num_frames = copy._has_num_frames; 00056 00057 return *this; 00058 } 00059 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: EggAnimPreload::set_fps 00063 // Access: Public 00064 // Description: 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void EggAnimPreload:: 00067 set_fps(double fps) { 00068 _fps = fps; 00069 _has_fps = true; 00070 } 00071 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: EggAnimPreload::clear_fps 00075 // Access: Public 00076 // Description: 00077 //////////////////////////////////////////////////////////////////// 00078 INLINE void EggAnimPreload:: 00079 clear_fps() { 00080 _has_fps = false; 00081 } 00082 00083 //////////////////////////////////////////////////////////////////// 00084 // Function: EggAnimPreload::has_fps 00085 // Access: Public 00086 // Description: 00087 //////////////////////////////////////////////////////////////////// 00088 INLINE bool EggAnimPreload:: 00089 has_fps() const { 00090 return _has_fps; 00091 } 00092 00093 //////////////////////////////////////////////////////////////////// 00094 // Function: EggAnimPreload::get_fps 00095 // Access: Public 00096 // Description: This is only valid if has_fps() returns true. 00097 //////////////////////////////////////////////////////////////////// 00098 INLINE double EggAnimPreload:: 00099 get_fps() const { 00100 nassertr(has_fps(), 0.0); 00101 return _fps; 00102 } 00103 00104 //////////////////////////////////////////////////////////////////// 00105 // Function: EggAnimPreload::set_num_frames 00106 // Access: Public 00107 // Description: 00108 //////////////////////////////////////////////////////////////////// 00109 INLINE void EggAnimPreload:: 00110 set_num_frames(int num_frames) { 00111 _num_frames = num_frames; 00112 _has_num_frames = true; 00113 } 00114 00115 00116 //////////////////////////////////////////////////////////////////// 00117 // Function: EggAnimPreload::clear_num_frames 00118 // Access: Public 00119 // Description: 00120 //////////////////////////////////////////////////////////////////// 00121 INLINE void EggAnimPreload:: 00122 clear_num_frames() { 00123 _has_num_frames = false; 00124 } 00125 00126 //////////////////////////////////////////////////////////////////// 00127 // Function: EggAnimPreload::has_num_frames 00128 // Access: Public 00129 // Description: 00130 //////////////////////////////////////////////////////////////////// 00131 INLINE bool EggAnimPreload:: 00132 has_num_frames() const { 00133 return _has_num_frames; 00134 } 00135 00136 //////////////////////////////////////////////////////////////////// 00137 // Function: EggAnimPreload::get_num_frames 00138 // Access: Public 00139 // Description: This is only valid if has_num_frames() returns true. 00140 //////////////////////////////////////////////////////////////////// 00141 INLINE int EggAnimPreload:: 00142 get_num_frames() const { 00143 nassertr(has_num_frames(), 0); 00144 return _num_frames; 00145 }