Opened 16 years ago
Closed 15 years ago
#294 closed task (fixed)
Resource providing
Reported by: | rgrieder | Owned by: | rgrieder |
---|---|---|---|
Priority: | minor | Milestone: | Version 0.3 Codename: Castor |
Component: | Ogre | Version: | 0.2.0 |
Keywords: | resource, oxw | Cc: | |
Referenced By: | References: |
Description (last modified by rgrieder)
Outline
Loading files from a filesystem can be quite painful if you have to specify its exact location with all the folders.
Ogre has dealt with this problem by the means of a Resource Manager. You give it all the locations in a configuration file and then it sweeps all the contents and wraps the with a Resource. They can be of any kind (font, image, mesh, etc.) and that can be extended to serve our purposes.
The Task
Study the Ogre Resource providing concept on the documentation pages (also consider the Doxygen code). Then try to extend the Ogre framework to be able to also find the kind of files we want to load. A little abstract:
- Level files: *.oxw (XML)
- Overlay files: *.oxo (XML), though this could be replaced by oxw since its both XML
- TCL scripts: *.tcl
- Lua scripts: *.lua
- More to come I'm sure
Change History (3)
comment:1 Changed 16 years ago by bknecht
comment:2 Changed 15 years ago by rgrieder
- Description modified (diff)
- Owner changed from nobody to rgrieder
Actually the Ogre Resource Management concept is quite very stable, so there's probably not gonna change much for us with the exception of better multithreading support.
comment:3 Changed 15 years ago by rgrieder
- Resolution set to fixed
- Status changed from new to closed
I have created a Resource class with static methods that provide easier access to Resources via ResourceGroupManager. We only access the files and don't compile any script files. That means we don't need our own ResourceManager. Our files can now also be in a zip archive. Though using 7zip yields about 50% better packing with meshes (yet another ticket, but unimportant so I'm not going to create one). There are only 2 folders accessed by hard paths: Tcl scripts and files in defaultConfig. Resources are declared in resources.oxr (XML based).
Cool ticket But it's important to structure it such, that changes by Ogre can be quickly included.