From 6f1cac33c1adad10b2e49af6c4a37e393b608abb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 3 Jan 2004 07:18:43 +0000 Subject: [PATCH] cleanup. --- .../arch/InputHandler/InputHandler_SDL.cpp | 82 ++++++------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp b/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp index 72c88deb34..95997225f4 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp @@ -27,7 +27,7 @@ InputHandler_SDL::InputHandler_SDL() #ifdef _XBOX //strange hardware timing issue with 3rd party controllers - Sleep(750) ; + Sleep(750); #endif SDL_EnableKeyRepeat( 0, 0 ); @@ -88,13 +88,11 @@ InputHandler_SDL::~InputHandler_SDL() void InputHandler_SDL::Update(float fDeltaTime) { #ifdef _XBOX - - static int lastValX1 = 0 ; - static int lastValY1 = 0 ; - static int lastValX2 = 0 ; - static int lastValY2 = 0 ; - static int resolutionChanged = 0 ; - + static int lastValX1 = 0; + static int lastValY1 = 0; + static int lastValX2 = 0; + static int lastValY2 = 0; + static int resolutionChanged = 0; #endif SDL_Event event; @@ -133,57 +131,27 @@ void InputHandler_SDL::Update(float fDeltaTime) case SDL_JOYAXISMOTION: { #ifdef _XBOX - resolutionChanged = 1 ; + /* XXX: If you want to adjust the screen, use the menu. Screen + * adjustment code doesn't belong in the input driver. */ + resolutionChanged = 1; if ( abs(event.jaxis.value) > 15600 ) { switch ( event.jaxis.axis ) { - case 0 : - { - lastValX1 = event.jaxis.value ; - break; - } - case 1 : - { - lastValY1 = event.jaxis.value ; - break; - } - case 2 : - { - lastValX2 = event.jaxis.value ; - break; - } - case 3 : - { - lastValY2 = event.jaxis.value ; - break; - } + case 0: lastValX1 = event.jaxis.value; break; + case 1: lastValY1 = event.jaxis.value; break; + case 2: lastValX2 = event.jaxis.value; break; + case 3: lastValY2 = event.jaxis.value; break; } } else { switch ( event.jaxis.axis ) { - case 0 : - { - lastValX1 = 0; - break; - } - case 1 : - { - lastValY1 = 0 ; - break; - } - case 2 : - { - lastValX2 = 0; - break; - } - case 3 : - { - lastValY2 = 0; - break; - } + case 0: lastValX1 = 0; break; + case 1: lastValY1 = 0; break; + case 2: lastValX2 = 0; break; + case 3: lastValY2 = 0; break; } } #else @@ -214,22 +182,22 @@ void InputHandler_SDL::Update(float fDeltaTime) { if ( lastValX1 || lastValY1 || lastValX2 || lastValY2 ) { - PREFSMAN->m_fScreenPosX += ((float)lastValX1/32767.0f) ; + PREFSMAN->m_fScreenPosX += ((float)lastValX1/32767.0f); if ( PREFSMAN->m_fScreenPosX < 0) - PREFSMAN->m_fScreenPosX = 0 ; + PREFSMAN->m_fScreenPosX = 0; - PREFSMAN->m_fScreenPosY -= ((float)lastValY1/32767.0f) ; + PREFSMAN->m_fScreenPosY -= ((float)lastValY1/32767.0f); if ( PREFSMAN->m_fScreenPosY < 0) - PREFSMAN->m_fScreenPosY = 0 ; + PREFSMAN->m_fScreenPosY = 0; - PREFSMAN->m_fScreenWidth += ((float)lastValX2/32767.0f) ; - PREFSMAN->m_fScreenHeight -= ((float)lastValY2/32767.0f) ; + PREFSMAN->m_fScreenWidth += ((float)lastValX2/32767.0f); + PREFSMAN->m_fScreenHeight -= ((float)lastValY2/32767.0f); - DISPLAY->ResolutionChanged() ; + DISPLAY->ResolutionChanged(); } else { - resolutionChanged = 0 ; + resolutionChanged = 0; } } #endif