Last change
on this file since 507 was
507,
checked in by nicolape, 17 years ago
|
- Skybox and ambient light load now from level file sample.oxw. Added objects to and methods to parse this tags. Added a tokenizer function to split strings into smaller strings (for reading out the light colours for examle). Moved Tokenizer and String2number into misc directory. deleted old unised xml class
|
File size:
1.2 KB
|
Rev | Line | |
---|
[164] | 1 | /** |
---|
| 2 | * Orxonox - www.orxonox.net |
---|
| 3 | * Level Loader class |
---|
| 4 | * |
---|
| 5 | * @author Nicolas Perrenoud <nicolape@ee.ethz.ch> |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include <string> |
---|
[507] | 9 | #include <vector> |
---|
[164] | 10 | #include <iostream> |
---|
| 11 | |
---|
[474] | 12 | #include "loader_platform.h" |
---|
| 13 | #include "tinyxml/tinyxml.h" |
---|
[507] | 14 | |
---|
[471] | 15 | //#include "xml/xmlParser.h" |
---|
[164] | 16 | |
---|
| 17 | #ifndef __MODULE_LEVELLOADER__ |
---|
| 18 | #define __MODULE_LEVELLOADER__ |
---|
| 19 | |
---|
| 20 | using namespace std; |
---|
| 21 | |
---|
| 22 | namespace loader |
---|
| 23 | { |
---|
[379] | 24 | class _LoaderExport LevelLoader |
---|
[164] | 25 | { |
---|
[507] | 26 | public: |
---|
| 27 | // Constructors, loads the level file and some information data |
---|
| 28 | LevelLoader(string file, string dir="levels"); |
---|
| 29 | // Destructor |
---|
| 30 | ~LevelLoader(); |
---|
| 31 | // Shows a simple loading screen |
---|
| 32 | void showLoadingScreen(); |
---|
| 33 | // Loads all level data |
---|
| 34 | void loadLevel(); |
---|
| 35 | |
---|
| 36 | // Getters |
---|
| 37 | string name(); |
---|
| 38 | string description(); |
---|
| 39 | string image(); |
---|
[164] | 40 | private: |
---|
| 41 | // Level information |
---|
[470] | 42 | std::string name_; |
---|
| 43 | std::string description_; |
---|
| 44 | std::string image_; |
---|
[474] | 45 | std::string loadingBackgroundColor_; |
---|
| 46 | std::string loadingBackgroundImage_; |
---|
| 47 | std::string loadingBarImage_; |
---|
| 48 | std::string loadingBarTop_; |
---|
| 49 | std::string loadingBarLeft_; |
---|
| 50 | std::string loadingBarWidth_; |
---|
| 51 | std::string loadingBarHeight_; |
---|
[480] | 52 | |
---|
[507] | 53 | // Set to true if it was possible to load the level file |
---|
[480] | 54 | bool valid_; |
---|
[164] | 55 | |
---|
[507] | 56 | // Xml-Stuff |
---|
[480] | 57 | TiXmlDocument doc; |
---|
| 58 | TiXmlElement* rootElement; |
---|
[164] | 59 | |
---|
| 60 | |
---|
| 61 | }; |
---|
| 62 | } |
---|
| 63 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.