(svn r16336) -Codechange: make the SpriteGroup pool more like the 'normal' pools
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "gfx_type.h"
|
||||
#include "engine_type.h"
|
||||
#include "tile_type.h"
|
||||
#include "oldpool.h"
|
||||
|
||||
#include "newgrf_cargo.h"
|
||||
#include "newgrf_callbacks.h"
|
||||
@@ -182,8 +183,18 @@ enum SpriteGroupType {
|
||||
SGT_INDUSTRY_PRODUCTION,
|
||||
};
|
||||
|
||||
typedef uint32 SpriteGroupID;
|
||||
DECLARE_OLD_POOL(SpriteGroup, SpriteGroup, 9, 250)
|
||||
|
||||
/* Common wrapper for all the different sprite group types */
|
||||
struct SpriteGroup {
|
||||
struct SpriteGroup : PoolItem<SpriteGroup, SpriteGroupID, &_SpriteGroup_pool> {
|
||||
SpriteGroup(SpriteGroupType type = SGT_INVALID) :
|
||||
type(type)
|
||||
{
|
||||
}
|
||||
|
||||
~SpriteGroup();
|
||||
|
||||
SpriteGroupType type;
|
||||
|
||||
union {
|
||||
@@ -195,13 +206,11 @@ struct SpriteGroup {
|
||||
TileLayoutSpriteGroup layout;
|
||||
IndustryProductionSpriteGroup indprod;
|
||||
} g;
|
||||
|
||||
inline bool IsValid() const { return this->type != SGT_INVALID; }
|
||||
};
|
||||
|
||||
|
||||
SpriteGroup *AllocateSpriteGroup();
|
||||
void InitializeSpriteGroupPool();
|
||||
|
||||
|
||||
struct ResolverObject {
|
||||
CallbackID callback;
|
||||
uint32 callback_param1;
|
||||
|
Reference in New Issue
Block a user