Merge lp://staging/~jesse-barker/glmark2/extra-support into lp://staging/glmark2/2011.11
Status: | Merged |
---|---|
Merged at revision: | 150 |
Proposed branch: | lp://staging/~jesse-barker/glmark2/extra-support |
Merge into: | lp://staging/glmark2/2011.11 |
Diff against target: |
429 lines (+227/-27) 8 files modified
src/model.cpp (+117/-1) src/model.h (+40/-5) src/scene-build.cpp (+46/-15) src/scene-bump.cpp (+5/-4) src/scene-shading.cpp (+2/-1) src/scene-texture.cpp (+2/-1) src/scene.h (+3/-0) wscript (+12/-0) |
To merge this branch: | bzr merge lp://staging/~jesse-barker/glmark2/extra-support |
Related bugs: | |
Related blueprints: |
Additional large models for glmark2
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandros Frantzis | Approve | ||
Review via email: mp+78655@code.staging.launchpad.net |
Description of the change
Model: Add support for glmark2-extras and handle model loading more cleanly.
The addition of support for the optional additional large models begged a slight revamp of the handling of models in general. Included in this branch:
- Addition of a "--extras-path" option to the configure phase of the build. This enables the inclusion of optional data from a non-default location (e.g., in a situation where a developer wants temporary access to the data without tainting their installation).
- Model class gets a class method called "find_models()" to scan both the "data path" as well as the "extras path" (if configured). This method builds a database of available models in the form of a std::map with the model "name" (filename with no extension) as key and a pointer to a new ModelDescriptor object as value. ModelDescriptor contains the model name, format (3ds, obj), and full pathname to the model file.
- Model class gets a new object method called "load()". This takes only the model name (as described above), and uses the map to look up the additional details it needs to load the model without the calling scene needing to know anything about the format of the model. The format-specific load methods are now private and all calling scenes have been updated to call the new method.
- Model class gets updated with some additional comments to clarify what has been done and how the object is meant to be used.
Looks good.
Some ideas for future consideration (more or less related to this branch):
1. Create a resource path handling class to find resources in the available locations instead of hardcoding paths. For example, vtx_shader_path = Resources: :find(" shader/ desktop. vert").
2. Istead of having a "data path" and an "extras path" support multiple (even more than 2!) "data paths". For example './waf configure --data- path=$( pwd)/data --data- path=$( pwd)/.. /glmark2- extras' . This would require some work on both the build system side and the glmark2 resource handling side (like the change described in (1)).
3. Allow Model::load() to accept arbitrary paths so that users can load additional models from the filesystem.