00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 INLINE bool AnimControlCollection::
00022 play(const string &anim_name) {
00023 AnimControl *control = find_anim(anim_name);
00024 if (control == (AnimControl *)NULL) {
00025 return false;
00026 }
00027 _last_started_control = control;
00028 control->play();
00029 return true;
00030 }
00031
00032
00033
00034
00035
00036
00037 INLINE bool AnimControlCollection::
00038 play(const string &anim_name, int from, int to) {
00039 AnimControl *control = find_anim(anim_name);
00040 if (control == (AnimControl *)NULL) {
00041 return false;
00042 }
00043 _last_started_control = control;
00044 control->play(from, to);
00045 return true;
00046 }
00047
00048
00049
00050
00051
00052
00053 INLINE bool AnimControlCollection::
00054 loop(const string &anim_name, bool restart) {
00055 AnimControl *control = find_anim(anim_name);
00056 if (control == (AnimControl *)NULL) {
00057 return false;
00058 }
00059 _last_started_control = control;
00060 control->loop(restart);
00061 return true;
00062 }
00063
00064
00065
00066
00067
00068
00069 INLINE bool AnimControlCollection::
00070 loop(const string &anim_name, bool restart, int from, int to) {
00071 AnimControl *control = find_anim(anim_name);
00072 if (control == (AnimControl *)NULL) {
00073 return false;
00074 }
00075 _last_started_control = control;
00076 control->loop(restart, from, to);
00077 return true;
00078 }
00079
00080
00081
00082
00083
00084
00085 INLINE bool AnimControlCollection::
00086 stop(const string &anim_name) {
00087 AnimControl *control = find_anim(anim_name);
00088 if (control == (AnimControl *)NULL) {
00089 return false;
00090 }
00091 control->stop();
00092 return true;
00093 }
00094
00095
00096
00097
00098
00099
00100
00101 INLINE bool AnimControlCollection::
00102 pose(const string &anim_name, int frame) {
00103 AnimControl *control = find_anim(anim_name);
00104 if (control == (AnimControl *)NULL) {
00105 return false;
00106 }
00107 _last_started_control = control;
00108 control->pose(frame);
00109 return true;
00110 }
00111
00112
00113
00114
00115
00116
00117
00118 INLINE int AnimControlCollection::
00119 get_frame(const string &anim_name) const {
00120 AnimControl *control = find_anim(anim_name);
00121 if (control == (AnimControl *)NULL) {
00122 return 0;
00123 }
00124 return control->get_frame();
00125 }
00126
00127
00128
00129
00130
00131
00132
00133 INLINE int AnimControlCollection::
00134 get_frame() const {
00135 if (_last_started_control == (AnimControl *)NULL) {
00136 return 0;
00137 }
00138 return _last_started_control->get_frame();
00139 }
00140
00141
00142
00143
00144
00145
00146
00147 INLINE bool AnimControlCollection::
00148 is_playing(const string &anim_name) const {
00149 AnimControl *control = find_anim(anim_name);
00150 if (control == (AnimControl *)NULL) {
00151 return false;
00152 }
00153 return control->is_playing();
00154 }
00155
00156
00157
00158
00159
00160
00161
00162 INLINE bool AnimControlCollection::
00163 is_playing() const {
00164 if (_last_started_control == (AnimControl *)NULL) {
00165 return false;
00166 }
00167 return _last_started_control->is_playing();
00168 }
00169
00170
00171
00172
00173
00174
00175
00176 INLINE int AnimControlCollection::
00177 get_num_frames(const string &anim_name) const {
00178 AnimControl *control = find_anim(anim_name);
00179 if (control == (AnimControl *)NULL) {
00180 return 0;
00181 }
00182 return control->get_num_frames();
00183 }
00184
00185
00186
00187
00188
00189
00190
00191 INLINE int AnimControlCollection::
00192 get_num_frames() const {
00193 if (_last_started_control == (AnimControl *)NULL) {
00194 return 0;
00195 }
00196 return _last_started_control->get_num_frames();
00197 }
00198
00199 INLINE ostream &
00200 operator << (ostream &out, const AnimControlCollection &collection) {
00201 collection.output(out);
00202 return out;
00203 }
00204