clean up STYLE_TECHNO_VERSUS8 hack: Sprite really should not
be depending on GameState
This commit is contained in:
@@ -417,6 +417,15 @@ bool ArrowsNeedZBuffer( PlayerNumber pn )
|
||||
return false;
|
||||
}
|
||||
|
||||
float ArrowGetZoom( PlayerNumber pn )
|
||||
{
|
||||
/* Hack: make STYLE_TECHNO_VERSUS8 fit. */
|
||||
if( GAMESTATE->m_CurGame == GAME_TECHNO &&
|
||||
GAMESTATE->m_CurStyle == STYLE_TECHNO_VERSUS8 )
|
||||
return 0.8f;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -51,6 +51,8 @@ float ArrowGetGlow( PlayerNumber pn, int iCol, float fYPos, float fPercentFadeTo
|
||||
// Depends on fYOffset.
|
||||
float ArrowGetBrightness( PlayerNumber pn, float fNoteBeat );
|
||||
|
||||
// This is the zoom of the individual tracks, not of the whole Player.
|
||||
float ArrowGetZoom( PlayerNumber pn );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ void GhostArrowRow::Update( float fDeltaTime )
|
||||
m_GhostDim[c].SetZ( fZ );
|
||||
m_GhostBright[c].SetZ( fZ );
|
||||
m_HoldGhost[c].SetZ( fZ );
|
||||
|
||||
const float fZoom = ArrowGetZoom( m_PlayerNumber );
|
||||
m_GhostDim[c].SetZoom( fZoom );
|
||||
m_GhostBright[c].SetZoom( fZoom );
|
||||
m_HoldGhost[c].SetZoom( fZoom );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,6 +461,8 @@ void NoteDisplay::DrawHoldTopCap( const HoldNote& hn, const bool bIsBeingHeld, f
|
||||
static RageSpriteVertex queue[size];
|
||||
Sprite* pSprTopCap = GetHoldTopCapSprite( hn.GetStartBeat(), bIsBeingHeld );
|
||||
|
||||
pSprTopCap->SetZoom( ArrowGetZoom( m_PlayerNumber ) );
|
||||
|
||||
// draw manually in small segments
|
||||
RageSpriteVertex *v = &queue[0];
|
||||
RageTexture* pTexture = pSprTopCap->GetTexture();
|
||||
@@ -527,6 +529,8 @@ void NoteDisplay::DrawHoldBody( const HoldNote& hn, const bool bIsBeingHeld, flo
|
||||
|
||||
Sprite* pSprBody = GetHoldBodySprite( hn.GetStartBeat(), bIsBeingHeld );
|
||||
|
||||
pSprBody->SetZoom( ArrowGetZoom( m_PlayerNumber ) );
|
||||
|
||||
// draw manually in small segments
|
||||
RageSpriteVertex *v = &queue[0];
|
||||
RageTexture* pTexture = pSprBody->GetTexture();
|
||||
@@ -597,6 +601,8 @@ void NoteDisplay::DrawHoldBottomCap( const HoldNote& hn, const bool bIsBeingHeld
|
||||
|
||||
Sprite* pBottomCap = GetHoldBottomCapSprite( hn.GetStartBeat(), bIsBeingHeld );
|
||||
|
||||
pBottomCap->SetZoom( ArrowGetZoom( m_PlayerNumber ) );
|
||||
|
||||
// draw manually in small segments
|
||||
RageSpriteVertex *v = &queue[0];
|
||||
RageTexture* pTexture = pBottomCap->GetTexture();
|
||||
@@ -823,6 +829,7 @@ void NoteDisplay::DrawActor( Actor* pActor, int iCol, float fBeat, float fPercen
|
||||
const float fAlpha = ArrowGetAlpha( m_PlayerNumber, iCol, fYOffset, fPercentFadeToFail, m_fYReverseOffsetPixels );
|
||||
const float fGlow = ArrowGetGlow( m_PlayerNumber, iCol, fYOffset, fPercentFadeToFail, m_fYReverseOffsetPixels );
|
||||
const float fColorScale = ArrowGetBrightness( m_PlayerNumber, fBeat ) * SCALE(fLife,0,1,0.2f,1);
|
||||
const float fZoom = ArrowGetZoom( m_PlayerNumber );
|
||||
RageColor diffuse = RageColor(fColorScale,fColorScale,fColorScale,fAlpha);
|
||||
RageColor glow = RageColor(1,1,1,fGlow);
|
||||
|
||||
@@ -831,6 +838,7 @@ void NoteDisplay::DrawActor( Actor* pActor, int iCol, float fBeat, float fPercen
|
||||
pActor->SetZ( fZPos );
|
||||
pActor->SetDiffuse( diffuse );
|
||||
pActor->SetGlow( glow );
|
||||
pActor->SetZoom( fZoom );
|
||||
|
||||
if( bUseLighting )
|
||||
{
|
||||
|
||||
@@ -41,6 +41,9 @@ void ReceptorArrowRow::Update( float fDeltaTime )
|
||||
m_ReceptorArrow[c].SetX( fX );
|
||||
m_ReceptorArrow[c].SetY( fY );
|
||||
m_ReceptorArrow[c].SetZ( fZ );
|
||||
|
||||
const float fZoom = ArrowGetZoom( m_PlayerNumber );
|
||||
m_ReceptorArrow[c].SetZoom( fZoom );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
#include "SDL_utils.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
#include "Game.h"
|
||||
#include "GameState.h"
|
||||
#include "Style.h"
|
||||
|
||||
Sprite::Sprite()
|
||||
{
|
||||
@@ -82,15 +79,6 @@ bool Sprite::Load( RageTextureID ID )
|
||||
else
|
||||
result = LoadFromTexture( ID );
|
||||
|
||||
// 2-player 8-panel gets crowded - this scaling emulates the arcade behaviour to account for this
|
||||
if( GAMESTATE->m_CurGame == GAME_TECHNO &&
|
||||
GAMESTATE->m_CurStyle == STYLE_TECHNO_VERSUS8 &&
|
||||
ID.filename.find( "NoteSkin" ) != -1 )
|
||||
{
|
||||
Actor::SetBaseZoomX( Actor::m_baseScale.x * (float)0.8 );
|
||||
Actor::SetBaseZoomY( Actor::m_baseScale.y * (float)0.8 );
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user