diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index ee2bbc4be8..78a51c572b 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2354,14 +2354,6 @@ DevicesY=SCREEN_TOP+30 DevicesOnCommand=zoom,0.6;diffusealpha,0;linear,0.5;diffusealpha,1 DevicesOffCommand=linear,0.5;diffusealpha,0 -[ScreenCenterImage] -Class="ScreenCenterImage" -Fallback="ScreenOptionsServiceChild" -AllowResize=true -TimerOnCommand=visible,false -NextScreen="ScreenOptionsService" -PrevScreen="ScreenOptionsService" - [ScreenTest] Fallback="ScreenWithMenuElementsBlank" @@ -3475,10 +3467,9 @@ ShowStyleIcon=false TimerSeconds=-1 AllowOperatorMenuButton=false -LineNames="1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17" +LineNames="1,4,5,6,7,8,9,10,11,12,13,14,15,16,17" # This NextScreen is only used for the "exit" choice. Line1="gamecommand;screen,ScreenAppearanceOptions;name,Appearance Options" -Line3="gamecommand;screen,ScreenCenterImage;name,Center Image" Line4="gamecommand;screen,ScreenCoinOptions;name,Coin Options" Line5="gamecommand;screen,ScreenMapControllers;name,Key Joy Mappings" Line6="gamecommand;screen,ScreenInputOptions;name,Input Options" @@ -3493,8 +3484,8 @@ Line14="gamecommand;screen,ScreenReloadSongs;name,Reload Songs" Line15="gamecommand;screen,ScreenTestInput;name,Test Input" Line16="gamecommand;screen,ScreenGameplaySyncMachine;name,Calibrate Machine Sync" Line17="gamecommand;screen,ScreenCredits2;name,Stepmania Credits" -GroupedScreens="ScreenOptionsService,ScreenAppearanceOptions,ScreenCenterImage,ScreenCoinOptions,ScreenMapControllers,ScreenInputOptions,ScreenGameplayOptions,ScreenGraphicOptions,ScreenMachineOptions,ScreenSoundOptions,ScreenOptionsManageProfiles,ScreenOtherOptions,ScreenNetworkOptions,ScreenReloadSongs,ScreenTestInput,ScreenCredits2" -PersistScreens="ScreenOptionsService,ScreenAppearanceOptions,ScreenCenterImage,ScreenCoinOptions,ScreenMapControllers,ScreenInputOptions,ScreenGameplayOptions,ScreenGraphicOptions,ScreenMachineOptions,ScreenSoundOptions,ScreenOptionsManageProfiles,ScreenOtherOptions,ScreenNetworkOptions,ScreenReloadSongs,ScreenTestInput,ScreenCredits2" +GroupedScreens="ScreenOptionsService,ScreenAppearanceOptions,ScreenCoinOptions,ScreenMapControllers,ScreenInputOptions,ScreenGameplayOptions,ScreenGraphicOptions,ScreenMachineOptions,ScreenSoundOptions,ScreenOptionsManageProfiles,ScreenOtherOptions,ScreenNetworkOptions,ScreenReloadSongs,ScreenTestInput,ScreenCredits2" +PersistScreens="ScreenOptionsService,ScreenAppearanceOptions,ScreenCoinOptions,ScreenMapControllers,ScreenInputOptions,ScreenGameplayOptions,ScreenGraphicOptions,ScreenMachineOptions,ScreenSoundOptions,ScreenOptionsManageProfiles,ScreenOtherOptions,ScreenNetworkOptions,ScreenReloadSongs,ScreenTestInput,ScreenCredits2" [ScreenOptionsServiceChild] Fallback="ScreenOptionsMaster" diff --git a/stepmania/src/ScreenCenterImage.cpp b/stepmania/src/ScreenCenterImage.cpp deleted file mode 100644 index 537290fc5f..0000000000 --- a/stepmania/src/ScreenCenterImage.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include "global.h" -#include "ScreenCenterImage.h" -#include "PrefsManager.h" -#include "ScreenManager.h" -#include "RageLog.h" -#include "ThemeManager.h" -#include "RageDisplay.h" -#include "ScreenDimensions.h" -#include "InputEventPlus.h" -#include "LocalizedString.h" -#include "HelpDisplay.h" - -static ThemeMetric ALLOW_RESIZE("ScreenCenterImage","AllowResize"); - -REGISTER_SCREEN_CLASS( ScreenCenterImage ); - -void ScreenCenterImage::Init() -{ - ZERO( m_fScale ); - - ScreenWithMenuElements::Init(); - -#if defined(XBOX) - // XXX - SetHelpText( "Use the left analog stick to translate the screen and right right analog stick to scale" ); -#endif - - m_textInstructions.LoadFromFont( THEME->GetPathF("Common","normal") ); - m_textInstructions.SetText( "" ); - m_textInstructions.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y ); - m_textInstructions.SetDiffuse( RageColor(0,1,0,0) ); - m_textInstructions.SetZoom( 0.8f ); - this->AddChild( &m_textInstructions ); -} - - -ScreenCenterImage::~ScreenCenterImage() -{ - LOG->Trace( "ScreenCenterImage::~ScreenCenterImage()" ); -} - - - -void ScreenCenterImage::Input( const InputEventPlus &input ) -{ - if( IsTransitioning() ) - return; - - if( input.type == IET_FIRST_PRESS ) - { - if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_SPACE ) - { - PREFSMAN->m_iCenterImageTranslateX.Set( 0 ); - PREFSMAN->m_iCenterImageTranslateY.Set( 0 ); - PREFSMAN->m_fCenterImageAddWidth.Set( 0 ); - PREFSMAN->m_fCenterImageAddHeight.Set( 0 ); - return; - } - - switch( input.MenuI ) - { - case MENU_BUTTON_START: - SCREENMAN->PlayStartSound(); - StartTransitioningScreen( SM_GoToNextScreen ); - return; - - case MENU_BUTTON_BACK: - StartTransitioningScreen( SM_GoToPrevScreen ); - return; - } - } - - if( !ALLOW_RESIZE ) - return; - - bool bIncrease = false; - - Axis axis = NUM_AXES; - switch( input.MenuI ) - { - case MENU_BUTTON_UP: axis = AXIS_TRANS_Y; bIncrease = false; break; - case MENU_BUTTON_DOWN: axis = AXIS_TRANS_Y; bIncrease = true; break; - case MENU_BUTTON_LEFT: axis = AXIS_TRANS_X; bIncrease = false; break; - case MENU_BUTTON_RIGHT: axis = AXIS_TRANS_X; bIncrease = true; break; - default: - if( !input.DeviceI.IsJoystick() ) - return; - - /* Secondary axes aren't always mapped correctly; for example, PS2 converters - * tend to map the right stick to weird things, and every one is different, - * so they usually won't work. */ - switch( input.DeviceI.button ) - { - case JOY_UP: axis = AXIS_TRANS_Y; bIncrease = false; break; - case JOY_DOWN: axis = AXIS_TRANS_Y; bIncrease = true; break; - case JOY_LEFT: axis = AXIS_TRANS_X; bIncrease = false; break; - case JOY_RIGHT: axis = AXIS_TRANS_X; bIncrease = true; break; - case JOY_UP_2: axis = AXIS_SCALE_Y; bIncrease = false; break; - case JOY_DOWN_2: axis = AXIS_SCALE_Y; bIncrease = true; break; - case JOY_LEFT_2: axis = AXIS_SCALE_X; bIncrease = false; break; - case JOY_RIGHT_2: axis = AXIS_SCALE_X; bIncrease = true; break; - } - } - - if( axis == NUM_AXES ) - return; - - if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT)) || - INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT)) ) - { - const Axis switch_axis[] = { AXIS_SCALE_X, AXIS_SCALE_Y, AXIS_TRANS_X, AXIS_TRANS_Y }; - axis = switch_axis[axis]; - } - - float fScale = 1.0f; - if( input.type == IET_RELEASE ) - fScale = 0; - - if( input.DeviceI.level >= 0 ) - { - /* Increase the dead zone. XXX: input drivers should handle dead zones */ - if( input.DeviceI.level < 0.10f ) - fScale = 0; - else - fScale = SCALE( input.DeviceI.level, 0.10f, 1.0f, 0.0f, 1.0f ); - } - - if( input.DeviceI.level < 0 ) - { - if( input.type == IET_REPEAT ) - { - if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) - fScale *= 10; - else - fScale *= 40; - } - - if( !bIncrease ) - fScale *= -1; - - Move( axis, fScale ); - return; - } - - fScale = SCALE( fScale, 0.0f, 1.0f, 0.0f, 25.0f ); - fScale = powf( fScale, 2.0f ); - - if( !bIncrease ) - fScale *= -1; - - m_fScale[axis] = fScale; -} - -static LocalizedString CENTERING( "ScreenCenterImage", "Centering: x %d, y %d, width %d, height %d" ); -void ScreenCenterImage::Move( Axis axis, float fDelta ) -{ - Preference *piValues[4] = - { - &PREFSMAN->m_iCenterImageTranslateX, - &PREFSMAN->m_iCenterImageTranslateY, - &PREFSMAN->m_fCenterImageAddWidth, - &PREFSMAN->m_fCenterImageAddHeight - }; - - piValues[axis]->Set( *piValues[axis] + lrintf( fDelta ) ); - - DISPLAY->ChangeCentering( - PREFSMAN->m_iCenterImageTranslateX, - PREFSMAN->m_iCenterImageTranslateY, - PREFSMAN->m_fCenterImageAddWidth, - PREFSMAN->m_fCenterImageAddHeight ); - - RString sMessage = - ssprintf( CENTERING.GetValue(), - PREFSMAN->m_iCenterImageTranslateX.Get(), - PREFSMAN->m_iCenterImageTranslateY.Get(), - PREFSMAN->m_fCenterImageAddWidth.Get(), - PREFSMAN->m_fCenterImageAddHeight.Get() ); - SCREENMAN->SystemMessageNoAnimate( sMessage ); -} - -void ScreenCenterImage::Update( float fDeltaTime ) -{ - for( int i = 0; i < NUM_AXES; ++i ) - Move( (Axis) i, m_fScale[i] * fDeltaTime ); - - Screen::Update( fDeltaTime ); -} - -/* - * (c) 2003-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/stepmania/src/ScreenCenterImage.h b/stepmania/src/ScreenCenterImage.h deleted file mode 100644 index 835a834ffa..0000000000 --- a/stepmania/src/ScreenCenterImage.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ScreenCenterImage - Allows the user to adjust screen centering. */ - -#ifndef SCREEN_CENTER_IMAGE_H -#define SCREEN_CENTER_IMAGE_H - -#include "ScreenWithMenuElements.h" -#include "BitmapText.h" - - -class ScreenCenterImage : public ScreenWithMenuElements -{ -public: - void Init(); - virtual ~ScreenCenterImage(); - - virtual void Input( const InputEventPlus &input ); - virtual void Update( float fDeltaTime ); - -private: - BitmapText m_textInstructions; - - enum Axis { AXIS_TRANS_X, AXIS_TRANS_Y, AXIS_SCALE_X, AXIS_SCALE_Y, NUM_AXES }; - float m_fScale[NUM_AXES]; - - void Move( Axis axis, float fDeltaTime ); -}; - -#endif - -/* - * (c) 2003-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/stepmania/src/StepMania-net2003.vcproj b/stepmania/src/StepMania-net2003.vcproj index 219eb007c5..8f5889f99f 100644 --- a/stepmania/src/StepMania-net2003.vcproj +++ b/stepmania/src/StepMania-net2003.vcproj @@ -280,12 +280,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - -