add ScreenTestLights

This commit is contained in:
Chris Danford
2004-03-23 06:33:01 +00:00
parent 0ca0f86d7e
commit ca215bdc82
8 changed files with 227 additions and 6 deletions
+18 -2
View File
@@ -1303,6 +1303,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -1598,6 +1599,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -1900,6 +1902,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -2113,6 +2116,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -2326,6 +2330,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -2566,6 +2571,7 @@ OKNumberP2X=410
OKNumberP2Y=352
OKNumberP2OnCommand=addx,320;sleep,0.7;decelerate,0.3;addx,-320
OKNumberP2OffCommand=sleep,0.1;accelerate,0.3;addx,320
MaxComboMaxDigits=4
MaxComboLabelX=0
MaxComboLabelY=0
MaxComboLabelOnCommand=diffusealpha,0
@@ -2895,6 +2901,12 @@ StyleIcon=0
MemoryCardIcons=0
TimerSeconds=0
[ScreenTestLights]
StyleIcon=0
MemoryCardIcons=0
TimerSeconds=0
Fallback=ScreenTestInput
[ScreenBookkeeping]
StyleIcon=0
MemoryCardIcons=0
@@ -3764,7 +3776,7 @@ PrevScreen=ScreenTitleMenu
# when using entries that change the screen; otherwise, the only way to
# exit the screen when in arcade mode is "exit".
LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
OptionMenuFlags=together;forceallplayers;smnavigation
# This NextScreen is only used for the "exit" choice.
Line1=list,Appearance Options
@@ -3783,7 +3795,8 @@ Line13=list,Profile Options
Line14=list,Other Options
Line15=list,Reload Songs/Courses
Line16=list,Test Input
Line17=list,Set Machine Time
Line17=list,Test Lights
Line18=list,Set Machine Time
[TextBanner]
TitleX=-90
@@ -4248,6 +4261,9 @@ Reload Songs/Courses,1=screen,ScreenReloadSongs;name,ReloadSongs
Test Input=1,together
Test InputDefault=
Test Input,1=screen,ScreenTestInput;name,TestInput
Test Lights=1,together
Test LightsDefault=
Test Lights,1=screen,ScreenTestLights;name,TestLights
Set Machine Time=1,together
Set Machine TimeDefault=
Set Machine Time,1=screen,ScreenSetTime;name,SetMachineTime
+24
View File
@@ -139,6 +139,16 @@ void LightsManager::Update( float fDeltaTime )
m_LightsState.m_bCabinetLights[cl] = true;
}
break;
case LIGHTSMODE_TEST:
{
int iSec = (int)RageTimer::GetTimeSinceStart();
FOREACH_CabinetLight( cl )
{
bool bOn = (iSec%NUM_CABINET_LIGHTS) == cl;
m_LightsState.m_bCabinetLights[cl] = bOn;
}
}
break;
default:
ASSERT(0);
}
@@ -183,6 +193,20 @@ void LightsManager::Update( float fDeltaTime )
}
}
break;
case LIGHTSMODE_TEST:
{
int iSec = (int)RageTimer::GetTimeSinceStart();
FOREACH_GameController( gc )
{
FOREACH_GameButton( gb )
{
bool bOn = (iSec%MAX_GAME_BUTTONS)==gb;
m_LightsState.m_bGameButtonLights[gc][gb] = bOn;
}
}
}
break;
default:
ASSERT(0);
}
+2 -1
View File
@@ -61,7 +61,8 @@ ScreenSelectMode.cpp ScreenSelectMode.h ScreenSelectMusic.cpp ScreenSelectMusic.
ScreenSetTime.cpp ScreenSetTime.h \
ScreenSongOptions.cpp ScreenSongOptions.h ScreenStage.cpp ScreenStage.h \
ScreenStyleSplash.cpp ScreenStyleSplash.h ScreenTest.cpp ScreenTest.h ScreenTestFonts.cpp ScreenTestFonts.h \
ScreenTestInput.h ScreenTestInput.cpp ScreenTestSound.cpp ScreenTestSound.h ScreenTextEntry.cpp ScreenTextEntry.h ScreenTitleMenu.cpp ScreenTitleMenu.h \
ScreenTestInput.h ScreenTestInput.cpp ScreenTestLights.h ScreenTestLights.cpp \
ScreenTestSound.cpp ScreenTestSound.h ScreenTextEntry.cpp ScreenTextEntry.h ScreenTitleMenu.cpp ScreenTitleMenu.h \
ScreenUnlock.cpp ScreenUnlock.h
+2
View File
@@ -294,6 +294,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM )
#include "ScreenAward.h"
#include "ScreenDownloadMachineStats.h"
#include "ScreenSetTime.h"
#include "ScreenTestLights.h"
Screen* Screen::Create( CString sClassName )
{
@@ -359,6 +360,7 @@ Screen* Screen::Create( CString sClassName )
IF_RETURN( ScreenAward );
IF_RETURN( ScreenDownloadMachineStats );
IF_RETURN( ScreenSetTime );
IF_RETURN( ScreenTestLights );
RageException::Throw( "Invalid Screen class name '%s'", sClassName.c_str() );
}
+109
View File
@@ -0,0 +1,109 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: ScreenTestLights
Desc: Where the player maps device input to pad input.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenTestLights.h"
#include "PrefsManager.h"
#include "ScreenManager.h"
#include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "InputMapper.h"
#include "GameManager.h"
#include "GameState.h"
#include "RageSounds.h"
#include "ThemeManager.h"
#include "RageDisplay.h"
#include "LightsManager.h"
ScreenTestLights::ScreenTestLights( CString sClassName ) : Screen( sClassName )
{
LOG->Trace( "ScreenTestLights::ScreenTestLights()" );
m_textInputs.LoadFromFont( THEME->GetPathToF("Common normal") );
m_textInputs.SetText( "" );
m_textInputs.SetXY( CENTER_X, CENTER_Y );
m_textInputs.SetDiffuse( RageColor(1,1,1,1) );
m_textInputs.SetZoom( 0.8f );
this->AddChild( &m_textInputs );
m_Menu.Load( "ScreenTestLights" );
this->AddChild( &m_Menu );
SOUND->PlayMusic( THEME->GetPathToS("ScreenTestLights music") );
LIGHTSMAN->SetLightsMode( LIGHTSMODE_TEST );
}
ScreenTestLights::~ScreenTestLights()
{
LOG->Trace( "ScreenTestLights::~ScreenTestLights()" );
}
void ScreenTestLights::Update( float fDeltaTime )
{
Screen::Update( fDeltaTime );
int iSec = (int)RageTimer::GetTimeSinceStart();
CString s;
s += ssprintf("cabinet light %d\n", iSec%NUM_CABINET_LIGHTS);
FOREACH_GameController( gc )
s += ssprintf("controller %d light %d\n", gc+1, iSec%MAX_GAME_BUTTONS);
m_textInputs.SetText( s );
}
void ScreenTestLights::DrawPrimitives()
{
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
}
void ScreenTestLights::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( type != IET_FIRST_PRESS && type != IET_SLOW_REPEAT )
return; // ignore
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default handler
}
void ScreenTestLights::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_GoToNextScreen:
case SM_GoToPrevScreen:
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
break;
}
}
void ScreenTestLights::MenuStart( PlayerNumber pn )
{
MenuBack(pn);
}
void ScreenTestLights::MenuBack( PlayerNumber pn )
{
if(!m_Menu.IsTransitioning())
{
SOUND->PlayOnce( THEME->GetPathToS("Common start") );
m_Menu.StartTransitioning( SM_GoToPrevScreen );
}
}
+40
View File
@@ -0,0 +1,40 @@
/*
-----------------------------------------------------------------------------
Class: ScreenTestLights
Desc: Where the player maps device input to instrument buttons.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "Sprite.h"
#include "BitmapText.h"
#include "PrefsManager.h"
#include "InputMapper.h"
#include "MenuElements.h"
#include "RageInputDevice.h"
class ScreenTestLights : public Screen
{
public:
ScreenTestLights( CString sName );
virtual ~ScreenTestLights();
virtual void DrawPrimitives();
virtual void Update( float fDelta );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void MenuStart( PlayerNumber pn );
virtual void MenuBack( PlayerNumber pn );
private:
BitmapText m_textInputs;
MenuElements m_Menu;
};
+25 -2
View File
@@ -65,7 +65,7 @@ IntDir=.\../Debug6
TargetDir=\stepmania\stepmania\Program
TargetName=StepMania-debug
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -142,7 +142,7 @@ IntDir=.\../Release6
TargetDir=\stepmania\stepmania\Program
TargetName=StepMania
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -1226,6 +1226,10 @@ SOURCE=.\FontCharmaps.h
# End Source File
# Begin Source File
SOURCE=.\ForeachEnum.h
# End Source File
# Begin Source File
SOURCE=.\GameConstantsAndTypes.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
@@ -5834,6 +5838,25 @@ SOURCE=.\ScreenTestInput.h
# End Source File
# Begin Source File
SOURCE=.\ScreenTestLights.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ScreenTestLights.h
# End Source File
# Begin Source File
SOURCE=.\ScreenTestSound.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
+7 -1
View File
@@ -13,7 +13,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="./../Program"
OutputDirectory="./../../itg/itg/Program"
IntermediateDirectory="./../Debug"
ConfigurationType="1"
UseOfMFC="0"
@@ -514,6 +514,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="ScreenTestInput.h">
</File>
<File
RelativePath="ScreenTestLights.cpp">
</File>
<File
RelativePath="ScreenTestLights.h">
</File>
<File
RelativePath="ScreenTestSound.cpp">
</File>