2017-12-20 19:53:09 +01:00
|
|
|
/*
|
2019-08-03 19:43:48 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2017-12-20 19:53:09 +01:00
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2024-05-16 23:30:41 +02:00
|
|
|
* Copyright (c) 2011-2024, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2024, Andrei Alexeyev <akari@taisei-project.org>.
|
2017-12-20 19:53:09 +01:00
|
|
|
*/
|
2017-12-13 20:05:12 +01:00
|
|
|
|
2021-08-12 23:09:01 +02:00
|
|
|
#pragma once
|
2017-12-20 19:57:29 +01:00
|
|
|
#include "taisei.h"
|
2017-12-13 20:05:12 +01:00
|
|
|
|
|
|
|
#include "objectpool.h"
|
2024-05-17 04:41:28 +02:00
|
|
|
#include "aniplayer.h" // IWYU pragma: export
|
|
|
|
#include "projectile.h" // IWYU pragma: export
|
|
|
|
#include "item.h" // IWYU pragma: export
|
|
|
|
#include "enemy.h" // IWYU pragma: export
|
|
|
|
#include "lasers/laser.h" // IWYU pragma: export
|
|
|
|
#include "stagetext.h" // IWYU pragma: export
|
|
|
|
#include "boss.h" // IWYU pragma: export
|
2017-12-13 20:05:12 +01:00
|
|
|
|
2023-04-03 03:49:39 +02:00
|
|
|
#define OBJECT_POOLS \
|
|
|
|
OBJECT_POOL(Projectile, projectiles) \
|
|
|
|
OBJECT_POOL(Item, items) \
|
|
|
|
OBJECT_POOL(Enemy, enemies) \
|
|
|
|
OBJECT_POOL(Laser, lasers) \
|
|
|
|
OBJECT_POOL(StageText, stagetext) \
|
|
|
|
OBJECT_POOL(Boss, bosses) \
|
|
|
|
|
2017-12-13 20:05:12 +01:00
|
|
|
typedef struct StageObjectPools {
|
2023-04-03 03:49:39 +02:00
|
|
|
#define OBJECT_POOL(type, field) \
|
|
|
|
ObjectPool field;
|
|
|
|
|
|
|
|
OBJECT_POOLS
|
|
|
|
#undef OBJECT_POOL
|
2017-12-13 20:05:12 +01:00
|
|
|
} StageObjectPools;
|
|
|
|
|
|
|
|
extern StageObjectPools stage_object_pools;
|
|
|
|
|
2023-04-03 03:49:39 +02:00
|
|
|
#define STAGE_OBJPOOLS_AS_ARRAYPTR \
|
|
|
|
(ObjectPool (*)[sizeof(stage_object_pools) / sizeof(ObjectPool)])&stage_object_pools
|
|
|
|
|
|
|
|
// Can be called many times to reinitialize the pools while reusing allocated arena memory.
|
|
|
|
void stage_objpools_init(void);
|
|
|
|
|
|
|
|
// Frees the arena
|
|
|
|
void stage_objpools_shutdown(void);
|