Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
resourceid.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
26
//------------------------------------------------------------------------------
27
#include "
util/stringatom.h
"
28
#include "
ids/id.h
"
29
#include "
core/debug.h
"
30
#include "
ids/idgenerationpool.h
"
31
namespace
Resources
32
{
33
typedef
Util::StringAtom
ResourceName
;
34
ID_24_8_24_8_NAMED_TYPE
(ResourceId, loaderInstanceId, loaderIndex, resourceId, generation, loader, resource);
// 24 bits: loader resource id, 8 bits: loader index, 24 bits: unique resource id, 8 bits: generation
35
36
// define a generic typed ResourceId, this is so we can have specialized allocators, but have a common pool implementation...
37
ID_24_8_NAMED_TYPE
(
ResourceUnknownId
, resourceId, generation,
id
);
38
39
}
// namespace Resource
40
41
#define RESOURCE_ID_TYPE(type) struct type : public Resources::ResourceUnknownId { \
42
constexpr type() {};\
43
constexpr type(const Resources::ResourceUnknownId& res) : Resources::ResourceUnknownId(res) {};\
44
constexpr type(const Resources::ResourceId& res) : Resources::ResourceUnknownId(res.resourceId, res.generation) {};\
45
constexpr type(const Ids::Id24 id, const Ids::Id8 generation) : Resources::ResourceUnknownId(id, generation) {};\
46
constexpr type(const Ids::Id32 id) : Resources::ResourceUnknownId(Ids::Index(id), Ids::Generation(id)) {};\
47
}; \
48
static constexpr type Invalid##type = Resources::InvalidResourceUnknownId;
Util::StringAtom
A StringAtom.
Definition
stringatom.h:22
debug.h
Nebula debug macros.
idgenerationpool.h
id.h
ID_24_8_NAMED_TYPE
#define ID_24_8_NAMED_TYPE(x, id24_name, id8_name, combined_name)
Definition
id.h:109
ID_24_8_24_8_NAMED_TYPE
#define ID_24_8_24_8_NAMED_TYPE(x, id24_0_name, id8_0_name, id24_1_name, id8_1_name, combined0_name, combined1_name)
Definition
id.h:73
Resources
A resource is a container for some type of file which is loaded.
Definition
resource.cc:9
Resources::ResourceName
Util::StringAtom ResourceName
Definition
resourceid.h:33
stringatom.h
Resources::ResourceUnknownId
Definition
resourceid.h:37
code
resource
resources
resourceid.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.