Changeset 1538
- Timestamp:
- Jun 4, 2008, 10:44:41 PM (17 years ago)
- Location:
- code/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/input/KeyBinder.cc
r1535 r1538 214 214 std::ifstream infile; 215 215 infile.open("keybindings.ini"); 216 if (!infile .is_open())216 if (!infile) 217 217 { 218 218 ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "def_keybindings.ini"); 219 219 ConfigFileManager::getSingleton()->save(CFT_Keybindings, "keybindings.ini"); 220 220 } 221 infile.close(); 221 else 222 infile.close(); 222 223 ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini"); 223 224 -
code/trunk/src/orxonox/GraphicsEngine.cc
r1535 r1538 34 34 #include "OrxonoxStableHeaders.h" 35 35 #include "GraphicsEngine.h" 36 37 #include <fstream> 36 38 37 39 #include <OgreConfigFile.h> … … 260 262 { 261 263 CCOUT(4) << "Configuring Renderer" << std::endl; 262 if (!root_->restoreConfig() && !root_->showConfigDialog()) 263 return false; 264 265 // check for file existence because Ogre displays exceptions if not 266 std::ifstream probe; 267 probe.open(ogreConfigFile_.c_str()); 268 if (!probe) 269 { 270 // create a zero sized file 271 std::ofstream creator; 272 creator.open(ogreConfigFile_.c_str()); 273 creator.close(); 274 } 275 else 276 probe.close(); 277 278 if (!root_->restoreConfig()) 279 if (!root_->showConfigDialog()) 280 return false; 264 281 265 282 CCOUT(4) << "Creating render window" << std::endl; -
code/trunk/src/orxonox/console/InGameConsole.cc
r1535 r1538 299 299 300 300 this->linesChanged(); 301 this->cursorChanged(); 301 302 } 302 303 … … 372 373 Shell::getInstance().registerListener(this); 373 374 this->linesChanged(); 375 this->cursorChanged(); 374 376 375 377 this->consoleOverlay_->show(); … … 460 462 } 461 463 462 void InGameConsole::setCursorPosition( int pos)464 void InGameConsole::setCursorPosition(unsigned int pos) 463 465 { 464 466 static std::string char1 = "bdefgilpqtzCEGIJKNOPQT5[}äü"; … … 471 473 472 474 float width = 0; 473 for ( int i = 0; i < pos; ++i)475 for (unsigned int i = 0; i < pos && i < displayedText_.size(); ++i) 474 476 { 475 477 if (char1.find(displayedText_[i]) != std::string::npos) -
code/trunk/src/orxonox/console/InGameConsole.h
r1535 r1538 72 72 void shiftLines(); 73 73 void colourLine(int colourcode, int index); 74 void setCursorPosition( int pos);74 void setCursorPosition(unsigned int pos); 75 75 void print(const std::string& text, int index, bool alwaysShift = false); 76 76 static Ogre::UTFString convert2UTF(std::string s);
Note: See TracChangeset
for help on using the changeset viewer.