From 321adf57e06b8e24e2430443ddc6d5dff6c14303 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Jun 2003 07:03:51 +0000 Subject: [PATCH] add DifficultyDisplay --- stepmania/src/DifficultyDisplay.cpp | 46 ++++++++++++++++++++++++++ stepmania/src/DifficultyDisplay.h | 31 ++++++++++++++++++ stepmania/src/StepMania.dsp | 51 +++++++++++++++++++---------- stepmania/src/StepMania.vcproj | 6 ++++ 4 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 stepmania/src/DifficultyDisplay.cpp create mode 100644 stepmania/src/DifficultyDisplay.h diff --git a/stepmania/src/DifficultyDisplay.cpp b/stepmania/src/DifficultyDisplay.cpp new file mode 100644 index 0000000000..867c265899 --- /dev/null +++ b/stepmania/src/DifficultyDisplay.cpp @@ -0,0 +1,46 @@ +#include "global.h" +#include "DifficultyDisplay.h" +#include "song.h" +#include "ThemeManager.h" + +#define ICONONCOMMAND THEME->GetMetric ("DifficultyDisplay","IconOnCommand") +#define ICONOFFCOMMAND THEME->GetMetric ("DifficultyDisplay","IconOffCommand") + +DifficultyDisplay::DifficultyDisplay() +{ + float fWidth = 0; + int diff; + for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff ) + { + m_difficulty[diff].Load( THEME->GetPathToG("DifficultyDisplay bar 5x1") ); + m_difficulty[diff].SetState(diff); + m_difficulty[diff].StopAnimating(); + this->AddChild( &m_difficulty[diff] ); + + fWidth += m_difficulty[diff].GetUnzoomedWidth(); + } + + float fX = -fWidth/2; + for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff ) + { + m_difficulty[diff].SetHorizAlign( align_left ); + m_difficulty[diff].SetX( fX ); + fX += m_difficulty[diff].GetUnzoomedWidth(); + } +} + +void DifficultyDisplay::SetDifficulties( const Song* pSong, NotesType curType ) +{ + for( int diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff ) + { + if( pSong->SongHasNotesTypeAndDifficulty( curType, Difficulty(diff) ) ) + m_difficulty[diff].Command( ICONONCOMMAND ); + else + m_difficulty[diff].Command( ICONOFFCOMMAND ); + } +} + +/* + Copyright (c) 2003 by the person(s) listed below. All rights reserved. + Steven Towle +*/ diff --git a/stepmania/src/DifficultyDisplay.h b/stepmania/src/DifficultyDisplay.h new file mode 100644 index 0000000000..670ddf7020 --- /dev/null +++ b/stepmania/src/DifficultyDisplay.h @@ -0,0 +1,31 @@ +#ifndef DIFFICULTY_DISPLAY_H +#define DIFFICULTY_DISPLAY_H + +/* +----------------------------------------------------------------------- +File: DifficultyDisplay.h + +Desc: A graphic displayed on the screen during dance + +Copyright (c) 2003 by the person(s) listed below. All rights reserved. + Steven Towle +----------------------------------------------------------------------- +*/ + +#include "GameConstantsAndTypes.h" +#include "Sprite.h" +#include "ActorFrame.h" + +class Song; + +class DifficultyDisplay : public ActorFrame +{ +public: + DifficultyDisplay(); + void SetDifficulties( const Song* pSong, NotesType curType ); + +protected: + Sprite m_difficulty[NUM_DIFFICULTIES]; +}; + +#endif diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index e6062a67ff..d3c18338da 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -61,10 +61,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\projects\stepmania\stepmania +TargetDir=\temp\stepmania 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 ia32.vdi # End Special Build Tool @@ -82,25 +82,25 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # PROP Intermediate_Dir "StepMania___Xbox_Debug___VC6" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO +XBE=imagebld.exe +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /stack:0x10000 /debug LINK32=link.exe # ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" # SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib -XBE=imagebld.exe -# ADD BASE XBE /nologo /stack:0x10000 /debug -# ADD XBE /nologo /stack:0x10000 /debug -XBCP=xbecopy.exe -# ADD BASE XBCP /NOLOGO -# ADD XBCP /NOLOGO +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c # Begin Special Build Tool -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 ia32.vdi # End Special Build Tool @@ -137,10 +137,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /pdb:none # Begin Special Build Tool IntDir=.\../Release6 -TargetDir=\projects\stepmania\stepmania +TargetDir=\temp\stepmania 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 ia32.vdi # End Special Build Tool @@ -2739,6 +2739,23 @@ SOURCE=.\CourseEntryDisplay.h # End Source File # Begin Source File +SOURCE=.\DifficultyDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\DifficultyDisplay.h +# End Source File +# Begin Source File + SOURCE=.\DifficultyMeter.cpp !IF "$(CFG)" == "StepMania - Win32 Debug" diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 3eba7a7ddc..4873956eb2 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -1068,6 +1068,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + +