22 #ifndef NUVIE_CORE_ANIM_MANAGER_H 23 #define NUVIE_CORE_ANIM_MANAGER_H 25 #include "ultima/nuvie/core/nuvie_defs.h" 26 #include "ultima/nuvie/gui/widgets/map_window.h" 27 #include "ultima/nuvie/core/timed_event.h" 28 #include "ultima/nuvie/misc/call_back.h" 29 #include "ultima/nuvie/misc/map_entity.h" 30 #include "ultima/nuvie/misc/u6_line_walker.h" 42 #define MESG_TIMED CB_TIMED 58 sint16 mapwindow_x_offset;
59 sint16 mapwindow_y_offset;
61 AnimIterator get_anim_iterator(uint32 anim_id);
70 void display(
bool top_anims =
false);
75 void set_surface(
Screen *screen) {
81 void set_tile_pitch(uint8 p) {
84 uint8 get_tile_pitch()
const {
91 bool destroy_anim(uint32 anim_id);
96 void drawTile(
const Tile *tile, uint16 x, uint16 y);
97 void drawTileAtWorldCoords(
const Tile *tile, uint16 wx, uint16 wy, uint16 add_x = 0, uint16 add_y = 0);
98 void drawText(
Font *font,
const char *text, uint16 x, uint16 y);
117 uint32 last_move_time;
126 virtual bool update() {
129 virtual void display() = 0;
131 void update_position();
143 bool is_paused()
const {
150 uint32 get_id()
const {
154 void set_safe_to_delete(
bool val) {
155 safe_to_delete = val;
157 void set_velocity(sint32 sx, sint32 sy) {
161 void set_velocity_for_speed(sint16 xdir, sint16 ydir, uint32 spd);
163 virtual void stop() {
164 updated = running =
false;
166 virtual void start() { }
167 uint16 message(uint16 msg,
void *msg_data =
nullptr,
void *my_data =
nullptr) {
168 if (callback_target)
return (CallBack::message(msg, msg_data, my_data));
172 virtual void move(uint32 x, uint32 y, uint32 add_x = 0, uint32 add_y = 0) {
176 virtual void shift(sint32 sx, sint32 sy) {
206 void display()
override;
215 void get_offset(uint32 &x_add, uint32 &y_add)
const {
221 void move(uint32 x, uint32 y, uint32 add_x = 0, uint32 add_y = 0)
override {
227 void shift(sint32 sx, sint32 sy)
override;
228 void shift_tile(uint32 ptile_num, sint32 sx, sint32 sy);
232 PositionedTile *add_tile(
Tile *tile, sint16 x, sint16 y, uint16 add_x = 0, uint16 add_y = 0);
233 void remove_tile(uint32 i = 0);
250 void start_timer(uint32 delay) {
251 if (!timer) timer =
new TimedCallback(
this,
nullptr, delay,
true);
255 timer->clear_target();
260 void stop()
override {
268 #define TOSS_TO_BLOCKING 0x01 269 #define TOSS_TO_ACTOR 0x02 270 #define TOSS_TO_OBJECT 0x04 283 uint32 start_px, start_py, target_px, target_py;
284 uint8 mapwindow_level;
292 float x_left, y_left;
293 uint16 x_dist, y_dist;
295 bool update()
override;
298 void display()
override;
305 void init(
const Tile *tile, uint16 degrees,
const MapCoord &start,
const MapCoord &stop, uint16 pixels_per_sec, uint8 stop_flags);
306 void start()
override;
307 void stop()
override;
308 uint32 update_position(uint32 max_move = 0);
309 inline void accumulate_moves(
float moves, sint32 &x_move, sint32 &y_move, sint8 xdir, sint8 ydir);
312 virtual void hit_target();
313 virtual void hit_object(
Obj *obj);
314 virtual void hit_actor(
Actor *actor);
315 virtual void hit_blocking(
const MapCoord &obj_loc);
339 uint16 exploding_tile_num;
345 void start()
override;
346 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
347 bool update()
override;
349 void hit_object(
Obj *obj);
350 void hit_actor(
Actor *actor);
351 void get_shifted_location(uint16 &x, uint16 &y, uint16 &px, uint16 &py,
352 uint32 sx, uint32 sy);
361 uint16 rotation_amount;
370 uint8 src_tile_y_offset;
372 uint16 stopped_count;
379 void start()
override;
381 bool update()
override;
391 sint32 x, y, finish_x;
394 Tile *wing_bottom[2];
402 void start()
override;
403 bool update()
override;
413 #define HAILSTORM_ANIM_MAX_STONES 6 417 Tile *hailstone_tile;
419 Hailstone hailstones[HAILSTORM_ANIM_MAX_STONES];
420 uint8 num_hailstones_left;
426 void start()
override;
427 bool update()
override;
430 sint8 find_free_hailstone();
439 bool update()
override;
445 uint16 callback(uint16 msg,
CallBack *caller,
void *msg_data)
override;
446 void start()
override {
459 uint16 callback(uint16 msg,
CallBack *caller,
void *msg_data)
override;
460 void start()
override {
461 start_timer(duration);
464 void display()
override;
471 bool should_delete_to_tile;
472 uint16 pixels_per_update;
473 unsigned char mask[256];
481 bool update()
override;
483 void init(uint16 speed);
Definition: map_window.h:73
Definition: anim_manager.h:240
Definition: anim_manager.h:451
Definition: atari-screen.h:58
Definition: actor_manager.h:42
Definition: timed_event.h:209
Definition: anim_manager.h:389
Definition: anim_manager.h:355
Definition: detection.h:27
Definition: u6_line_walker.h:30
Definition: anim_manager.h:467
Definition: map_entity.h:45
Definition: anim_manager.h:276
Definition: call_back.h:50
Definition: anim_manager.h:436
Definition: anim_manager.h:327
Definition: anim_manager.h:198
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Definition: anim_manager.h:414
Definition: obj_manager.h:75
Definition: anim_manager.h:407
Definition: anim_manager.h:335
Definition: anim_manager.h:108
Definition: list_intern.h:54
Definition: anim_manager.h:366
Definition: tile_manager.h:113
Definition: anim_manager.h:189
Definition: anim_manager.h:49
Definition: anim_manager.h:320