Changeset 4833 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 11, 2005, 5:46:05 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/event/key_mapper.cc
r4759 r4833 56 56 57 57 //! this is the mapping array from names to ids: enter all orxonox.conf keys here 58 orxKeyMapping map[] = { {&KeyMapper::PEV_UP, "Up"}, 59 {&KeyMapper::PEV_DOWN, "Down"}, 60 {&KeyMapper::PEV_LEFT, "Left"}, 61 {&KeyMapper::PEV_RIGHT, "Right"}, 62 {&KeyMapper::PEV_STRAFE_LEFT, "StrafeLeft"}, 63 {&KeyMapper::PEV_STRAFE_RIGHT, "StrafeRight"}, 64 65 {&KeyMapper::PEV_FIRE1, "Fire"}, 66 {&KeyMapper::PEV_FIRE1, "Fire1"}, 67 {&KeyMapper::PEV_FIRE2, "Fire2"}, 68 {&KeyMapper::PEV_NEXT_WEAPON, "Next"}, 69 {&KeyMapper::PEV_PREVIOUS_WEAPON, "Prev"}, 70 71 72 {&KeyMapper::PEV_VIEW0, "view0"}, 73 {&KeyMapper::PEV_VIEW1, "view1"}, 74 {&KeyMapper::PEV_VIEW2, "view2"}, 75 {&KeyMapper::PEV_VIEW3, "view3"}, 76 {&KeyMapper::PEV_VIEW4, "view4"}, 77 {&KeyMapper::PEV_VIEW5, "view5"}, 78 79 {&KeyMapper::PEV_NEXT_WORLD, "Next-World"}, 80 {&KeyMapper::PEV_PREVIOUS_WORLD, "Prev-World"}, 81 82 {&KeyMapper::PEV_PAUSE, "Pause"}, 83 {&KeyMapper::PEV_QUIT, "Quit"}, 84 {NULL, NULL}}; 58 /** @todo use globals.h for this.... everything is done there for those Options, 59 * and you do not have to care about The namings 60 */ 61 orxKeyMapping map[] = { 62 {&KeyMapper::PEV_UP, "Up"}, 63 {&KeyMapper::PEV_DOWN, "Down"}, 64 {&KeyMapper::PEV_LEFT, "Left"}, 65 {&KeyMapper::PEV_RIGHT, "Right"}, 66 {&KeyMapper::PEV_STRAFE_LEFT, "StrafeLeft"}, 67 {&KeyMapper::PEV_STRAFE_RIGHT, "StrafeRight"}, 68 69 {&KeyMapper::PEV_FIRE1, "Fire"}, 70 {&KeyMapper::PEV_FIRE1, "Fire1"}, 71 {&KeyMapper::PEV_FIRE2, "Fire2"}, 72 {&KeyMapper::PEV_NEXT_WEAPON, "Next"}, 73 {&KeyMapper::PEV_PREVIOUS_WEAPON, "Prev"}, 74 75 76 {&KeyMapper::PEV_VIEW0, "view0"}, 77 {&KeyMapper::PEV_VIEW1, "view1"}, 78 {&KeyMapper::PEV_VIEW2, "view2"}, 79 {&KeyMapper::PEV_VIEW3, "view3"}, 80 {&KeyMapper::PEV_VIEW4, "view4"}, 81 {&KeyMapper::PEV_VIEW5, "view5"}, 82 83 {&KeyMapper::PEV_NEXT_WORLD, "Next-World"}, 84 {&KeyMapper::PEV_PREVIOUS_WORLD, "Prev-World"}, 85 86 {&KeyMapper::PEV_PAUSE, "Pause"}, 87 {&KeyMapper::PEV_QUIT, "Quit"}, 88 {NULL, NULL} 89 }; 85 90 86 91 -
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4831 r4833 45 45 46 46 this->fullscreenFlag = 0; 47 48 // this->listModes();49 50 // subscribe the resolutionChanged-event51 EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE);52 53 47 } 54 48 … … 85 79 int GraphicsEngine::initFromIniFile(IniParser* iniParser) 86 80 { 87 88 81 // looking if we are in fullscreen-mode 89 82 const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); … … 101 94 102 95 // searching for a usefull resolution 103 SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x'); 104 this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 96 // SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x'); 97 //resolution.debug(); 98 99 //this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 100 this->initVideo(640,480,16); 105 101 } 106 102 … … 154 150 glEnable(GL_DEPTH_TEST); 155 151 152 153 // subscribe the resolutionChanged-event 154 //EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE); 155 //! @todo eventSystem craps up the Starting of orxonox -> see why. 156 156 157 this->isInit = true; 157 158 } … … 247 248 248 249 /** 249 \briefif Textures should be enabled250 * if Textures should be enabled 250 251 */ 251 252 bool GraphicsEngine::texturesEnabled = true; 252 253 254 255 256 /** 257 * 258 * @param show if The mouse-cursor should be visible 259 */ 260 void GraphicsEngine::showMouse(bool show) 261 { 262 if (show) 263 SDL_ShowCursor(SDL_ENABLE); 264 else 265 SDL_ShowCursor(SDL_DISABLE); 266 } 267 268 /** 269 * 270 * @returns The Visinility of the mouse-cursor (true if visible, false if it is invisible) 271 */ 272 bool GraphicsEngine::isMouseVisible() 273 { 274 if (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) 275 return true; 276 else 277 return false; 278 } 279 280 /** 281 * 282 * @param steal If the Winodow-Managers Events should be stolen to this app 283 * (steals the mouse, and all WM-clicks) 284 * 285 * This only happens, if the HARD-Debug-level is set to 0,1,2, because otherwise a Segfault could 286 * result in the loss of System-controll 287 */ 288 void GraphicsEngine::stealWMEvents(bool steal) 289 { 290 #if DEBUG < 3 291 if (steal) 292 SDL_WM_GrabInput(SDL_GRAB_ON); 293 else SDL_WM_GrabInput(SDL_GRAB_OFF); 294 #endif 295 } 296 297 /** 298 * 299 * @returns true if Events are stolen from the WM, false if not. 300 */ 301 bool GraphicsEngine::isStealingEvents() 302 { 303 if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON) 304 return true; 305 else 306 return false; 307 }; 253 308 254 309 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4832 r4833 49 49 int resolutionChanged(const SDL_ResizeEvent& resizeInfo); 50 50 51 /** @param show if The mouse-cursor should be visible */ 52 inline static void showMouse(bool show) { (show)?SDL_ShowCursor(SDL_ENABLE):SDL_ShowCursor(SDL_DISABLE); }; 53 /** @returns The Visinility of the mouse-cursor (true if visible, false if it is invisible) */ 54 static bool isMouseVisible() { return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE)?true:false; }; 55 /** @param steal If the Winodow-Managers Events should be stolen to this app (steals the mouse, and all WM-clicks) */ 56 static void stealWMEvents(bool steal) { (steal)?SDL_WM_GrabInput(SDL_GRAB_ON):SDL_WM_GrabInput(SDL_GRAB_OFF); }; 57 /** @returns true if Events are stolen from the WM, false if not. */ 58 static bool isStealingEvents() { if (SDL_GRAB_ON) return true; }; 51 static void showMouse(bool show); 52 static bool isMouseVisible(); 53 static void stealWMEvents(bool steal); 54 static bool isStealingEvents(); 59 55 60 56 static void enter2DMode(); -
orxonox/trunk/src/lib/util/substring.cc
r4830 r4833 24 24 #include "substring.h" 25 25 26 #include "debug.h" 26 27 #include <string.h> 27 28 #include <assert.h> … … 91 92 return NULL; 92 93 } 94 95 96 97 /** 98 * Some nice debug information about this SubString 99 */ 100 void SubString::debug() const 101 { 102 PRINT(0)("Substring-information::count=%d ::", this->splittersCount); 103 for (int i = 0; i < this->splittersCount; i++) 104 PRINT(0)("s%d:%s::", i, this->strings[i]); 105 PRINT(0)("\n"); 106 } -
orxonox/trunk/src/lib/util/substring.h
r4830 r4833 17 17 const char* getString( int i); 18 18 19 void debug() const; 20 19 21 private: 20 22 char** strings; //!< strings produced from a single string splitted in multiple strings
Note: See TracChangeset
for help on using the changeset viewer.