Changeset 7905 in orxonox.OLD for branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
- Timestamp:
- May 27, 2006, 2:48:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
r7891 r7905 33 33 34 34 this->subscribeEvent(ES_MENU, EV_MOUSE_MOTION); 35 this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS); 35 36 36 37 … … 73 74 this->backMaterial().setDiffuse(color.x, color.y, color.z); 74 75 75 //if (this->movement != Vector2D())76 if (this->movement != Vector2D()) 76 77 { 77 /*if (this->getAbsCoor2D().x < 0.0 )78 if (this->getAbsCoor2D().x < 0.0 ) 78 79 movement.x = -this->getAbsCoor2D().x; 79 if (this->getAbsCoor2D().x > 200.0)80 movement.x = ( 200.0-this->getAbsCoor2D().x);80 if (this->getAbsCoor2D().x > this->_maxBorders.x) 81 movement.x = (this->_maxBorders.x-this->getAbsCoor2D().x); 81 82 if (this->getAbsCoor2D().y < 0.0 ) 82 movement. x= -this->getAbsCoor2D().y;83 if (this->getAbsCoor2D().y > 200.0)84 movement. x = (200.0-this->getAbsCoor2D().y);*/83 movement.y = -this->getAbsCoor2D().y; 84 if (this->getAbsCoor2D().y > this->_maxBorders.y) 85 movement.y = (this->_maxBorders.y-this->getAbsCoor2D().y); 85 86 87 newPos += movement; 86 88 87 88 //this->shiftCoor2D(movement);89 89 this->setAbsCoor2D(newPos); 90 90 movement = Vector2D(); … … 106 106 switch (event.type) 107 107 { 108 case EV_WINDOW_FOCUS: 109 if (event.bPressed) 110 { 111 int mouseX, mouseY; 112 SDL_GetMouseState(&mouseX, &mouseY); 113 newPos = Vector2D(mouseX, mouseY); 114 } 115 break; 108 116 case EV_MOUSE_MOTION: 109 newPos = Vector2D(event.x, event.y); 110 movement += Vector2D(event.xRel * _mouseSensitivity, event.yRel * _mouseSensitivity); 117 // newPos = Vector2D(event.x, event.y); 118 movement += Vector2D((float)event.xRel * _mouseSensitivity, (float)event.yRel * _mouseSensitivity); 119 movement.debug(); 111 120 break; 112 121
Note: See TracChangeset
for help on using the changeset viewer.