Resource Packages

Registered by Sean Olson

Mocha will store and load resources from packages, which are directory trees containing files and associated metadata about those files. A package has a name and contains resources separated within the directory tree by type. Mocha will parse metadata and make these resources available in its API.

Packages will reside in repositories, which are simply a directory containing package directory trees. Mocha will parse a repository and expose its contained packages.

XML will provide metadata. For each package, a file named, "index.xml" must exist in the package's root directory. This file will describe version information and possibly information about where to find the contained resources. Each resource file in the package will be accompanied by a corresponding XML file that describes the resource. For example, an image file in a packages texture directory called, "foo.png" would be accompanied by a metadata file called, "foo.png.xml".

The format of metadata and the information it provides will depend on the type of the resource. All metadata will include information about how the resource should be loaded (for example, loading the resource on demand or loading the resource for the duration of the program).

New types of resources should be able to be specified and registered with Mocha. Clients will be able to implement parsers that understand their resource type's XML metadata and can handle loading resources of that type from a package.

Better performance may be achieved by using a single index XML file that lists and describes all resources. This should be examined. If this is not the case, metadata files per resource file are preferred.

Out of the box, Mocha should support textures, sounds, music, and sprites (and perhaps more). This means the parsers needed for these types are part of the core.

Blueprint information

Status:
Not started
Approver:
Sean Olson
Priority:
Undefined
Drafter:
Sean Olson
Direction:
Needs approval
Assignee:
Sean Olson
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
milestone icon 0.1.1

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.