add DifficultyDisplay
This commit is contained in:
@@ -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
|
||||||
|
*/
|
||||||
@@ -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
@@ -61,10 +61,10 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\projects\stepmania\stepmania
|
TargetDir=\temp\stepmania
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
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
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# 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 Intermediate_Dir "StepMania___Xbox_Debug___VC6"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
CPP=cl.exe
|
XBCP=xbecopy.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 BASE XBCP /NOLOGO
|
||||||
# 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
|
# ADD XBCP /NOLOGO
|
||||||
BSC32=bscmake.exe
|
XBE=imagebld.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||||
# ADD BSC32 /nologo
|
# ADD XBE /nologo /stack:0x10000 /debug
|
||||||
LINK32=link.exe
|
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"
|
# 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
|
# 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"
|
# 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
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
XBE=imagebld.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD XBE /nologo /stack:0x10000 /debug
|
# ADD BSC32 /nologo
|
||||||
XBCP=xbecopy.exe
|
CPP=cl.exe
|
||||||
# ADD BASE XBCP /NOLOGO
|
# 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 XBCP /NOLOGO
|
# 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
|
# 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
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -137,10 +137,10 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /pdb:none
|
# SUBTRACT LINK32 /verbose /pdb:none
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Release6
|
IntDir=.\../Release6
|
||||||
TargetDir=\projects\stepmania\stepmania
|
TargetDir=\temp\stepmania
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
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
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -2739,6 +2739,23 @@ SOURCE=.\CourseEntryDisplay.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=.\DifficultyMeter.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|||||||
@@ -1068,6 +1068,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="CroppedSprite.h">
|
RelativePath="CroppedSprite.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="DifficultyDisplay.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="DifficultyDisplay.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="DifficultyIcon.cpp">
|
RelativePath="DifficultyIcon.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
Reference in New Issue
Block a user