no message

This commit is contained in:
Chris Danford
2001-11-29 06:49:26 +00:00
parent 74d73a3269
commit a867e118cc
2 changed files with 36 additions and 50 deletions
+1
View File
@@ -102,6 +102,7 @@ void Actor::Update( const float &fDeltaTime )
m_fPercentBetweenColors += m_fDeltaPercentPerSecond * fDeltaTime; m_fPercentBetweenColors += m_fDeltaPercentPerSecond * fDeltaTime;
if( m_fPercentBetweenColors > 1.0f ) { if( m_fPercentBetweenColors > 1.0f ) {
m_fPercentBetweenColors = 1.0f; m_fPercentBetweenColors = 1.0f;
m_bTweeningTowardEndColor = FALSE; m_bTweeningTowardEndColor = FALSE;
} }
} }
+32 -47
View File
@@ -1,27 +1,24 @@
#include "stdafx.h" #include "stdafx.h"
/* /*
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
File: TransitionFadeWipe.cpp File: TransitionStarWipe.cpp
Desc: Fades out or in. Desc: Black bands (horizontal window blinds) gradually close.
Copyright (c) 2001 Chris Danford. All rights reserved. Copyright (c) 2001 Chris Danford. All rights reserved.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
#include "RageUtil.h" #include "RageUtil.h"
#include "TransitionFadeWipe.h" #include "TransitionFadeWipe.h"
#include "ScreenDimensions.h"
#define SCREEN_WIDTH 640 //#define RECTANGLE_WIDTH 20
#define SCREEN_HEIGHT 480 //#define NUM_RECTANGLES (SCREEN_WIDTH/RECTANGLE_WIDTH)
//#define FADE_RECTS_WIDE (NUM_RECTANGLES/4) // number of rects from fade start to fade end
#define RECTANGLE_WIDTH 20 const float FADE_RECT_WIDTH = SCREEN_WIDTH/2;
#define NUM_RECTANGLES (SCREEN_WIDTH/RECTANGLE_WIDTH)
#define FADE_RECTS_WIDE (NUM_RECTANGLES/3) // number of rects from fade start to fade end
TransitionFadeWipe::TransitionFadeWipe() TransitionFadeWipe::TransitionFadeWipe()
@@ -42,49 +39,37 @@ void TransitionFadeWipe::Draw()
///////////////////////// /////////////////////////
// draw rectangles that get progressively smaller at the edge of the wipe // draw rectangles that get progressively smaller at the edge of the wipe
///////////////////////// /////////////////////////
BOOL bLeftEdgeIsDarker = m_TransitionState == opening_left || m_TransitionState == closing_right; bool bLeftEdgeIsDarker = m_TransitionState == opening_left || m_TransitionState == closing_right;
BOOL bFadeIsMovingLeft = m_TransitionState == opening_left || m_TransitionState == closing_left; bool bFadeIsMovingLeft = m_TransitionState == opening_left || m_TransitionState == closing_left;
double fPercentComplete = m_fPercentThroughTransition; float fPercentComplete = m_fPercentThroughTransition;
double fPercentAlongScreen = bFadeIsMovingLeft ? 1-fPercentComplete : fPercentComplete; float fPercentAlongScreen = bFadeIsMovingLeft ? 1-fPercentComplete*1.3f : fPercentComplete*1.3f;
int iFadeLeftEdge = (int) float fFadeLeftEdgeX = fPercentAlongScreen * SCREEN_WIDTH - FADE_RECT_WIDTH/2;
(-FADE_RECTS_WIDE + (NUM_RECTANGLES + FADE_RECTS_WIDE) * fPercentAlongScreen); float fFadeRightEdgeX = fPercentAlongScreen * SCREEN_WIDTH + FADE_RECT_WIDTH/2;
int iFadeRightEdge = (int)
(0 + (NUM_RECTANGLES + FADE_RECTS_WIDE) * fPercentAlongScreen);
// draw all rectangles float fDarkEdgeX = bLeftEdgeIsDarker ? fFadeLeftEdgeX : fFadeRightEdgeX;
for( int i=0; i<NUM_RECTANGLES; i++ ) float fLightEdgeX = bLeftEdgeIsDarker ? fFadeRightEdgeX : fFadeLeftEdgeX;
{
int iRectX = (int)(RECTANGLE_WIDTH * (i+0.5));
int iRectWidth;
if( i < iFadeLeftEdge ) float fDarkOutsideX = bLeftEdgeIsDarker ? fDarkEdgeX - SCREEN_WIDTH*2 : fDarkEdgeX + SCREEN_WIDTH*2;
iRectWidth = bLeftEdgeIsDarker ? RECTANGLE_WIDTH : 0;
//iRectWidth = 0;
else if( i > iFadeRightEdge )
iRectWidth = bLeftEdgeIsDarker ? 0 : RECTANGLE_WIDTH;
//iRectWidth = 0;
else // this is a fading rectangle
{
int iRectsFromLeftFadeEdge = i - iFadeLeftEdge;
double fPercentAlongFade = iRectsFromLeftFadeEdge / (double)FADE_RECTS_WIDE;
double fPercentDarkness = bLeftEdgeIsDarker ? 1-fPercentAlongFade : fPercentAlongFade;
iRectWidth = (int)(RECTANGLE_WIDTH * fPercentDarkness);
} // draw dark rect
//iRectWidth = RECTANGLE_WIDTH; SCREEN->DrawRect(
CRect(fDarkOutsideX, 0, fDarkEdgeX, SCREEN_HEIGHT),
D3DXCOLOR(0,0,0,1), // up left
D3DXCOLOR(0,0,0,1), // up right
D3DXCOLOR(0,0,0,1), // down left
D3DXCOLOR(0,0,0,1) // down right
);
if( iRectWidth > 0 ) // draw gradient rect
//if( i == iFadeLeftEdge || i == iFadeRightEdge ) SCREEN->DrawRect(
{ // draw the rectangle CRect(fDarkEdgeX, 0, fLightEdgeX, SCREEN_HEIGHT),
int iRectAlpha = (int)( iRectWidth * 255.0f / RECTANGLE_WIDTH ); D3DXCOLOR(0,0,0,1), // up left
RECT rect; D3DXCOLOR(0,0,0,0), // up right
SetRect( &rect, iRectX-RECTANGLE_WIDTH/2, 0, D3DXCOLOR(0,0,0,1), // down left
iRectX+RECTANGLE_WIDTH/2, SCREEN_HEIGHT ); D3DXCOLOR(0,0,0,0) // down right
SCREEN->DrawRect( &rect, D3DCOLOR_ARGB(iRectAlpha,0,0,0) ); );
}
} // end foreach rect
} }