2019-07-21 08:51:47 +02:00
|
|
|
/*
|
2019-10-04 05:04:12 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2019-07-21 08:51:47 +02:00
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
|
|
|
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IGUARD_common_tasks_h
|
|
|
|
#define IGUARD_common_tasks_h
|
|
|
|
|
|
|
|
#include "taisei.h"
|
|
|
|
|
|
|
|
#include "coroutine.h"
|
|
|
|
#include "item.h"
|
2019-09-01 02:23:36 +02:00
|
|
|
#include "move.h"
|
|
|
|
#include "entity.h"
|
2019-10-28 16:16:16 +01:00
|
|
|
#include "global.h"
|
2019-07-21 08:51:47 +02:00
|
|
|
|
|
|
|
DECLARE_EXTERN_TASK(
|
|
|
|
common_drop_items,
|
2019-12-18 15:19:13 +01:00
|
|
|
{ cmplx *pos; ItemCounts items; }
|
2019-07-21 08:51:47 +02:00
|
|
|
);
|
|
|
|
|
2019-09-01 02:23:36 +02:00
|
|
|
DECLARE_EXTERN_TASK(
|
|
|
|
common_move,
|
2019-12-18 15:19:13 +01:00
|
|
|
{ cmplx *pos; MoveParams move_params; BoxedEntity ent; }
|
2019-09-01 02:23:36 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EXTERN_TASK(
|
|
|
|
common_move_ext,
|
2019-12-18 15:19:13 +01:00
|
|
|
{ cmplx *pos; MoveParams *move_params; BoxedEntity ent; }
|
2019-09-01 02:23:36 +02:00
|
|
|
);
|
|
|
|
|
2019-12-05 17:45:32 +01:00
|
|
|
DECLARE_EXTERN_TASK(
|
|
|
|
common_call_func,
|
|
|
|
{ void (*func)(void); }
|
|
|
|
);
|
|
|
|
|
|
|
|
void common_move_loop(cmplx *restrict pos, MoveParams *restrict mp);
|
2019-09-01 02:23:36 +02:00
|
|
|
|
2019-09-02 18:09:09 +02:00
|
|
|
INLINE Rect viewport_bounds(double margin) {
|
|
|
|
return (Rect) {
|
|
|
|
.top_left = CMPLX(margin, margin),
|
|
|
|
.bottom_right = CMPLX(VIEWPORT_W - margin, VIEWPORT_H - margin),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-12-18 15:19:13 +01:00
|
|
|
cmplx common_wander(cmplx origin, double dist, Rect bounds);
|
2019-09-02 18:09:09 +02:00
|
|
|
|
2019-07-21 08:51:47 +02:00
|
|
|
#endif // IGUARD_common_tasks_h
|