taisei/src/stageobjects.h

40 lines
1 KiB
C
Raw Normal View History

2017-12-20 19:53:09 +01: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
#pragma once
#include "taisei.h"
2017-12-13 20:05:12 +01:00
#include "objectpool.h"
#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 {
#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;
#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);