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-a82653faca30
master
tompox 2008-06-28 20:00:50 +00:00
parent c555550039
commit 2e2cfc3b29
3 changed files with 13 additions and 7 deletions

View File

@ -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();
}

View File

@ -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;
}
}

View File

@ -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();