reduced size of hold parts texture for reduced memory footprint

This commit is contained in:
Chris Danford
2002-08-25 06:42:26 +00:00
parent a5df78e77d
commit 8d63a5f7e0
2 changed files with 11 additions and 10 deletions
+6 -5
View File
@@ -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<D3DXCOLOR,D3DXCOLOR> &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<D3DXCOLOR,D3DXCOLOR> &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";
+5 -5
View File
@@ -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 );