NoteSkin format change. Fixes artifacts along borders, and more flexability for artists.

This commit is contained in:
Chris Danford
2003-02-05 03:53:57 +00:00
parent 36f784f807
commit 3ea84b5e5c
15 changed files with 1525 additions and 1332 deletions
+2
View File
@@ -15,6 +15,8 @@ NEW FEATURE: F6 to save screenshot. Saved in StepMania program directory
as "screenshotXXXX.bmp". as "screenshotXXXX.bmp".
CHANGE: Reorganization of options screens. CHANGE: Reorganization of options screens.
NEW FEATURE: Option for user-selectable extra stage 1 NEW FEATURE: Option for user-selectable extra stage 1
CHANGE: Documentation now in HTML format.
CHANGE: Overhauled NoteSkin format. See README-FIRST.htm for details.
----------------------- Version 3.01 --------------------------- ----------------------- Version 3.01 ---------------------------
CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -0,0 +1,19 @@
[NoteDisplay]
DrawHoldHeadForTapsOnSameRow=1
TapNoteAnimationLengthInBeats=4
HoldHeadAnimationLengthInBeats=4 // doesn't matter. Only 1 frame anyway.
HoldBodyAnimationLengthInBeats=4 // doesn't matter. Only 1 frame anyway.
HoldTailAnimationLengthInBeats=4 // doesn't matter. Only 1 frame anyway.
TapNoteAnimationIsVivid=1
HoldHeadAnimationIsVivid=0
HoldBodyAnimationIsVivid=0
HoldTailAnimationIsVivid=0
TapNoteAnimationIsNoteColor=0
HoldHeadAnimationIsNoteColor=0
HoldBodyAnimationIsNoteColor=0
HoldTailAnimationIsNoteColor=0
StartDrawingHoldBodyOffsetFromHead=0
StopDrawingHoldBodyOffsetFromTail=-32 // top of tail
HoldHeadIsWavy=0
HoldTailIsWavy=1
HoldNGGrayPercent=0.8
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -2,6 +2,8 @@
Fix Fix
///////////////////////// /////////////////////////
Is there a way to turn off the "keep bpm/gap change" screen, when AutoAdjust is turned on?
background videos out of sync at non-1 song rates background videos out of sync at non-1 song rates
Hrm.. I had a few things about Stepmania I wanted to suggest, but can't think of all of them now.. Lemme list the ones I can remember: Hrm.. I had a few things about Stepmania I wanted to suggest, but can't think of all of them now.. Lemme list the ones I can remember:
+1 -1
View File
@@ -489,7 +489,7 @@ RouletteSlowDownSwitches=5
LockedInitialVelocity=7 LockedInitialVelocity=7
ScrollBarX=148 ScrollBarX=148
ScrollBarHeight=368 ScrollBarHeight=368
ItemCurveX=95 ItemCurveX=85
ItemSpacingY=46 ItemSpacingY=46
NumSectionColors=7 NumSectionColors=7
SectionColor1=0.9, 0.0, 0.2, 1 SectionColor1=0.9, 0.0, 0.2, 1
+373 -206
View File
@@ -23,20 +23,68 @@
#include "RageLog.h" #include "RageLog.h"
#include <math.h> #include <math.h>
#include "RageDisplay.h" #include "RageDisplay.h"
#include "NoteTypes.h"
#define DRAW_HOLD_HEAD_FOR_TAPS_ON_SAME_ROW GAMEMAN->GetMetricB("NoteDisplay","DrawHoldHeadForTapsOnSameRow")
#define TAP_NOTE_ANIMATION_LENGTH_IN_BEATS GAMEMAN->GetMetricF("NoteDisplay","TapNoteAnimationLengthInBeats")
#define HOLD_HEAD_ANIMATION_LENGTH_IN_BEATS GAMEMAN->GetMetricF("NoteDisplay","HoldHeadAnimationLengthInBeats")
#define HOLD_BODY_ANIMATION_LENGTH_IN_BEATS GAMEMAN->GetMetricF("NoteDisplay","HoldBodyAnimationLengthInBeats")
#define HOLD_TAIL_ANIMATION_LENGTH_IN_BEATS GAMEMAN->GetMetricF("NoteDisplay","HoldTailAnimationLengthInBeats")
#define TAP_NOTE_ANIMATION_IS_VIVID GAMEMAN->GetMetricB("NoteDisplay","TapNoteAnimationIsVivid")
#define HOLD_HEAD_ANIMATION_IS_VIVID GAMEMAN->GetMetricB("NoteDisplay","HoldHeadAnimationIsVivid")
#define HOLD_BODY_ANIMATION_IS_VIVID GAMEMAN->GetMetricB("NoteDisplay","HoldBodyAnimationIsVivid")
#define HOLD_TAIL_ANIMATION_IS_VIVID GAMEMAN->GetMetricB("NoteDisplay","HoldTailAnimationIsVivid")
#define TAP_NOTE_ANIMATION_IS_NOTE_COLOR GAMEMAN->GetMetricB("NoteDisplay","TapNoteAnimationIsNoteColor")
#define HOLD_HEAD_ANIMATION_IS_NOTE_COLOR GAMEMAN->GetMetricB("NoteDisplay","HoldHeadAnimationIsNoteColor")
#define HOLD_BODY_ANIMATION_IS_NOTE_COLOR GAMEMAN->GetMetricB("NoteDisplay","HoldBodyAnimationIsNoteColor")
#define HOLD_TAIL_ANIMATION_IS_NOTE_COLOR GAMEMAN->GetMetricB("NoteDisplay","HoldTailAnimationIsNoteColor")
#define START_DRAWING_HOLD_BODY_OFFSET_FROM_HEAD GAMEMAN->GetMetricI("NoteDisplay","StartDrawingHoldBodyOffsetFromHead")
#define STOP_DRAWING_HOLD_BODY_OFFSET_FROM_TAIL GAMEMAN->GetMetricI("NoteDisplay","StopDrawingHoldBodyOffsetFromTail")
#define HOLD_HEAD_IS_WAVY GAMEMAN->GetMetricB("NoteDisplay","HoldHeadIsWavy")
#define HOLD_TAIL_IS_WAVY GAMEMAN->GetMetricB("NoteDisplay","HoldTailIsWavy")
#define HOLD_NG_GRAY_PERCENT GAMEMAN->GetMetricF("NoteDisplay","HoldNGGrayPercent")
// cache // cache
bool g_bDrawHoldHeadForTapsOnSameRow, g_bDrawTapOnTopOfHoldHead, g_bDrawTapOnTopOfHoldTail; bool g_bDrawHoldHeadForTapsOnSameRow;
float g_fTapAnimationLengthInBeats; float g_fTapNoteAnimationLengthInBeats;
float g_bAllowVivid; float g_fHoldHeadAnimationLengthInBeats;
float g_fHoldBodyAnimationLengthInBeats;
float g_fHoldTailAnimationLengthInBeats;
bool g_bTapNoteAnimationIsVivid;
bool g_bHoldHeadAnimationIsVivid;
bool g_bHoldBodyAnimationIsVivid;
bool g_bHoldTailAnimationIsVivid;
bool g_bTapNoteAnimationIsNoteColor;
bool g_bHoldHeadAnimationIsNoteColor;
bool g_bHoldBodyAnimationIsNoteColor;
bool g_bHoldTailAnimationIsNoteColor;
int g_iStartDrawingHoldBodyOffsetFromHead;
int g_iStopDrawingHoldBodyOffsetFromTail;
bool g_bHoldHeadIsWavy;
bool g_bHoldTailIsWavy;
float g_fHoldNGGrayPercent;
NoteDisplay::NoteDisplay() NoteDisplay::NoteDisplay()
{ {
g_bDrawHoldHeadForTapsOnSameRow = GAMEMAN->GetMetricB( "NoteDisplay", "DrawHoldHeadForTapsOnSameRow" ); g_bDrawHoldHeadForTapsOnSameRow = DRAW_HOLD_HEAD_FOR_TAPS_ON_SAME_ROW;
g_bDrawTapOnTopOfHoldHead = GAMEMAN->GetMetricB( "NoteDisplay", "DrawTapOnTopOfHoldHead" ); g_fTapNoteAnimationLengthInBeats = TAP_NOTE_ANIMATION_LENGTH_IN_BEATS;
g_bDrawTapOnTopOfHoldTail = GAMEMAN->GetMetricB( "NoteDisplay", "DrawTapOnTopOfHoldTail" ); g_fHoldHeadAnimationLengthInBeats = HOLD_HEAD_ANIMATION_LENGTH_IN_BEATS;
g_fTapAnimationLengthInBeats = GAMEMAN->GetMetricF( "NoteDisplay", "TapAnimationLengthInBeats" ); g_fHoldBodyAnimationLengthInBeats = HOLD_BODY_ANIMATION_LENGTH_IN_BEATS;
g_bAllowVivid = GAMEMAN->GetMetricB( "NoteDisplay", "AllowVivid" ); g_fHoldTailAnimationLengthInBeats = HOLD_TAIL_ANIMATION_LENGTH_IN_BEATS;
g_bTapNoteAnimationIsVivid = TAP_NOTE_ANIMATION_IS_VIVID;
g_bHoldHeadAnimationIsVivid = HOLD_HEAD_ANIMATION_IS_VIVID;
g_bHoldBodyAnimationIsVivid = HOLD_BODY_ANIMATION_IS_VIVID;
g_bHoldTailAnimationIsVivid = HOLD_TAIL_ANIMATION_IS_VIVID;
g_bTapNoteAnimationIsNoteColor = TAP_NOTE_ANIMATION_IS_NOTE_COLOR;
g_bHoldHeadAnimationIsNoteColor = HOLD_HEAD_ANIMATION_IS_NOTE_COLOR;
g_bHoldBodyAnimationIsNoteColor = HOLD_BODY_ANIMATION_IS_NOTE_COLOR;
g_bHoldTailAnimationIsNoteColor = HOLD_TAIL_ANIMATION_IS_NOTE_COLOR;
g_iStartDrawingHoldBodyOffsetFromHead = START_DRAWING_HOLD_BODY_OFFSET_FROM_HEAD;
g_iStopDrawingHoldBodyOffsetFromTail = STOP_DRAWING_HOLD_BODY_OFFSET_FROM_TAIL;
g_bHoldHeadIsWavy = HOLD_HEAD_IS_WAVY;
g_bHoldTailIsWavy = HOLD_TAIL_IS_WAVY;
g_fHoldNGGrayPercent = HOLD_NG_GRAY_PERCENT;
} }
@@ -44,46 +92,99 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn )
{ {
m_PlayerNumber = pn; m_PlayerNumber = pn;
CString sTapPath = GAMEMAN->GetPathTo(iColNum, "tap parts"); m_sprTapNote.Load( GAMEMAN->GetPathTo(iColNum, "tap note") );
m_sprTap.Load( sTapPath ); m_sprHoldHeadActive.Load( GAMEMAN->GetPathTo(iColNum, "hold head active") );
m_sprTap.StopAnimating(); m_sprHoldHeadInactive.Load( GAMEMAN->GetPathTo(iColNum, "hold head inactive") );
m_sprTap.TurnShadowOff(); m_sprHoldBodyActive.Load( GAMEMAN->GetPathTo(iColNum, "hold body active") );
m_sprHoldBodyInactive.Load( GAMEMAN->GetPathTo(iColNum, "hold body inactive") );
CString sHoldPartsPath = GAMEMAN->GetPathTo(iColNum, "hold parts 4x2"); m_sprHoldTailActive.Load( GAMEMAN->GetPathTo(iColNum, "hold tail active") );
m_sprHoldParts.Load( sHoldPartsPath ); m_sprHoldTailInactive.Load( GAMEMAN->GetPathTo(iColNum, "hold tail inactive") );
if( m_sprHoldParts.GetTexture()->GetFramesWide() != 4 || m_sprHoldParts.GetTexture()->GetFramesHigh() != 2 )
RageException::Throw( "Hold Parts '%s' must have 4x2 frames.", sHoldPartsPath.GetString() );
m_sprHoldParts.StopAnimating();
m_sprHoldParts.TurnShadowOff();
return;
} }
int NoteDisplay::GetTapFrameNo( const float fNoteBeat ) int NoteDisplay::GetFrameNo( float fNoteBeat, int iNumFrames, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor )
{ {
const int iNumFrames = m_sprTap.GetNumStates();
float fSongBeat = GAMESTATE->m_fSongBeat; float fSongBeat = GAMESTATE->m_fSongBeat;
float fPercentIntoMeasure = fmodf( fSongBeat, g_fTapAnimationLengthInBeats ) / g_fTapAnimationLengthInBeats; float fPercentIntoMeasure = fmodf( fSongBeat, fAnimationLengthInBeats ) / fAnimationLengthInBeats;
int iSongBeatFrameContrib = (int)roundf( fPercentIntoMeasure * iNumFrames );
float fBeatFraction = fmodf( fNoteBeat, 1.0f ); float fBeatFraction = fmodf( fNoteBeat, 1.0f );
fBeatFraction = froundf( fBeatFraction, 0.25f ); fBeatFraction = froundf( fBeatFraction, 0.25f ); // round to nearest 1/4th
int iBeatFractionContrib = (int)roundf( fBeatFraction * iNumFrames ); int iBeatFractionContrib = (int)roundf( fBeatFraction * iNumFrames );
int iSongBeatFrameContrib = (int)roundf( fPercentIntoMeasure * iNumFrames );
int iFrameNo; int iFrameNo;
if( g_bAllowVivid && GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_ColorType == PlayerOptions::COLOR_VIVID ) if( bVivid )
{
iFrameNo = (iSongBeatFrameContrib + iBeatFractionContrib) % iNumFrames; iFrameNo = (iSongBeatFrameContrib + iBeatFractionContrib) % iNumFrames;
else }
else if( bNoteColor )
{
NoteType type = BeatToNoteType( fNoteBeat );
int iBaseFrameNo;
switch( type )
{
case NOTE_TYPE_4TH: iBaseFrameNo = iNumFrames*0/6; break;
case NOTE_TYPE_8TH: iBaseFrameNo = iNumFrames*1/6; break;
case NOTE_TYPE_12TH: iBaseFrameNo = iNumFrames*2/6; break;
case NOTE_TYPE_16TH: iBaseFrameNo = iNumFrames*3/6; break;
case NOTE_TYPE_24TH: iBaseFrameNo = iNumFrames*4/6; break;
case NOTE_TYPE_32ND: iBaseFrameNo = iNumFrames*5/6; break;
default: ASSERT(0); iBaseFrameNo=0; // get rid of warning
}
iFrameNo = iBaseFrameNo + iBeatFractionContrib;
}
else // flat
{
iFrameNo = (iSongBeatFrameContrib) % iNumFrames; iFrameNo = (iSongBeatFrameContrib) % iNumFrames;
}
if( iFrameNo < 0 ) ASSERT( iFrameNo>=0 && iFrameNo<iNumFrames );
iFrameNo += iNumFrames;
return iFrameNo; return iFrameNo;
} }
int NoteDisplay::GetTapNoteFrameNo( float fNoteBeat )
{
return GetFrameNo(
fNoteBeat,
m_sprTapNote.GetNumStates(),
g_fTapNoteAnimationLengthInBeats,
g_bTapNoteAnimationIsVivid,
g_bTapNoteAnimationIsNoteColor );
}
int NoteDisplay::GetHoldHeadFrameNo( float fNoteBeat, bool bActive )
{
return GetFrameNo(
fNoteBeat,
(bActive?m_sprHoldHeadActive:m_sprHoldHeadInactive).GetNumStates(),
g_fHoldHeadAnimationLengthInBeats,
g_bHoldHeadAnimationIsVivid,
g_bHoldHeadAnimationIsNoteColor );
}
int NoteDisplay::GetHoldBodyFrameNo( float fNoteBeat, bool bActive )
{
return GetFrameNo(
fNoteBeat,
(bActive?m_sprHoldBodyActive:m_sprHoldBodyInactive).GetNumStates(),
g_fHoldBodyAnimationLengthInBeats,
g_bHoldBodyAnimationIsVivid,
g_bHoldBodyAnimationIsNoteColor );
}
int NoteDisplay::GetHoldTailFrameNo( float fNoteBeat, bool bActive )
{
return GetFrameNo(
fNoteBeat,
(bActive?m_sprHoldTailActive:m_sprHoldTailInactive).GetNumStates(),
g_fHoldTailAnimationLengthInBeats,
g_bHoldTailAnimationIsVivid,
g_bHoldTailAnimationIsNoteColor );
}
void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly ) void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly )
{ {
// bDrawGlowOnly is a little hacky. We need to draw the diffuse part and the glow part one pass at a time to minimize state changes // bDrawGlowOnly is a little hacky. We need to draw the diffuse part and the glow part one pass at a time to minimize state changes
@@ -91,166 +192,177 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
const bool bReverse = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_bReverseScroll; const bool bReverse = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_bReverseScroll;
const int iCol = hn.m_iTrack; const int iCol = hn.m_iTrack;
const float fStartYOffset = ArrowGetYOffset( m_PlayerNumber, hn.m_fStartBeat ); const float fStartYOffset = ArrowGetYOffset( m_PlayerNumber, hn.m_fStartBeat );
const float fStartYPos = ArrowGetYPos( m_PlayerNumber, fStartYOffset ); const float fStartYPos = ArrowGetYPos( m_PlayerNumber, fStartYOffset );
const float fEndYOffset = ArrowGetYOffset( m_PlayerNumber, hn.m_fEndBeat ); const float fEndYOffset = ArrowGetYOffset( m_PlayerNumber, hn.m_fEndBeat );
const float fEndYPos = ArrowGetYPos( m_PlayerNumber, fEndYOffset ); const float fEndYPos = ArrowGetYPos( m_PlayerNumber, fEndYOffset );
// draw from bottom to top
const float fFrameWidth = m_sprHoldParts.GetUnzoomedWidth();
const float fFrameHeight = m_sprHoldParts.GetUnzoomedHeight();
const float fBodyHeight = fFrameHeight*2;
const float fYHead = bReverse ? fEndYPos : fStartYPos; // the center of the head const float fYHead = bReverse ? fEndYPos : fStartYPos; // the center of the head
const float fYTail = bReverse ? fStartYPos : fEndYPos; // the center the tail const float fYTail = bReverse ? fStartYPos : fEndYPos; // the center the tail
const float fYHeadTop = fYHead-fFrameHeight/2; const int fYStep = 16; // 16 logical pixels per segment
const float fYHeadBottom = fYHead+fFrameHeight/2;
const float fYTailTop = fYTail-fFrameHeight/2; const float fColorScale = 1*fLife + (1-fLife)*g_fHoldNGGrayPercent;
const float fYTailBottom = fYTail+fFrameHeight/2;
const float fYBodyTop = g_bDrawTapOnTopOfHoldHead ? fYHeadBottom : fYHead; // middle of head
const float fYBodyBottom = fYTailTop; // top of tail
const int fYStep = int(fFrameHeight)/4; // 4 segments per frame //
// draw from tail to head (so head appears on top)
DISPLAY->SetTexture( m_sprHoldParts.GetTexture() ); //
DISPLAY->SetBlendModeNormal();
if( bDrawGlowOnly )
DISPLAY->SetTextureModeGlow();
else
DISPLAY->SetTextureModeModulate();
DISPLAY->EnableTextureWrapping();
static RageVertex queue[4096]; static RageVertex queue[4096];
RageVertex *v=&queue[0];
// //
// Draw the tail // Draw the tail
// //
float fY;
// HACK: +0.05 below to try and get rid of ugly border at top of tail
for( fY=max(fYTailTop-0.05f,fYHead); fY<fYTailBottom; fY+=fYStep ) // don't draw the part of the tail that is before the middle of the head
{ {
const float fYTop = fY; Sprite* pSprTail = bActive ? &m_sprHoldTailActive : &m_sprHoldTailInactive;
const float fYBottom = fY+min(fYStep, fYTailBottom-fY); int iFrameNo = GetHoldTailFrameNo( hn.m_fStartBeat, bActive );
const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom ); if( g_bHoldTailIsWavy )
const float fXTopLeft = fXTop - fFrameWidth/2;
const float fXTopRight = fXTop + fFrameWidth/2;
const float fXBottomLeft = fXBottom - fFrameWidth/2;
const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fTopDistFromTailTop = fYTop - fYTailTop;
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
if( fTexCoordTop > 1 && fTexCoordBottom > 1 )
{ {
fTexCoordTop -= (int)fTexCoordTop; // draw manually in small segments
fTexCoordBottom -= (int)fTexCoordTop; RageVertex *v = &queue[0];
RageTexture* pTexture = pSprTail->GetTexture();
const RectF* pRect = pTexture->GetTextureCoordRect( iFrameNo );
DISPLAY->SetTexture( pTexture );
DISPLAY->SetBlendModeNormal();
if( bDrawGlowOnly )
DISPLAY->SetTextureModeGlow();
else
DISPLAY->SetTextureModeModulate();
DISPLAY->DisableTextureWrapping();
const float fFrameWidth = pSprTail->GetUnzoomedWidth();
const float fFrameHeight = pSprTail->GetUnzoomedHeight();
const float fYTailTop = fYTail-fFrameHeight/2;
const float fYTailBottom = fYTail+fFrameHeight/2;
float fY=max( fYTailTop, fYHead ); // don't draw any part of the tail that is before the middle of the head
for( ; fY<fYTailBottom; fY+=fYStep )
{
const float fYTop = fY;
const float fYBottom = min( fY+fYStep, fYTailBottom );
const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom );
const float fXTopLeft = fXTop - fFrameWidth/2;
const float fXTopRight = fXTop + fFrameWidth/2;
const float fXBottomLeft = fXBottom - fFrameWidth/2;
const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fTopDistFromTailTop = fYTop - fYTailTop;
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, pRect->top, pRect->bottom );
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, pRect->top, pRect->bottom );
const float fTexCoordLeft = pRect->left;
const float fTexCoordRight = pRect->right;
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop);
const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom);
const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop);
const RageColor colorGlowBottom = RageColor(1,1,1,fGlowBottom);
if( bDrawGlowOnly && colorGlowTop.a==0 && colorGlowBottom.a==0 )
continue;
if( !bDrawGlowOnly && colorDiffuseTop.a==0 && colorDiffuseBottom.a==0 )
continue;
v[0].p = RageVector3(fXTopLeft, fYTop, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop),
v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop);
v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom);
v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom);
v+=4;
}
DISPLAY->DrawQuads( queue, v-queue );
} }
ASSERT( fBottomDistFromTailTop-0.001 <= fFrameHeight ); else // !g_bHoldTailIsWavy
const float fTexCoordLeft = bActive ? 0.25f : 0.00f; {
const float fTexCoordRight = bActive ? 0.50f : 0.25f; // draw with normal Sprite
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail ); const float fY = fYHead;
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail ); const float fX = ArrowGetXPos( m_PlayerNumber, iCol, fY );
const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail ); const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fY, fPercentFadeToFail );
const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail ); const float fGlow = ArrowGetGlow( m_PlayerNumber, fY, fPercentFadeToFail );
const float fColorScale = SCALE(fLife,0,1,0.2f,1); const RageColor colorDiffuse= RageColor(fColorScale,fColorScale,fColorScale,fAlpha);
const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop); const RageColor colorGlow = RageColor(1,1,1,fGlow);
const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom);
const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop);
const RageColor colorGlowBottom = RageColor(1,1,1,fGlowBottom);
if( bDrawGlowOnly && colorGlowTop.a==0 && colorGlowBottom.a==0 ) pSprTail->SetXY( fX, fY );
continue; pSprTail->SetState( iFrameNo );
if( !bDrawGlowOnly && colorDiffuseTop.a==0 && colorDiffuseBottom.a==0 ) if( bDrawGlowOnly )
continue; {
pSprTail->SetDiffuse( RageColor(1,1,1,0) );
v[0].p = RageVector3(fXTopLeft, fYTop, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop), pSprTail->SetGlow( colorGlow );
v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); }
v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); else
v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); {
v+=4; pSprTail->SetDiffuse( colorDiffuse );
pSprTail->SetGlow( RageColor(0,0,0,0) );
}
pSprTail->Draw();
}
} }
// //
// Draw the body // Draw the body (always wavy)
// //
for( fY=fYBodyTop; fY<=fYBodyBottom+1; fY+=fYStep ) // top to bottom
{ {
const float fYTop = fY; Sprite* pSprBody = bActive ? &m_sprHoldBodyActive : &m_sprHoldBodyInactive;
const float fYBottom = min( fY+fYStep, fYTailTop+1 ); int iFrameNo = GetHoldBodyFrameNo( hn.m_fStartBeat, bActive );
const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom ); // draw manually in small segments
const float fXTopLeft = fXTop - fFrameWidth/2; RageVertex *v = &queue[0];
const float fXTopRight = fXTop + fFrameWidth/2; RageTexture* pTexture = pSprBody->GetTexture();
const float fXBottomLeft = fXBottom - fFrameWidth/2; const RectF* pRect = pTexture->GetTextureCoordRect( iFrameNo );
const float fXBottomRight = fXBottom + fFrameWidth/2; DISPLAY->SetTexture( pTexture );
const float fTopDistFromTailTop = fYTailTop - fYTop; DISPLAY->SetBlendModeNormal();
const float fBottomDistFromTailTop = fYTailTop - fYBottom; if( bDrawGlowOnly )
float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fBodyHeight, 1, 0 ); DISPLAY->SetTextureModeGlow();
float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fBodyHeight, 1, 0 ); else
if( fTexCoordTop > 1 && fTexCoordBottom > 1 ) DISPLAY->SetTextureModeModulate();
DISPLAY->EnableTextureWrapping();
const float fFrameWidth = pSprBody->GetUnzoomedWidth();
const float fFrameHeight = pSprBody->GetUnzoomedHeight();
const float fYBodyTop = fYHead + g_iStartDrawingHoldBodyOffsetFromHead;
const float fYBodyBottom = fYTail + g_iStopDrawingHoldBodyOffsetFromTail;
// top to bottom
for( float fY=fYBodyTop; fY<=fYBodyBottom+2; fY+=fYStep ) // HACK: +1 to fill gab between body and tail.
{ {
fTexCoordTop -= (int)fTexCoordTop; const float fYTop = fY;
fTexCoordBottom -= (int)fTexCoordTop; const float fYBottom = min( fY+fYStep, fYBodyBottom+1 ); // HACK: +1 to fill gab between body and tail.
} const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fTexCoordLeft = bActive ? 0.75f : 0.50f; const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom );
const float fTexCoordRight = bActive ? 1.00f : 0.75f; const float fXTopLeft = fXTop - fFrameWidth/2;
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail ); const float fXTopRight = fXTop + fFrameWidth/2;
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail ); const float fXBottomLeft = fXBottom - fFrameWidth/2;
const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail ); const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail ); const float fTopDistFromBodyBottom = fYBodyBottom - fYTop;
const float fColorScale = SCALE(fLife,0,1,0.2f,1); const float fBottomDistFromBodyBottom = fYBodyBottom - fYBottom;
const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop); float fTexCoordTop = SCALE( fTopDistFromBodyBottom, 0, fFrameHeight, pRect->bottom, pRect->top );
const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom); float fTexCoordBottom = SCALE( fBottomDistFromBodyBottom, 0, fFrameHeight, pRect->bottom, pRect->top );
const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop); if( fTexCoordTop < 0 )
const RageColor colorGlowBottom = RageColor(1,1,1,fGlowBottom); {
int iToSubtract = (int)fTexCoordTop - 1;
if( bDrawGlowOnly && colorGlowTop.a==0 && colorGlowBottom.a==0 ) fTexCoordTop -= iToSubtract;
continue; fTexCoordBottom -= iToSubtract;
if( !bDrawGlowOnly && colorDiffuseTop.a==0 && colorDiffuseBottom.a==0 ) }
continue; else if( fTexCoordBottom > 2 )
{
v[0].p = RageVector3(fXTopLeft, fYTop, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop); int iToSubtract = (int)fTexCoordBottom;
v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); fTexCoordTop -= iToSubtract;
v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); fTexCoordBottom -= iToSubtract;
v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); }
v+=4; ASSERT( fTexCoordTop>=0 && fTexCoordBottom>=0 );
} ASSERT( fTexCoordTop<=2 && fTexCoordBottom<=2 );
DISPLAY->DrawQuads( queue, v-queue ); const float fTexCoordLeft = pRect->left;
v=&queue[0]; const float fTexCoordRight = pRect->right;
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
if( g_bDrawTapOnTopOfHoldHead ) const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail );
{ const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail );
// const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail );
// Draw the head
//
float fY;
for( fY=fYHeadTop; fY<fYHeadBottom; fY+=fYStep )
{
const float fYTop = fY;
const float fYBottom = fY+min(fYStep, fYHeadBottom-fY);
const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom );
const float fXTopLeft = fXTop - fFrameWidth/2;
const float fXTopRight = fXTop + fFrameWidth/2;
const float fXBottomLeft = fXBottom - fFrameWidth/2;
const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fTopDistFromHeadTop = fYTop - fYHeadTop;
const float fBottomDistFromHeadTop = fYBottom - fYHeadTop;
const float fTexCoordTop = SCALE( fTopDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.499f );
const float fTexCoordBottom = SCALE( fBottomDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.499f );
ASSERT( fBottomDistFromHeadTop-0.0001 <= fFrameHeight );
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const float fColorScale = SCALE(fLife,0,1,0.2f,1);
const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop); const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop);
const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom); const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom);
const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop); const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop);
@@ -265,48 +377,104 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop);
v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom);
v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom);
DISPLAY->DrawQuad( v ); v+=4;
} }
DISPLAY->DrawQuads( queue, v-queue );
} }
else
//
// Draw the head
//
{ {
// Sprite* pSprHead = bActive ? &m_sprHoldHeadActive : &m_sprHoldHeadInactive;
// Draw head int iFrameNo = GetHoldHeadFrameNo( hn.m_fStartBeat, bActive );
//
if( g_bHoldHeadIsWavy )
{ {
fY = fYHead; // draw manually in small segments
RageVertex *v = &queue[0];
RageTexture* pTexture = pSprHead->GetTexture();
const RectF* pRect = pTexture->GetTextureCoordRect( iFrameNo );
DISPLAY->SetTexture( pTexture );
DISPLAY->SetBlendModeNormal();
if( bDrawGlowOnly )
DISPLAY->SetTextureModeGlow();
else
DISPLAY->SetTextureModeModulate();
DISPLAY->EnableTextureWrapping();
const float fFrameWidth = pSprHead->GetUnzoomedWidth();
const float fFrameHeight = pSprHead->GetUnzoomedHeight();
const float fYHeadTop = fYHead-fFrameHeight/2;
const float fYHeadBottom = fYHead+fFrameHeight/2;
for( float fY=fYHeadTop; fY<fYHeadBottom; fY+=fYStep )
{
const float fYTop = fY;
const float fYBottom = fY+fYStep;
const float fXTop = ArrowGetXPos( m_PlayerNumber, iCol, fYTop );
const float fXBottom = ArrowGetXPos( m_PlayerNumber, iCol, fYBottom );
const float fXTopLeft = fXTop - fFrameWidth/2;
const float fXTopRight = fXTop + fFrameWidth/2;
const float fXBottomLeft = fXBottom - fFrameWidth/2;
const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fTopDistFromHeadTop = fYTop - fYHeadTop;
const float fBottomDistFromHeadTop = fYBottom - fYHeadTop;
const float fTexCoordTop = SCALE( fTopDistFromHeadTop, 0, fFrameHeight, pRect->top, pRect->bottom );
const float fTexCoordBottom = SCALE( fBottomDistFromHeadTop, 0, fFrameHeight, pRect->top, pRect->bottom );
ASSERT( fTexCoordTop>=0 && fTexCoordBottom<=1 );
const float fTexCoordLeft = pRect->left;
const float fTexCoordRight = pRect->right;
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const float fGlowTop = ArrowGetGlow( m_PlayerNumber, fYTop, fPercentFadeToFail );
const float fGlowBottom = ArrowGetGlow( m_PlayerNumber, fYBottom, fPercentFadeToFail );
const RageColor colorDiffuseTop = RageColor(fColorScale,fColorScale,fColorScale,fAlphaTop);
const RageColor colorDiffuseBottom = RageColor(fColorScale,fColorScale,fColorScale,fAlphaBottom);
const RageColor colorGlowTop = RageColor(1,1,1,fGlowTop);
const RageColor colorGlowBottom = RageColor(1,1,1,fGlowBottom);
if( bDrawGlowOnly && colorGlowTop.a==0 && colorGlowBottom.a==0 )
continue;
if( !bDrawGlowOnly && colorDiffuseTop.a==0 && colorDiffuseBottom.a==0 )
continue;
v[0].p = RageVector3(fXTopLeft, fYTop, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop),
v[1].p = RageVector3(fXTopRight, fYTop, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop);
v[2].p = RageVector3(fXBottomRight,fYBottom,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom);
v[3].p = RageVector3(fXBottomLeft, fYBottom,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom);
v+=4;
}
DISPLAY->DrawQuads( queue, v-queue );
}
else // !g_bHoldHeadIsWavy
{
// draw with normal Sprite
const float fY = fYHead;
const float fX = ArrowGetXPos( m_PlayerNumber, iCol, fY ); const float fX = ArrowGetXPos( m_PlayerNumber, iCol, fY );
const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fY, fPercentFadeToFail ); const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fY, fPercentFadeToFail );
const float fGlow = ArrowGetGlow( m_PlayerNumber, fY, fPercentFadeToFail ); const float fGlow = ArrowGetGlow( m_PlayerNumber, fY, fPercentFadeToFail );
const float fColorScale = SCALE(fLife,0,1,0.2f,1);
const RageColor colorDiffuse= RageColor(fColorScale,fColorScale,fColorScale,fAlpha); const RageColor colorDiffuse= RageColor(fColorScale,fColorScale,fColorScale,fAlpha);
const RageColor colorGlow = RageColor(1,1,1,fGlow); const RageColor colorGlow = RageColor(1,1,1,fGlow);
// m_sprHoldParts.SetState( bActive?1:0 ); pSprHead->SetXY( fX, fY );
// HACK: the border around the edge of on this sprite is super-obvious. pSprHead->SetState( iFrameNo );
m_sprHoldParts.SetCustomTextureRect( bActive ? RectF(0.251f,0.002f,0.499f,0.498f) : RectF(0.001f,0.002f,0.249f,0.498f) );
m_sprHoldParts.SetXY( fX, fY );
if( bDrawGlowOnly ) if( bDrawGlowOnly )
{ {
m_sprHoldParts.SetDiffuse( RageColor(1,1,1,0) ); pSprHead->SetDiffuse( RageColor(1,1,1,0) );
m_sprHoldParts.SetGlow( colorGlow ); pSprHead->SetGlow( colorGlow );
} }
else else
{ {
m_sprHoldParts.SetDiffuse( colorDiffuse ); pSprHead->SetDiffuse( colorDiffuse );
m_sprHoldParts.SetGlow( RageColor(0,0,0,0) ); pSprHead->SetGlow( RageColor(0,0,0,0) );
} }
m_sprHoldParts.Draw(); pSprHead->Draw();
} }
} }
if( g_bDrawTapOnTopOfHoldHead )
DrawTap( hn.m_iTrack, hn.m_fStartBeat, false, fPercentFadeToFail, fLife );
if( g_bDrawTapOnTopOfHoldTail )
DrawTap( hn.m_iTrack, hn.m_fEndBeat, false, fPercentFadeToFail, fLife );
// now, draw the glow pass // now, draw the glow pass
if( !bDrawGlowOnly ) if( !bDrawGlowOnly )
DrawHold( hn, bActive, fLife, fPercentFadeToFail, true ); DrawHold( hn, bActive, fLife, fPercentFadeToFail, true );
@@ -320,7 +488,6 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame
const float fXPos = ArrowGetXPos( m_PlayerNumber, iCol, fYPos ); const float fXPos = ArrowGetXPos( m_PlayerNumber, iCol, fYPos );
const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fYPos, fPercentFadeToFail ); const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fYPos, fPercentFadeToFail );
const float fGlow = ArrowGetGlow( m_PlayerNumber, fYPos, fPercentFadeToFail ); const float fGlow = ArrowGetGlow( m_PlayerNumber, fYPos, fPercentFadeToFail );
const int iTapFrameNo = GetTapFrameNo( fBeat );
const float fColorScale = SCALE(fLife,0,1,0.2f,1); const float fColorScale = SCALE(fLife,0,1,0.2f,1);
RageColor diffuse = RageColor(fColorScale,fColorScale,fColorScale,fAlpha); RageColor diffuse = RageColor(fColorScale,fColorScale,fColorScale,fAlpha);
RageColor glow = RageColor(1,1,1,fGlow); RageColor glow = RageColor(1,1,1,fGlow);
@@ -337,24 +504,24 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame
if( bOnSameRowAsHoldStart && g_bDrawHoldHeadForTapsOnSameRow ) if( bOnSameRowAsHoldStart && g_bDrawHoldHeadForTapsOnSameRow )
{ {
//
// draw hold head // draw hold head
// const int iHoldHeadFrameNo = GetHoldHeadFrameNo( fBeat, false );
m_sprHoldParts.SetXY( fXPos, fYPos ); m_sprHoldHeadInactive.SetXY( fXPos, fYPos );
m_sprHoldParts.SetDiffuse( diffuse ); m_sprHoldHeadInactive.SetDiffuse( diffuse );
m_sprHoldParts.SetGlow( glow ); m_sprHoldHeadInactive.SetGlow( glow );
m_sprHoldParts.StopUsingCustomCoords(); m_sprHoldHeadInactive.StopUsingCustomCoords();
m_sprHoldParts.SetState( 0 ); m_sprHoldHeadInactive.SetState( iHoldHeadFrameNo );
m_sprHoldParts.Draw(); m_sprHoldHeadInactive.Draw();
} }
else else
{ {
m_sprTap.SetXY( fXPos, fYPos ); const int iTapFrameNo = GetTapNoteFrameNo( fBeat );
m_sprTap.SetRotation( fRotation ); m_sprTapNote.SetXY( fXPos, fYPos );
m_sprTap.SetGlow( glow ); m_sprTapNote.SetRotation( fRotation );
m_sprTap.SetDiffuse( diffuse ); m_sprTapNote.SetGlow( glow );
m_sprTap.SetState( iTapFrameNo ); m_sprTapNote.SetDiffuse( diffuse );
m_sprTap.Draw(); m_sprTapNote.SetState( iTapFrameNo );
m_sprTapNote.Draw();
} }
} }
+12 -3
View File
@@ -28,12 +28,21 @@ public:
void DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly = false ); void DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly = false );
protected: protected:
int GetTapFrameNo( const float fNoteBeat ); int GetFrameNo( float fNoteBeat, int iNumFrames, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor );
int GetTapNoteFrameNo( float fNoteBeat );
int GetHoldHeadFrameNo( float fNoteBeat, bool bActive );
int GetHoldBodyFrameNo( float fNoteBeat, bool bActive );
int GetHoldTailFrameNo( float fNoteBeat, bool bActive );
PlayerNumber m_PlayerNumber; // to look up PlayerOptions PlayerNumber m_PlayerNumber; // to look up PlayerOptions
Sprite m_sprTap; Sprite m_sprTapNote;
Sprite m_sprHoldParts; Sprite m_sprHoldHeadActive;
Sprite m_sprHoldHeadInactive;
Sprite m_sprHoldBodyActive;
Sprite m_sprHoldBodyInactive;
Sprite m_sprHoldTailActive;
Sprite m_sprHoldTailInactive;
}; };
#endif #endif
+5
View File
@@ -53,6 +53,11 @@ NoteType GetNoteType( int iNoteIndex )
else return NOTE_TYPE_INVALID; else return NOTE_TYPE_INVALID;
}; };
NoteType BeatToNoteType( float fBeat )
{
return GetNoteType( BeatToNoteRow(fBeat) );
};
bool IsNoteOfType( int iNoteIndex, NoteType t ) bool IsNoteOfType( int iNoteIndex, NoteType t )
{ {
return GetNoteType(iNoteIndex) == t; return GetNoteType(iNoteIndex) == t;
+1
View File
@@ -73,6 +73,7 @@ enum NoteType
RageColor NoteTypeToColor( NoteType nt ); RageColor NoteTypeToColor( NoteType nt );
float NoteTypeToBeat( NoteType nt ); float NoteTypeToBeat( NoteType nt );
NoteType GetNoteType( int iNoteIndex ); NoteType GetNoteType( int iNoteIndex );
NoteType BeatToNoteType( float fBeat );
bool IsNoteOfType( int iNoteIndex, NoteType t ); bool IsNoteOfType( int iNoteIndex, NoteType t );
RageColor GetNoteColorFromIndex( int iNoteIndex ); RageColor GetNoteColorFromIndex( int iNoteIndex );
RageColor GetNoteColorFromBeat( float fBeat ); RageColor GetNoteColorFromBeat( float fBeat );
+17 -13
View File
@@ -190,22 +190,26 @@ ScreenEdit::ScreenEdit()
m_pNotes = GAMESTATE->m_pCurNotes[PLAYER_1]; m_pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
if( m_pNotes == NULL )
{
m_pNotes = new Notes;
m_pNotes->SetDifficulty(DIFFICULTY_MEDIUM);
m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
m_pNotes->SetDescription("Untitled");
// In ScreenEditMenu, the screen preceding this one, /* Make EditMenu responsible for creating new Notes */
// GAMEMAN->m_CurStyle is set to the target game style //if( m_pNotes == NULL )
// of the current edit. Naturally, this is where we'll //{
// want to extract the NotesType for a (NEW) sequence. // m_pNotes = new Notes;
// m_pNotes->SetDifficulty(DIFFICULTY_MEDIUM);
// m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
// m_pNotes->SetDescription("Untitled");
// // In ScreenEditMenu, the screen preceding this one,
// // GAMEMAN->m_CurStyle is set to the target game style
// // of the current edit. Naturally, this is where we'll
// // want to extract the NotesType for a (NEW) sequence.
// m_pSong->m_apNotes.push_back( m_pNotes );
// GAMESTATE->m_pCurNotes[PLAYER_1] = m_pNotes;
//}
m_pSong->m_apNotes.push_back( m_pNotes );
GAMESTATE->m_pCurNotes[PLAYER_1] = m_pNotes;
}
NoteData noteData; NoteData noteData;
m_pNotes->GetNoteData( &noteData ); m_pNotes->GetNoteData( &noteData );
+1 -1
View File
@@ -444,7 +444,7 @@ static void HandleInputEvents(float fDeltaTime)
ApplyGraphicOptions(); ApplyGraphicOptions();
} }
*/ */
else if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F6)) else if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F5)) // F6 conflicts with editor and AutoSync
{ {
if(type != IET_FIRST_PRESS) continue; if(type != IET_FIRST_PRESS) continue;
+3 -3
View File
@@ -19,7 +19,7 @@
!define PRODUCT_NAME_VER "${PRODUCT_NAME} ${VERSION}" !define PRODUCT_NAME_VER "${PRODUCT_NAME} ${VERSION}"
Name "${PRODUCT_NAME}" Name "${PRODUCT_NAME}"
OutFile "stepmania-CVS-20030130.exe" OutFile "stepmania-CVS-20030202.exe"
;OutFile "stepmania301.exe" ;OutFile "stepmania301.exe"
; Some default compiler settings (uncomment and change at will): ; Some default compiler settings (uncomment and change at will):
@@ -179,7 +179,7 @@ File "SDL_image.dll"
; File "SDL_net.dll" ; File "SDL_net.dll"
File "COPYING.txt" File "COPYING.txt"
File "README-FIRST.TXT" File "README-FIRST.htm"
File "NEWS" File "NEWS"
File "stepmania.exe" File "stepmania.exe"
File "stepmania.vdi" File "stepmania.vdi"
@@ -208,7 +208,7 @@ CreateShortCut "$DESKTOP\Play ${PRODUCT_NAME_VER}.lnk" "$INSTDIR\stepmania.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\${PRODUCT_NAME_VER}.lnk" "$INSTDIR\stepmania.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\${PRODUCT_NAME_VER}.lnk" "$INSTDIR\stepmania.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Open Songs Folder.lnk" "$WINDIR\explorer.exe" "$INSTDIR\Songs\" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Open Songs Folder.lnk" "$WINDIR\explorer.exe" "$INSTDIR\Songs\"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Package Exporter.lnk" "$INSTDIR\smpackage.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Package Exporter.lnk" "$INSTDIR\smpackage.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\README.lnk" "$INSTDIR\README-FIRST.txt" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\README-FIRST.lnk" "$INSTDIR\README-FIRST.htm"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Uninstall ${PRODUCT_NAME_VER}.lnk" "$INSTDIR\uninst.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Uninstall ${PRODUCT_NAME_VER}.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Go To StepMania web site.lnk" "http://www.stepmania.com" CreateShortCut "$SMPROGRAMS\${PRODUCT_ID}\Go To StepMania web site.lnk" "http://www.stepmania.com"