reduced size of hold parts texture for reduced memory footprint
This commit is contained in:
@@ -20,7 +20,9 @@
|
|||||||
#include "InputMapper.h"
|
#include "InputMapper.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
|
|
||||||
#define NOTESKIN_DIR "NoteSkins\\"
|
|
||||||
|
const CString NOTESKIN_DIR = "NoteSkins\\";
|
||||||
|
|
||||||
|
|
||||||
CString GameDef::ElementToGraphicSuffix( const SkinElement gbg ) const
|
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
|
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 );
|
const CString sGraphicSuffix = ElementToGraphicSuffix( gbg );
|
||||||
|
|
||||||
CStringArray arrayPossibleFileNames; // fill this with the possible files
|
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
|
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";
|
const CString sColorsFilePath = sSkinDir + sButtonName + " Tap.colors";
|
||||||
|
|
||||||
FILE* fp = fopen( sColorsFilePath, "r" );
|
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
|
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";
|
const CString sColorsFilePath = sSkinDir + sButtonName + " Hold.colors";
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn )
|
|||||||
|
|
||||||
sPath = GAMEMAN->GetPathTo(iColNum, GRAPHIC_HOLD_PARTS);
|
sPath = GAMEMAN->GetPathTo(iColNum, GRAPHIC_HOLD_PARTS);
|
||||||
m_sprHoldParts.Load( sPath );
|
m_sprHoldParts.Load( sPath );
|
||||||
if( m_sprHoldParts.GetNumStates() != 16 )
|
if( m_sprHoldParts.GetTexture()->GetFramesWide() != 4 || m_sprHoldParts.GetTexture()->GetFramesHigh() != 2 )
|
||||||
throw RageException( "Hold Parts '%s' must have 16 frames.", sPath );
|
throw RageException( "Hold Parts '%s' must have 4x2 frames.", sPath );
|
||||||
|
|
||||||
m_sprTapParts.StopAnimating();
|
m_sprTapParts.StopAnimating();
|
||||||
m_sprTapParts.TurnShadowOff();
|
m_sprTapParts.TurnShadowOff();
|
||||||
@@ -506,7 +506,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
// draw from bottom to top
|
// draw from bottom to top
|
||||||
const float fFrameWidth = m_sprHoldParts.GetUnzoomedWidth();
|
const float fFrameWidth = m_sprHoldParts.GetUnzoomedWidth();
|
||||||
const float fFrameHeight = m_sprHoldParts.GetUnzoomedHeight();
|
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 fYHead = min(fStartYPos, fEndYPos); // stop drawing here
|
||||||
const float fYTail = max(fStartYPos, fEndYPos); // the center the tail
|
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 fXBottomRight = fXBottom + fFrameWidth/2;
|
||||||
const float fTopDistFromTailTop = fYTop - fYTailTop;
|
const float fTopDistFromTailTop = fYTop - fYTailTop;
|
||||||
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
|
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
|
||||||
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 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.25f, 0.5f );
|
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
|
||||||
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
||||||
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
|
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
|
||||||
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop );
|
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop );
|
||||||
|
|||||||
Reference in New Issue
Block a user