[Fix] Fixed broken system info view.
[Fix] Fixed mouse screw up in system view.
This commit is contained in:
parent
fc03c9f6e3
commit
56dc9ee5a8
@ -171,7 +171,9 @@ void L3D::HandleEvents(void) {
|
|||||||
event.button.x, event.button.y);
|
event.button.x, event.button.y);
|
||||||
break;
|
break;
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
SDL_GetRelativeMouseState(&L3D::mouseMotion[0], &L3D::mouseMotion[1]);
|
L3D::mouseMotion[0] += event.motion.xrel;
|
||||||
|
L3D::mouseMotion[1] += event.motion.yrel;
|
||||||
|
//SDL_GetRelativeMouseState(&L3D::mouseMotion[0], &L3D::mouseMotion[1]);
|
||||||
break;
|
break;
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
L3D::Quit();
|
L3D::Quit();
|
||||||
|
@ -94,6 +94,11 @@ void SystemInfoView::SystemChanged(StarSystem* s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SystemInfoView::Draw3D(void) {
|
void SystemInfoView::Draw3D(void) {
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
glClearColor(0, 0, 0, 0);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
GenericSystemView::Draw3D();
|
GenericSystemView::Draw3D();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,15 +197,16 @@ void SystemView::Draw3D(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SystemView::Update(void) {
|
void SystemView::Update(void) {
|
||||||
|
const float ft = L3D::GetFrameTime();
|
||||||
if(L3D::KeyState(SDLK_EQUALS) ||
|
if(L3D::KeyState(SDLK_EQUALS) ||
|
||||||
m_zoomInButton->IsPressed()) m_zoom *= 1.01;
|
m_zoomInButton->IsPressed()) m_zoom *= pow(4, ft);
|
||||||
if(L3D::KeyState(SDLK_MINUS) ||
|
if(L3D::KeyState(SDLK_MINUS) ||
|
||||||
m_zoomOutButton->IsPressed()) m_zoom *= 0.99;
|
m_zoomOutButton->IsPressed()) m_zoom *= pow(0.25, ft);
|
||||||
if(L3D::MouseButtonState(3)) {
|
if(L3D::MouseButtonState(3)) {
|
||||||
int motion[2];
|
int motion[2];
|
||||||
L3D::GetMouseMotion(motion);
|
L3D::GetMouseMotion(motion);
|
||||||
m_rot_x += motion[1]/4.0;
|
m_rot_x += motion[1]*20*ft;
|
||||||
m_rot_z += motion[0]/4.0;
|
m_rot_z += motion[0]*20*ft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user