From 8d63a5f7e0b2e325565b78dcbdadf7d9c7d5feb9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 25 Aug 2002 06:42:26 +0000 Subject: [PATCH] reduced size of hold parts texture for reduced memory footprint --- stepmania/src/GameDef.cpp | 11 ++++++----- stepmania/src/NoteDisplay.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/stepmania/src/GameDef.cpp b/stepmania/src/GameDef.cpp index 3cc8d8545a..32e281d228 100644 --- a/stepmania/src/GameDef.cpp +++ b/stepmania/src/GameDef.cpp @@ -20,7 +20,9 @@ #include "InputMapper.h" #include "PrefsManager.h" -#define NOTESKIN_DIR "NoteSkins\\" + +const CString NOTESKIN_DIR = "NoteSkins\\"; + CString GameDef::ElementToGraphicSuffix( const SkinElement gbg ) const { @@ -44,7 +46,7 @@ CString GameDef::ElementToGraphicSuffix( const SkinElement gbg ) const CString GameDef::GetPathToGraphic( const CString sSkinName, const CString sButtonName, const SkinElement gbg ) const { - const CString sSkinDir = ssprintf(NOTESKIN_DIR "%s\\%s\\", m_szName, sSkinName); + const CString sSkinDir = NOTESKIN_DIR + ssprintf("%s\\%s\\", m_szName, sSkinName); const CString sGraphicSuffix = ElementToGraphicSuffix( gbg ); CStringArray arrayPossibleFileNames; // fill this with the possible files @@ -64,8 +66,7 @@ CString GameDef::GetPathToGraphic( const CString sSkinName, const CString sButto void GameDef::GetTapTweenColors( const CString sSkinName, const CString sButtonName, CArray &aTapColorsOut ) const { - const CString sSkinDir = ssprintf(NOTESKIN_DIR "%s\\%s\\", m_szName, sSkinName); - + const CString sSkinDir = NOTESKIN_DIR + ssprintf("%s\\%s\\", m_szName, sSkinName); const CString sColorsFilePath = sSkinDir + sButtonName + " Tap.colors"; FILE* fp = fopen( sColorsFilePath, "r" ); @@ -97,7 +98,7 @@ void GameDef::GetTapTweenColors( const CString sSkinName, const CString sButtonN void GameDef::GetHoldTweenColors( const CString sSkinName, const CString sButtonName, CArray &aHoldColorsOut ) const { - const CString sSkinDir = ssprintf(NOTESKIN_DIR "%s\\%s\\", m_szName, sSkinName); + const CString sSkinDir = NOTESKIN_DIR + ssprintf("%s\\%s\\", m_szName, sSkinName); const CString sColorsFilePath = sSkinDir + sButtonName + " Hold.colors"; diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 091e971af4..d46fa522b8 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -46,8 +46,8 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn ) sPath = GAMEMAN->GetPathTo(iColNum, GRAPHIC_HOLD_PARTS); m_sprHoldParts.Load( sPath ); - if( m_sprHoldParts.GetNumStates() != 16 ) - throw RageException( "Hold Parts '%s' must have 16 frames.", sPath ); + if( m_sprHoldParts.GetTexture()->GetFramesWide() != 4 || m_sprHoldParts.GetTexture()->GetFramesHigh() != 2 ) + throw RageException( "Hold Parts '%s' must have 4x2 frames.", sPath ); m_sprTapParts.StopAnimating(); m_sprTapParts.TurnShadowOff(); @@ -506,7 +506,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float // draw from bottom to top const float fFrameWidth = m_sprHoldParts.GetUnzoomedWidth(); const float fFrameHeight = m_sprHoldParts.GetUnzoomedHeight(); - const float fBodyHeight = fFrameHeight*4; + const float fBodyHeight = fFrameHeight*2; const float fYHead = min(fStartYPos, fEndYPos); // stop drawing here const float fYTail = max(fStartYPos, fEndYPos); // the center the tail @@ -540,8 +540,8 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float const float fXBottomRight = fXBottom + fFrameWidth/2; const float fTopDistFromTailTop = fYTop - fYTailTop; const float fBottomDistFromTailTop = fYBottom - fYTailTop; - const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.25f, 0.5f ); - const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.25f, 0.5f ); + const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f ); + const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f ); const float fTexCoordLeft = bActive ? 0.25f : 0.00f; const float fTexCoordRight = bActive ? 0.50f : 0.25f; const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop );