Changeset 4091 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 6, 2005, 8:02:26 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r4057 r4091 131 131 defs/error.h \ 132 132 defs/debug.h \ 133 defs/globals.h \ 133 134 lib/coord/p_node.h \ 134 135 lib/coord/null_parent.h \ -
orxonox/trunk/src/Makefile.in
r4061 r4091 372 372 defs/error.h \ 373 373 defs/debug.h \ 374 defs/globals.h \ 374 375 lib/coord/p_node.h \ 375 376 lib/coord/null_parent.h \ -
orxonox/trunk/src/command_node.cc
r4089 r4091 126 126 // create parser 127 127 IniParser parser (filename); 128 if( parser.getSection ( "player1") == -1)129 { 130 PRINTF(1)("Could not find key bindings in %s\n", filename);128 if( parser.getSection (CONFIG_SECTION_PLAYER "1") == -1) 129 { 130 PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1 in %s\n", filename); 131 131 return; 132 132 } … … 162 162 163 163 // PARSE MISC SECTION 164 if( parser.getSection ( "miscKeys") == -1)164 if( parser.getSection (CONFIG_SECTION_MISC_KEYS) == -1) 165 165 { 166 166 PRINTF(1)("Could not find key bindings in %s\n", filename); -
orxonox/trunk/src/defs/stdincl.h
r4010 r4091 25 25 #include "error.h" 26 26 #include "debug.h" 27 #include "globals.h" 27 28 28 29 #include "compiler.h" -
orxonox/trunk/src/game_loader.cc
r4020 r4091 214 214 bool GameLoader::worldCommand (Command* cmd) 215 215 { 216 if( !strcmp( cmd->cmd, "up_world"))216 if( !strcmp( cmd->cmd, CONFIG_NAME_NEXT_WORLD)) 217 217 { 218 218 if( !cmd->bUp) … … 222 222 return true; 223 223 } 224 else if( !strcmp( cmd->cmd, "down_world"))224 else if( !strcmp( cmd->cmd, CONFIG_NAME_PREV_WORLD)) 225 225 { 226 226 if( !cmd->bUp) … … 230 230 return true; 231 231 } 232 else if( !strcmp( cmd->cmd, "pause"))232 else if( !strcmp( cmd->cmd, CONFIG_NAME_PAUSE)) 233 233 { 234 234 if( !cmd->bUp) … … 241 241 return true; 242 242 } 243 else if( !strcmp( cmd->cmd, "quit"))243 else if( !strcmp( cmd->cmd, CONFIG_NAME_QUIT)) 244 244 { 245 245 if( !cmd->bUp) this->stop(); -
orxonox/trunk/src/lib/gui/gui/gui_audio.cc
r4056 r4091 36 36 37 37 audioFrame = new Frame("Audio-Options:"); 38 audioFrame->setGroupName( "audio");38 audioFrame->setGroupName(CONFIG_SECTION_AUDIO); 39 39 { 40 40 Box* audioBox; //!< The Box that holds the audio Options. … … 45 45 Slider* effectsVolume; //!< A Slider for effects volume. 46 46 47 enableSound = new CheckButton( "Disable Sound");47 enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); 48 48 enableSound->setFlagName ("no-sound", 0); 49 49 enableSound->saveability(); 50 50 audioBox->fill(enableSound); 51 Label* musicVolumeLabel = new Label( "Music Volume");51 Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME); 52 52 audioBox->fill(musicVolumeLabel); 53 53 musicVolume = new Slider("Music Volume", 0, 100); … … 55 55 musicVolume->saveability(); 56 56 audioBox->fill (musicVolume); 57 Label* effectsVolumeLabel = new Label ( "Effects Volume");57 Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME); 58 58 audioBox->fill (effectsVolumeLabel); 59 59 effectsVolume = new Slider ("Effects Volume", 0, 100); -
orxonox/trunk/src/lib/gui/gui/gui_exec.cc
r4071 r4091 53 53 54 54 execBox = new Box('v'); 55 execFrame->setGroupName( "misc");55 execFrame->setGroupName(CONFIG_SECTION_MISC); 56 56 { 57 57 Button* start; //!< The start Button of orxonox. … … 65 65 #endif /* HAVE_GTK2 */ 66 66 execBox->fill(start); 67 this->saveSettings = new CheckButton( "Save Settings");67 this->saveSettings = new CheckButton(CONFIG_NAME_SAVE_SETTINGS); 68 68 this->saveSettings->value = 1; 69 69 this->saveSettings->saveability(); 70 70 execBox->fill(this->saveSettings); 71 71 72 verboseMode = new Menu( "verbose mode", "nothing", "error", "warning", "info", "lastItem");72 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", "error", "warning", "info", "lastItem"); 73 73 verboseMode->setFlagName("verbose", "v", 2); 74 74 verboseMode->saveability(); 75 75 execBox->fill(verboseMode); 76 76 77 alwaysShow = new CheckButton( "Always Show this Menu");77 alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI); 78 78 alwaysShow->setFlagName("gui", "g", 0); 79 79 alwaysShow->saveability(); -
orxonox/trunk/src/lib/gui/gui/gui_gtk.h
r4089 r4091 11 11 12 12 #include "debug.h" 13 #include "globals.h" 13 14 14 15 #ifdef HAVE_GTK2 -
orxonox/trunk/src/lib/gui/gui/gui_keys.cc
r4089 r4091 50 50 PlayerKeys* player2; //!< The seconds Player's keys. 51 51 52 player1 = new PlayerKeys( "player1");53 player2 = new PlayerKeys( "player2");52 player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1"); 53 player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2"); 54 54 55 55 keysBox1->fill(player1->getOpenButton()); … … 115 115 116 116 pKeysBox->setGroupName(player); 117 pKeysBox->fill(addKey("up", "UP")); 118 pKeysBox->fill(addKey("down", "DOWN")); 119 pKeysBox->fill(addKey("left", "LEFT")); 120 pKeysBox->fill(addKey("right", "RIGHT")); 121 pKeysBox->fill(addKey("fire", "SPACE")); 117 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP")); 118 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN")); 119 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT")); 120 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT")); 121 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE")); 122 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m")); 123 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n")); 122 124 closeButton = new Button("close"); 123 125 #ifdef HAVE_GTK2 … … 174 176 Button* closeButton; //!< The CloseButton for this key-settings. 175 177 176 keysBox->setGroupName( "miscKeys");177 keysBox->fill(addKey( "quit", "ESCAPE"));178 keysBox->fill(addKey( "pause", "PAUSE"));179 keysBox->fill(addKey( "up_world", "x"));180 keysBox->fill(addKey( "down_world", "z"));181 keysBox->fill(addKey( "view0", "1"));182 keysBox->fill(addKey( "view1", "2"));183 keysBox->fill(addKey( "view2", "3"));184 keysBox->fill(addKey( "view3", "4"));185 keysBox->fill(addKey( "view4", "5"));186 keysBox->fill(addKey( "view5", "6"));178 keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS); 179 keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE")); 180 keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE")); 181 keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x")); 182 keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z")); 183 keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1")); 184 keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2")); 185 keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3")); 186 keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4")); 187 keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5")); 188 keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6")); 187 189 188 190 closeButton = new Button("close"); -
orxonox/trunk/src/lib/gui/gui/gui_update.cc
r4083 r4091 50 50 51 51 this->updateFrame = new Frame("Update-Options:"); 52 this->updateFrame->setGroupName( "update");52 this->updateFrame->setGroupName(CONFIG_SECTION_DATA); 53 53 this->updateBox = new Box('v'); 54 54 55 dataDirButton = new Button( "Data Directory");56 dataDirLabel = new OptionLabel( "DataDir", "unknown");55 dataDirButton = new Button(CONFIG_NAME_DATADIR); 56 dataDirLabel = new OptionLabel(CONFIG_NAME_DATADIR, "unknown"); 57 57 dataDirLabel->saveability(); 58 58 dataDirDialog = new FileDialog("data-Repos-location"); … … 70 70 71 71 // the Button for autoUpdating 72 this->autoUpdate = new CheckButton( "auto update");72 this->autoUpdate = new CheckButton(CONFIG_NAME_AUTO_UPDATE); 73 73 this->updateBox->fill(this->autoUpdate); 74 74 this->autoUpdate->setFlagName("update", "u", 0); -
orxonox/trunk/src/lib/gui/gui/gui_video.cc
r4068 r4091 49 49 CheckButton* wireframe; //!< CheckButton for wireframe Mode. 50 50 51 fullscreen = new CheckButton( "Fullscreen-mode");51 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN); 52 52 fullscreen->setFlagName("windowed", "q", 1); 53 53 fullscreen->saveability(); 54 54 videoBox->fill(fullscreen); 55 resolution = new Menu( "Resolution");55 resolution = new Menu(CONFIG_NAME_RESOLUTION); 56 56 getResolutions(resolution); 57 57 resolution->saveability(); 58 58 resolution->setFlagName("resolution", "r", 0); 59 59 videoBox->fill(resolution); 60 wireframe = new CheckButton( "WireFrame-mode");60 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME); 61 61 wireframe->setFlagName("wireframe", "w", 0); 62 62 wireframe->saveability(); … … 91 91 // the Window itself 92 92 advancedWindow = new Window("Advanced Video Options"); 93 advancedWindow->setGroupName( "advancedVideoOptions");93 advancedWindow->setGroupName(CONFIG_SECTION_VIDEO_ADVANCED); 94 94 { 95 95 Box* advancedBox; //!< A Box to pack the options into. … … 111 111 112 112 // Advanced Performance Options 113 shadows = new CheckButton( "Shadows");113 shadows = new CheckButton(CONFIG_NAME_SHADOWS); 114 114 shadows->saveability(); 115 115 advancedBox->fill(shadows); 116 116 117 fog = new CheckButton( "Fog");117 fog = new CheckButton(CONFIG_NAME_FOG); 118 118 fog->saveability(); 119 119 advancedBox->fill(fog); 120 120 121 reflections = new CheckButton( "Reflections");121 reflections = new CheckButton(CONFIG_NAME_REFLECTIONS); 122 122 reflections->saveability(); 123 123 advancedBox->fill(reflections); 124 124 125 textures = new CheckButton( "Textures");125 textures = new CheckButton(CONFIG_NAME_TEXTURES); 126 126 textures->saveability(); 127 127 advancedBox->fill(textures); 128 128 129 textureDetail = new Menu( "Texture Detail", "low", "medium", "high", "lastItem");129 textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem"); 130 130 textureDetail->setDefaultValue(1); 131 131 textureDetail->saveability(); 132 132 advancedBox->fill(textureDetail); 133 133 134 modelDetailLabel = new Label( "Model Detail");134 modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL); 135 135 advancedBox->fill(modelDetailLabel); 136 modelDetail = new Menu( "Model Detail", "low", "high", "lastItem");136 modelDetail = new Menu(CONFIG_NAME_MODEL_DETAIL, "low", "high", "lastItem"); 137 137 modelDetail->setDefaultValue(1); 138 138 modelDetail->saveability(); … … 141 141 antiAliasingLabel = new Label("Anti-Aliasing-depth:"); 142 142 advancedBox->fill(antiAliasingLabel); 143 antiAliasing = new Menu( "Anti Aliasing", "0", "1", "2", "4", "8", "lastItem");143 antiAliasing = new Menu(CONFIG_NAME_ANTI_ALIASING, "0", "1", "2", "4", "8", "lastItem"); 144 144 antiAliasing->setDefaultValue(2); 145 145 antiAliasing->saveability(); … … 148 148 filterMethodLabel = new Label("Filtering Method:"); 149 149 advancedBox->fill(filterMethodLabel); 150 filterMethod = new Menu( "Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");150 filterMethod = new Menu(CONFIG_NAME_FILTER_METHOD, "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem"); 151 151 filterMethod->setDefaultValue(1); 152 152 filterMethod->saveability(); -
orxonox/trunk/src/orxonox.cc
r4084 r4091 32 32 #include "data_tank.h" 33 33 #include "command_node.h" 34 #include "ini_parser.h" 34 35 #include "game_loader.h" 35 36 #include "graphics_engine.h" … … 173 174 int Orxonox::initResources() 174 175 { 175 // printf("Not yet implemented\n");176 176 PRINT(3)("initializing ResourceManager\n"); 177 177 resourceManager = ResourceManager::getInstance(); 178 if (!resourceManager->setDataDir("../data/")) 179 { 180 PRINTF(1)("Data Could not be located\n"); 178 179 // create parser 180 IniParser parser (DEFAULT_CONFIG_FILE); 181 if( parser.getSection (CONFIG_SECTION_DATA) == -1) 182 { 183 PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE); 184 return -1; 185 } 186 char namebuf[256]; 187 char valuebuf[256]; 188 memset (namebuf, 0, 256); 189 memset (valuebuf, 0, 256); 190 191 while( parser.nextVar (namebuf, valuebuf) != -1) 192 { 193 if (!strcmp(namebuf, CONFIG_NAME_DATADIR)) 194 { 195 // printf("Not yet implemented\n"); 196 if (!resourceManager->setDataDir(valuebuf)) 197 { 198 PRINTF(1)("Data Could not be located\n"); 199 exit(-1); 200 } 201 } 202 203 memset (namebuf, 0, 256); 204 memset (valuebuf, 0, 256); 205 } 206 207 if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE)) 208 { 209 PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n", 210 resourceManager->getDataDir(), 211 DEFAULT_CONFIG_FILE, 212 CONFIG_SECTION_DATA, 213 CONFIG_NAME_DATADIR); 181 214 exit(-1); 182 215 } 216 183 217 184 218 PRINT(3)("initializing TextEngine\n"); -
orxonox/trunk/src/story_entities/world.cc
r4015 r4091 1219 1219 bool World::command(Command* cmd) 1220 1220 { 1221 if( !strcmp( cmd->cmd, "view0")) this->localCamera->setViewMode(VIEW_NORMAL);1222 else if( !strcmp( cmd->cmd, "view1")) this->localCamera->setViewMode(VIEW_BEHIND);1223 else if( !strcmp( cmd->cmd, "view2")) this->localCamera->setViewMode(VIEW_FRONT);1224 else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);1225 else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);1226 else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);1221 if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW0)) this->localCamera->setViewMode(VIEW_NORMAL); 1222 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW1)) this->localCamera->setViewMode(VIEW_BEHIND); 1223 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW2)) this->localCamera->setViewMode(VIEW_FRONT); 1224 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW3)) this->localCamera->setViewMode(VIEW_LEFT); 1225 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT); 1226 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP); 1227 1227 1228 1228 return false; -
orxonox/trunk/src/util/resource_manager.cc
r4033 r4091 99 99 return false; 100 100 } 101 } 102 103 /** 104 \brief checks for the DataDirectory, by looking if 105 \param fileInside is inisde?? 106 */ 107 bool ResourceManager::checkDataDir(const char* fileInside) 108 { 109 bool retVal; 110 if (!isDir(this->dataDir)) 111 { 112 PRINTF(1)("%s is not a directory\n", this->dataDir); 113 return false; 114 } 115 116 char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1]; 117 sprintf(testFile, "%s%s", this->dataDir, fileInside); 118 retVal = isFile(testFile); 119 delete testFile; 120 return retVal; 101 121 } 102 122 -
orxonox/trunk/src/util/resource_manager.h
r4054 r4091 65 65 66 66 bool setDataDir(const char* dataDir); 67 /** \returns the Name of the data directory */ 68 const char* getDataDir(void) {return this->dataDir;} 69 bool checkDataDir(const char* fileInside); 67 70 bool addImageDir(char* imageDir); 68 71 void* load(const char* fileName, ResourcePriority prio = RP_NO, -
orxonox/trunk/src/world_entities/player.cc
r4010 r4091 294 294 { 295 295 PRINTF(3)("recieved command [%s]\n", cmd->cmd); 296 if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;297 if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;298 if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;299 if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;300 if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;301 if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;302 } 296 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp; 297 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp; 298 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp; 299 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp; 300 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp; 301 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange; 302 }
Note: See TracChangeset
for help on using the changeset viewer.