- Timestamp:
- Jul 3, 2005, 12:26:16 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/event/event.h
r4457 r4782 1 /*! 1 /*! 2 2 \file event.h 3 3 \brief an abstract event … … 25 25 int type; //!< the type field 26 26 bool bPressed; //!< is true, if the button/mouse was pressed, false if released 27 27 28 28 Uint16 x; //!< x coordinate 29 29 Uint16 y; //!< y coordinate 30 30 Sint16 xRel; //!< relative x movement to last point 31 31 Sint16 yRel; //!< relative y movement to last point 32 33 SDL_ResizeEvent resize; 32 34 }; 33 35 -
orxonox/trunk/src/lib/event/event_def.h
r4780 r4782 30 30 EV_JOY_BUTTON, 31 31 32 EV_VIDEO_RESIZE = SDL_VIDEORESIZE, 33 32 34 EV_UNKNOWN, 33 35 34 36 EV_NUMBER, 35 36 EV_VIDEO_RESIZE = SDL_VIDEORESIZE37 37 }; 38 38 … … 47 47 ES_ALL, //!< you want to register events for all states 48 48 49 ES_NUMBER, //!< the number of states49 ES_NUMBER, //!< the number of states 50 50 }; 51 51 -
orxonox/trunk/src/lib/event/event_handler.cc
r4780 r4782 252 252 ev.type = EV_JOY_BUTTON; 253 253 break; 254 case SDL_VIDEORESIZE: 255 ev.resize = event.resize; 256 break; 254 257 default: 255 258 ev.type = EV_UNKNOWN; -
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4777 r4782 218 218 \param resizeInfo SDL information about the size of the new screen size 219 219 */ 220 int GraphicsEngine::resolutionChanged( SDL_ResizeEvent*resizeInfo)221 { 222 this->setResolution(resizeInfo ->w, resizeInfo->h, this->bitsPerPixel);220 int GraphicsEngine::resolutionChanged(const SDL_ResizeEvent& resizeInfo) 221 { 222 this->setResolution(resizeInfo.w, resizeInfo.h, this->bitsPerPixel); 223 223 } 224 224 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4777 r4782 46 46 inline int getbbp() const { return this->bitsPerPixel; }; 47 47 48 int resolutionChanged( SDL_ResizeEvent*resizeInfo);48 int resolutionChanged(const SDL_ResizeEvent& resizeInfo); 49 49 50 50 static void enter2DMode(); -
orxonox/trunk/src/lib/lang/class_list.cc
r4778 r4782 47 47 ClassList::~ClassList () 48 48 { 49 delete this->objectList; 49 50 --ClassList::classCount; 50 51 } … … 65 66 { 66 67 ClassList* regClass; 68 PRINTF(5)("subscribe a %s\n", className ); 67 69 68 70 if(ClassList::first == NULL) … … 79 81 } 80 82 81 if (tmp->next == NULL) 83 if (unlikely(tmp->next == NULL)) 84 { 82 85 tmp->next = regClass = new ClassList(classID, className); 86 break; 87 } 83 88 tmp = tmp->next; 84 89 } -
orxonox/trunk/src/lib/lang/class_list.h
r4764 r4782 52 52 53 53 // STATIC MEMBERS 54 static ClassList* first; //!< The first Class in the List (should be BaseObject)54 static ClassList* first; //!< The first Class in the List 55 55 static unsigned int classCount; //!< The Count of classes that have been registered (should match the lower description) 56 56 }; -
orxonox/trunk/src/orxonox.cc
r4777 r4782 69 69 this->argc = 0; 70 70 this->argv = NULL; 71 71 72 } 72 73 … … 130 131 131 132 133 // initialize everything 132 134 SDL_Init (SDL_INIT_TIMER); 133 // initialize everything134 135 if( initResources () == -1) return -1; 135 136 if( initVideo() == -1) return -1; … … 137 138 if( initInput() == -1) return -1; 138 139 if( initNetworking () == -1) return -1; 139 //printf("> Initializing world\n"); 140 // if( init_world () == -1) return -1; PB: world will be initialized when started141 140 141 // subscribe the resolutionChanged-event 142 EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE); 142 143 return 0; 143 144 } … … 288 289 case SDL_VIDEORESIZE: 289 290 GraphicsEngine* tmpGEngine = GraphicsEngine::getInstance(); 290 tmpGEngine->resolutionChanged( &event->resize);291 tmpGEngine->resolutionChanged(event->resize); 291 292 break; 292 293 } … … 299 300 */ 300 301 void Orxonox::process(const Event &event) 301 {} 302 { 303 switch (event.type) 304 { 305 case EV_VIDEO_RESIZE: 306 GraphicsEngine::getInstance()->resolutionChanged(event.resize); 307 break; 308 } 309 310 } 302 311 303 312
Note: See TracChangeset
for help on using the changeset viewer.