Pack

Represents a pack.

To read a pack from a JSON file, use getPack. This must be used from the renderer thread.

Members

Functions

blockAtlas
BlockUV[BlockType] blockAtlas(string name)

Load a chunk UV map.

blockTexture
Texture blockTexture(string[] names, BlockUV[BlockType] uv)

Load a block.

blockType
BlockType blockType(string block)

Get the block type for the given block string. Registers a new block type if the path doesn't exist.

boneSetAtlas
BoneUV[BoneType] boneSetAtlas(string name)

Load a bone UV map.

boneSetTexture
Texture boneSetTexture(string[] name, BoneUV[BoneType] uv)

Load a bone.

boneType
BoneType boneType(string boneSet, string bone)

Get the bone type for the given model/bone strings. Registers a new bone type if the specified one wasn't registered before.

destroyAllCache
void destroyAllCache()

Destroy both global and local cache.

destroyLocalCache
void destroyLocalCache()

Destroy the bone set cache.

glob
string[] glob(string file)

Glob search within the pack.

globalPath
string globalPath(string file)

Get a filesystem path given a pack path.

loadImage
Image loadImage(string file)

Load an image by a path relative to the pack. (from cache or filesystem).

modelTexture
Texture2D modelTexture(string[] names, UV[Type] uv)

Load a model texture.

options
const(ResourceOptions)* options(ResourceType type, string res)
skeleton
Bone[] skeleton(string name, string boneSet)

Load a skeleton.

skeleton
Bone[] skeleton(string name, BoneType delegate(wstring) @(safe) bonePicker)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

destroyGlobalCache
void destroyGlobalCache()

Free all textures loaded into the GPU and clear the image cache. Make sure to remove all references to those textures before calling.

loadImageStatic
Image loadImageStatic(string path)

Load an image by a filesystem path (from cache or filesystem).

Variables

blockTypes
BlockType[string] blockTypes;

Block types registered in the pack.

boneTypes
BoneType[AbsoluteBoneType] boneTypes;

Bone types registered in the pack.

description
string description;

Description of the pack.

fileOptions
ResourceOptions[string] fileOptions;

Option fields applied to specific files. Filename extensions are to be omitted in keys.

isodiVersion
string isodiVersion;

Targeted Isodi version

license
string license;

License of the pack.

name
string name;

Name of the pack.

nextBlockType
size_t nextBlockType;

Next block type ID to use.

nextBoneType
size_t nextBoneType;

Next bone type ID to use.

packVersion
string packVersion;

Version of the pack.

path
string path;

Path to the pack directory in the filesystem.

Inherited Members

From ResourceLoader

options
const(ResourceOptions)* options(ResourceType resource, string name)

Get options for the given resource.

blockTexture
Texture2D blockTexture(string[] names, BlockUV[BlockType] uv)

Load texture for a chunk.

boneSetTexture
Texture2D boneSetTexture(string[] names, BoneUV[BoneType] uv)

// Load texture for the given bone sets.

skeleton
Bone[] skeleton(string name, string boneSet)

Load bones for a skeleton, using the given bone set.

packImages
Image packImages(UV[Type][] mapping, Image[] images, UV[Type] newMapping)

Combine the given images to create an atlas map. Each image must be square with dimensions equal to a power of two, eg. 32×32 or 128x128. All images must be of equal size.

Meta