taisei/src/common_tasks.h

76 lines
1.5 KiB
C
Raw Normal View History

/*
2019-10-04 05:04:12 +02:00
* This software is licensed under the terms of the MIT License.
* 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"
DECLARE_EXTERN_TASK(
common_drop_items,
2019-12-18 15:19:13 +01:00
{ cmplx *pos; ItemCounts items; }
);
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); }
);
DECLARE_EXTERN_TASK(
common_start_bgm,
{ const char *bgm; }
);
2020-03-01 17:38:54 +01:00
DECLARE_EXTERN_TASK(
common_charge,
{
cmplx pos;
const Color *color;
int time;
BoxedEntity bind_to_entity;
const cmplx *anchor;
const Color *color_ref;
2020-03-02 17:38:53 +01:00
struct {
const char *charge;
const char *discharge;
} sound;
2020-03-01 17:38:54 +01:00
}
);
2020-03-02 17:38:53 +01:00
#define COMMON_CHARGE_SOUNDS { "charge_generic", "discharge" }
2019-12-05 17:45:32 +01:00
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
#endif // IGUARD_common_tasks_h