comparison engine/core/model/structures/instance.h @ 181:56ac89189bc4

fixed time handling in fife: - the time scaling method was unreliable when changing the time factors (jumping in the moment of the change) - replaced much calls to SDL_GetTicks with TimerManager::instance()->getTime() - some other time related cleanup
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 31 Jan 2009 04:15:43 +0000
parents 64e7fe3d4288
children 3d0cc4545938
comparison
equal deleted inserted replaced
180:66bd7f8c541e 181:56ac89189bc4
183 183
184 /** Gets the time in milliseconds how long action has been active 184 /** Gets the time in milliseconds how long action has been active
185 * In case there is no current action, returns -1 185 * In case there is no current action, returns -1
186 * @return action runtime 186 * @return action runtime
187 */ 187 */
188 int getActionRuntime() const; 188 unsigned int getActionRuntime();
189 189
190 /** Performs given named action to the instance. While performing the action 190 /** Performs given named action to the instance. While performing the action
191 * moves instance to given target with given speed 191 * moves instance to given target with given speed
192 * @param action_name name of the action 192 * @param action_name name of the action
193 * @param target place where to move this instance 193 * @param target place where to move this instance
219 /** Returns pointer to currently set saytext. In case no text is set, returns NULL 219 /** Returns pointer to currently set saytext. In case no text is set, returns NULL
220 */ 220 */
221 const std::string* getSayText() const; 221 const std::string* getSayText() const;
222 222
223 /** Updates the instance related to the current action 223 /** Updates the instance related to the current action
224 * @param curticks current tick count of the system
225 * @note call this only once in engine update cycle, so that tracking between 224 * @note call this only once in engine update cycle, so that tracking between
226 * current position and previous position keeps in sync. 225 * current position and previous position keeps in sync.
227 * @returns marked changes 226 * @returns marked changes
228 */ 227 */
229 InstanceChangeInfo update(unsigned int curticks=0); 228 InstanceChangeInfo update();
230 229
231 /** Sets visualization to be used. Transfers ownership. 230 /** Sets visualization to be used. Transfers ownership.
232 */ 231 */
233 void setVisual(AbstractVisual* visual) { m_visual = visual; } 232 void setVisual(AbstractVisual* visual) { m_visual = visual; }
234 233
246 245
247 /** Gets instance speed, considering also model and map speeds. @see setTimeMultiplier. 246 /** Gets instance speed, considering also model and map speeds. @see setTimeMultiplier.
248 */ 247 */
249 float getTotalTimeMultiplier(); 248 float getTotalTimeMultiplier();
250 249
250 /** Gets the scaled runtime in milliseconds
251 * @return runtime
252 */
253 unsigned int getRuntime();
254
251 /** Refreshes instance e.g. in case location is updated directly (not via setLocation) 255 /** Refreshes instance e.g. in case location is updated directly (not via setLocation)
252 * In this case e.g. instance's master time provider is changed, so it needs to be updated 256 * In this case e.g. instance's master time provider is changed, so it needs to be updated
253 */ 257 */
254 void refresh(); 258 void refresh();
255 259