add DifficultyDisplay

This commit is contained in:
Glenn Maynard
2003-06-18 07:03:51 +00:00
parent c3eda88045
commit 321adf57e0
4 changed files with 117 additions and 17 deletions
+46
View File
@@ -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
*/
+31
View File
@@ -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
+34 -17
View File
@@ -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"
+6
View File
@@ -1068,6 +1068,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="CroppedSprite.h">
</File>
<File
RelativePath="DifficultyDisplay.cpp">
</File>
<File
RelativePath="DifficultyDisplay.h">
</File>
<File
RelativePath="DifficultyIcon.cpp">
</File>