fix broken system info view, fix mouse fuckedness in system view
git-svn-id: https://pioneer.svn.sourceforge.net/svnroot/pioneer/trunk@15 e632f14b-6550-0410-b89e-a82653faca30master
parent
c555550039
commit
2e2cfc3b29
|
@ -96,6 +96,11 @@ void SystemInfoView::SystemChanged(StarSystem *s)
|
|||
|
||||
void SystemInfoView::Draw3D()
|
||||
{
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glClearColor(0,0,0,0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
GenericSystemView::Draw3D();
|
||||
}
|
||||
|
||||
|
|
|
@ -202,14 +202,15 @@ void SystemView::Draw3D()
|
|||
|
||||
void SystemView::Update()
|
||||
{
|
||||
const float ft = Pi::GetFrameTime();
|
||||
if (Pi::KeyState(SDLK_EQUALS) ||
|
||||
m_zoomInButton->IsPressed()) m_zoom *= 1.01;
|
||||
m_zoomInButton->IsPressed()) m_zoom *= pow(4, ft);
|
||||
if (Pi::KeyState(SDLK_MINUS) ||
|
||||
m_zoomOutButton->IsPressed()) m_zoom *= 0.99;
|
||||
m_zoomOutButton->IsPressed()) m_zoom *= pow(0.25, ft);
|
||||
if (Pi::MouseButtonState(3)) {
|
||||
int motion[2];
|
||||
Pi::GetMouseMotion(motion);
|
||||
m_rot_x += motion[1]/4.0;
|
||||
m_rot_z += motion[0]/4.0;
|
||||
m_rot_x += motion[1]*20*ft;
|
||||
m_rot_z += motion[0]*20*ft;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,9 +177,9 @@ void Pi::HandleEvents()
|
|||
event.button.x, event.button.y);
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
// Pi::mouseMotion[0] += event.motion.xrel;
|
||||
// Pi::mouseMotion[1] += event.motion.yrel;
|
||||
SDL_GetRelativeMouseState(&Pi::mouseMotion[0], &Pi::mouseMotion[1]);
|
||||
Pi::mouseMotion[0] += event.motion.xrel;
|
||||
Pi::mouseMotion[1] += event.motion.yrel;
|
||||
// SDL_GetRelativeMouseState(&Pi::mouseMotion[0], &Pi::mouseMotion[1]);
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
Pi::Quit();
|
||||
|
|
Loading…
Reference in New Issue