C4 Engine
C4 Engine API Documentation

class ResourceDescriptor

Defined in:  C4Resources.h
Contains information about a resource type.

class ResourceDescriptor


ResourceDescriptor(const char *type, uint32 flags = 0, uint32 cacheSize = 0, const char *defaultName = "");

type A pointer to a three-character or four-character type string for the resource. This should be the resource's file extension without the preceding dot.
flags Flags for the resource type. See below for possible values.
cacheSize The size of the memory cache allocated for the resource type.
defaultName The name of a resource to load by default when an attempt to load a resource fails.
The ResourceDescriptor class contains information about a specific resource type and controls how the Resource Manager handles that type of resource.

The type parameter must point to a three-character sequence giving the file extension for resources of the type to which the resource descriptor pertains. The flags parameter can be a combination (through logical OR) of the following constants.
kResourceNameIncludesType The type specified by the file extension is included in the resource name.
kResourceTerminatorByte An extra byte is added to the end of the memory allocated for this type of resource, and it is set to zero.
If nonzero, the cacheSize parameter specifies the size of the memory cache allocated by the Resource Manager to hold recently released resources of the descriptor's type.

If the defaultName parameter is not the empty string, then it specifies a resource to load by default when an attempt to load a resource of the descriptor's type fails. (The defaultName parameter cannot be nullptr.)