513d613387
I would've preferred to just go with 4-spaces for indent and no tabs, but lao is a bit conservative about it. :^) Still, this is a ton better than mixing different styles all over the place, especially within the same file.
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/*
|
|
* This software is licensed under the terms of the MIT-License
|
|
* See COPYING for further information.
|
|
* ---
|
|
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
|
|
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
|
|
*/
|
|
|
|
#include "taisei.h"
|
|
|
|
#include "stageobjects.h"
|
|
#include "projectile.h"
|
|
#include "item.h"
|
|
#include "enemy.h"
|
|
#include "laser.h"
|
|
#include "aniplayer.h"
|
|
|
|
#define MAX_projectiles 1024
|
|
#define MAX_items MAX_projectiles
|
|
#define MAX_enemies 64
|
|
#define MAX_lasers 64
|
|
|
|
#define OBJECT_POOLS \
|
|
OBJECT_POOL(Projectile, projectiles) \
|
|
OBJECT_POOL(Item, items) \
|
|
OBJECT_POOL(Enemy, enemies) \
|
|
OBJECT_POOL(Laser, lasers) \
|
|
|
|
StageObjectPools stage_object_pools;
|
|
|
|
void stage_objpools_alloc(void) {
|
|
stage_object_pools = (StageObjectPools){
|
|
#define OBJECT_POOL(type,field) \
|
|
.field = OBJPOOL_ALLOC(type, MAX_##field),
|
|
|
|
OBJECT_POOLS
|
|
#undef OBJECT_POOL
|
|
};
|
|
}
|
|
|
|
void stage_objpools_free(void) {
|
|
#define OBJECT_POOL(type,field) \
|
|
objpool_free(stage_object_pools.field);
|
|
|
|
OBJECT_POOLS
|
|
#undef OBJECT_POOL
|
|
}
|