clean up RageDisplay methods, add ability to mask song banner
The masking uses the Z-buffer under the assumption that some cards don't have a stencil. Should we be using the stencil instead? It doesn't really matter because we never need both the Z buffer and stencil buffer simultaneously.
This commit is contained in:
@@ -456,11 +456,11 @@ HelpText=Press START to continue
|
|||||||
TimerSeconds=15
|
TimerSeconds=15
|
||||||
|
|
||||||
[ScreenSelectMusic]
|
[ScreenSelectMusic]
|
||||||
BannerX=160
|
BannerX=148
|
||||||
BannerY=162
|
BannerY=172
|
||||||
BannerOnCommand=x,148;y,172;addx,-400;bounceend,0.5;addx,400
|
BannerOnCommand=addx,-400;bounceend,0.5;addx,400
|
||||||
BannerOffCommand=bouncebegin,0.5;addx,-400
|
BannerOffCommand=bouncebegin,0.5;addx,-400
|
||||||
BannerWidth=282
|
BannerWidth=284
|
||||||
BannerHeight=92
|
BannerHeight=92
|
||||||
BannerFrameX=160
|
BannerFrameX=160
|
||||||
BannerFrameY=162
|
BannerFrameY=162
|
||||||
|
|||||||
+13
-3
@@ -47,7 +47,8 @@ void Actor::Reset()
|
|||||||
m_fShadowLength = 4;
|
m_fShadowLength = 4;
|
||||||
m_bTextureWrapping = false;
|
m_bTextureWrapping = false;
|
||||||
m_bIsAnimating = true;
|
m_bIsAnimating = true;
|
||||||
m_bBlendAdd = false;
|
m_BlendMode = BLEND_NORMAL;
|
||||||
|
m_bUseZBuffer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor::Actor()
|
Actor::Actor()
|
||||||
@@ -184,6 +185,15 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Actor::SetRenderStates()
|
||||||
|
{
|
||||||
|
// set Actor-defined render states
|
||||||
|
DISPLAY->SetTextureWrapping( m_bTextureWrapping );
|
||||||
|
DISPLAY->SetBlendMode( m_BlendMode );
|
||||||
|
DISPLAY->SetZBuffer( m_bUseZBuffer );
|
||||||
|
DISPLAY->SetBackfaceCull( m_bUseBackfaceCull );
|
||||||
|
}
|
||||||
|
|
||||||
void Actor::EndDraw()
|
void Actor::EndDraw()
|
||||||
{
|
{
|
||||||
DISPLAY->PopMatrix();
|
DISPLAY->PopMatrix();
|
||||||
@@ -733,8 +743,8 @@ void Actor::Command( CString sCommandString )
|
|||||||
else if( sName=="scaletocover" ) { RectI R(iParam(1), iParam(2), iParam(3), iParam(4)); ScaleToCover(R); }
|
else if( sName=="scaletocover" ) { RectI R(iParam(1), iParam(2), iParam(3), iParam(4)); ScaleToCover(R); }
|
||||||
// Commands that take effect immediately (ignoring the tweening queue):
|
// Commands that take effect immediately (ignoring the tweening queue):
|
||||||
else if( sName=="animate" ) EnableAnimation( bParam(1) );
|
else if( sName=="animate" ) EnableAnimation( bParam(1) );
|
||||||
else if( sName=="texturewrapping" ) EnableTextureWrapping( bParam(1) );
|
else if( sName=="texturewrapping" ) SetTextureWrapping( bParam(1) );
|
||||||
else if( sName=="additiveblend" ) EnableAdditiveBlend( bParam(1) );
|
else if( sName=="additiveblend" ) SetBlendMode( bParam(1) ? BLEND_ADD : BLEND_NORMAL );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CString sError = ssprintf( "Unrecognized command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
|
CString sError = ssprintf( "Unrecognized command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
|
||||||
|
|||||||
+17
-7
@@ -54,7 +54,8 @@ public:
|
|||||||
// let subclasses override
|
// let subclasses override
|
||||||
virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
|
virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
|
||||||
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
||||||
virtual void DrawPrimitives() {} // override with Actor specific action
|
virtual void SetRenderStates(); // Actor should call at beginning of their DrawPrimitives()
|
||||||
|
virtual void DrawPrimitives() {}; // Derivitives should override
|
||||||
virtual void EndDraw(); // pops transform from world matrix stack
|
virtual void EndDraw(); // pops transform from world matrix stack
|
||||||
bool IsFirstUpdate();
|
bool IsFirstUpdate();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
@@ -219,14 +220,18 @@ public:
|
|||||||
void SetShadowLength( float fLength );
|
void SetShadowLength( float fLength );
|
||||||
void EnableShadow( bool b ) { m_bShadow = b; }
|
void EnableShadow( bool b ) { m_bShadow = b; }
|
||||||
|
|
||||||
|
|
||||||
virtual void EnableAdditiveBlend( bool b ) { m_bBlendAdd = b; }
|
|
||||||
|
|
||||||
virtual void EnableAnimation( bool b ) { m_bIsAnimating = b; }
|
virtual void EnableAnimation( bool b ) { m_bIsAnimating = b; }
|
||||||
virtual void StartAnimating() { this->EnableAnimation(true); };
|
virtual void StartAnimating() { this->EnableAnimation(true); };
|
||||||
virtual void StopAnimating() { this->EnableAnimation(false); };
|
virtual void StopAnimating() { this->EnableAnimation(false); };
|
||||||
|
|
||||||
virtual void EnableTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
|
||||||
|
//
|
||||||
|
// render states
|
||||||
|
//
|
||||||
|
virtual void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
|
||||||
|
virtual void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
||||||
|
virtual void SetUseZBuffer( bool b ) { m_bUseZBuffer = b; }
|
||||||
|
virtual void SetUseBackfaceCull( bool b ) { m_bUseBackfaceCull = b; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// fade command
|
// fade command
|
||||||
@@ -302,10 +307,15 @@ protected:
|
|||||||
//
|
//
|
||||||
bool m_bShadow;
|
bool m_bShadow;
|
||||||
float m_fShadowLength;
|
float m_fShadowLength;
|
||||||
bool m_bTextureWrapping;
|
|
||||||
bool m_bIsAnimating;
|
bool m_bIsAnimating;
|
||||||
bool m_bBlendAdd;
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// render states
|
||||||
|
//
|
||||||
|
bool m_bTextureWrapping;
|
||||||
|
BlendMode m_BlendMode;
|
||||||
|
bool m_bUseZBuffer;
|
||||||
|
bool m_bUseBackfaceCull;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ void ActorFrame::MoveToHead( Actor* pActor )
|
|||||||
|
|
||||||
void ActorFrame::DrawPrimitives()
|
void ActorFrame::DrawPrimitives()
|
||||||
{
|
{
|
||||||
|
// Don't set Actor-defined render states because we won't be drawing
|
||||||
|
// any geometry that belongs to this object.
|
||||||
|
// Actor::DrawPrimitives();
|
||||||
|
|
||||||
// draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space
|
// draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space
|
||||||
for( unsigned i=0; i<m_SubActors.size(); i++ ) {
|
for( unsigned i=0; i<m_SubActors.size(); i++ ) {
|
||||||
m_SubActors[i]->Draw();
|
m_SubActors[i]->Draw();
|
||||||
@@ -77,6 +81,15 @@ void ActorFrame::SetDiffuse( RageColor c )
|
|||||||
m_SubActors[i]->SetDiffuse(c );
|
m_SubActors[i]->SetDiffuse(c );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFrame::SetUseZBuffer( bool b )
|
||||||
|
{
|
||||||
|
Actor::SetUseZBuffer( b );
|
||||||
|
|
||||||
|
// set all sub-Actors
|
||||||
|
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||||
|
m_SubActors[i]->SetUseZBuffer( b );
|
||||||
|
}
|
||||||
|
|
||||||
float ActorFrame::GetTweenTimeLeft() const
|
float ActorFrame::GetTweenTimeLeft() const
|
||||||
{
|
{
|
||||||
float m = Actor::GetTweenTimeLeft();
|
float m = Actor::GetTweenTimeLeft();
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public:
|
|||||||
|
|
||||||
virtual void SetDiffuse( RageColor c );
|
virtual void SetDiffuse( RageColor c );
|
||||||
|
|
||||||
|
virtual void SetUseZBuffer( bool b );
|
||||||
|
|
||||||
/* Amount of time until all tweens (and all children's tweens) have stopped: */
|
/* Amount of time until all tweens (and all children's tweens) have stopped: */
|
||||||
virtual float GetTweenTimeLeft() const;
|
virtual float GetTweenTimeLeft() const;
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ void BGAnimationLayer::LoadFromVisualization( CString sMoviePath )
|
|||||||
m_Sprites.push_back(new Sprite);
|
m_Sprites.push_back(new Sprite);
|
||||||
m_Sprites.back()->LoadBG( sMoviePath );
|
m_Sprites.back()->LoadBG( sMoviePath );
|
||||||
m_Sprites.back()->StretchTo( RectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
m_Sprites.back()->StretchTo( RectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||||
m_Sprites.back()->EnableAdditiveBlend( true );
|
m_Sprites.back()->SetBlendMode( BLEND_ADD );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath )
|
|||||||
{
|
{
|
||||||
m_Sprites.push_back(new Sprite);
|
m_Sprites.push_back(new Sprite);
|
||||||
m_Sprites.back()->Load( ID );
|
m_Sprites.back()->Load( ID );
|
||||||
m_Sprites.back()->EnableTextureWrapping( true ); // gets rid of some "cracks"
|
m_Sprites.back()->SetTextureWrapping( true ); // gets rid of some "cracks"
|
||||||
|
|
||||||
switch( effect )
|
switch( effect )
|
||||||
{
|
{
|
||||||
@@ -385,7 +385,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath )
|
|||||||
|
|
||||||
if( sPath.Find("add") != -1 )
|
if( sPath.Find("add") != -1 )
|
||||||
for( unsigned i=0; i<m_Sprites.size(); i++ )
|
for( unsigned i=0; i<m_Sprites.size(); i++ )
|
||||||
m_Sprites[i]->EnableAdditiveBlend( true );
|
m_Sprites[i]->SetBlendMode( BLEND_ADD );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CString sDir, sFName, sExt;
|
CString sDir, sFName, sExt;
|
||||||
@@ -582,7 +582,7 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
|
|||||||
{
|
{
|
||||||
m_Sprites.push_back(NewSprite(IsBanner));
|
m_Sprites.push_back(NewSprite(IsBanner));
|
||||||
m_Sprites.back()->Load( ID );
|
m_Sprites.back()->Load( ID );
|
||||||
m_Sprites.back()->EnableTextureWrapping( true ); // gets rid of some "cracks"
|
m_Sprites.back()->SetTextureWrapping( true ); // gets rid of some "cracks"
|
||||||
m_Sprites.back()->SetZoom( randomf(m_fZoomMin,m_fZoomMax) );
|
m_Sprites.back()->SetZoom( randomf(m_fZoomMin,m_fZoomMax) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CroppedSprite.h"
|
#include "CroppedSprite.h"
|
||||||
#include "RageTextureManager.h"
|
#include "RageTexture.h"
|
||||||
class Song;
|
class Song;
|
||||||
class Course;
|
class Course;
|
||||||
|
|
||||||
|
|||||||
@@ -280,14 +280,9 @@ void BitmapText::DrawPrimitives()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
if( m_bBlendAdd )
|
|
||||||
DISPLAY->SetBlendModeAdd();
|
|
||||||
else
|
|
||||||
DISPLAY->SetBlendModeNormal();
|
|
||||||
|
|
||||||
/* Draw if we're not fully transparent or the zbuffer is enabled (which ignores
|
/* Draw if we're not fully transparent or the zbuffer is enabled */
|
||||||
* alpha). */
|
if( m_temp.diffuse[0].a != 0 )
|
||||||
if( m_temp.diffuse[0].a != 0 || DISPLAY->ZBufferEnabled())
|
|
||||||
{
|
{
|
||||||
//////////////////////
|
//////////////////////
|
||||||
// render the shadow
|
// render the shadow
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void CourseContentsList::Update( float fDeltaTime )
|
|||||||
void CourseContentsList::DrawPrimitives()
|
void CourseContentsList::DrawPrimitives()
|
||||||
{
|
{
|
||||||
// turn on Z buffer to clip items
|
// turn on Z buffer to clip items
|
||||||
DISPLAY->EnableZBuffer();
|
DISPLAY->SetZBuffer( true );
|
||||||
|
|
||||||
// write to z buffer so that top and bottom are clipped
|
// write to z buffer so that top and bottom are clipped
|
||||||
m_quad.SetZ( 1 );
|
m_quad.SetZ( 1 );
|
||||||
@@ -128,7 +128,7 @@ void CourseContentsList::DrawPrimitives()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// turn off Z buffer
|
// turn off Z buffer
|
||||||
DISPLAY->DisableZBuffer();
|
DISPLAY->SetZBuffer( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CourseContentsList::TweenInAfterChangedCourse()
|
void CourseContentsList::TweenInAfterChangedCourse()
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void DancingCharacters::DrawPrimitives()
|
|||||||
m_CameraAt,
|
m_CameraAt,
|
||||||
RageVector3(0,1,0) );
|
RageVector3(0,1,0) );
|
||||||
|
|
||||||
DISPLAY->EnableLighting( true );
|
DISPLAY->SetLighting( true );
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
RageColor(0.4f,0.4f,0.4f,1),
|
RageColor(0.4f,0.4f,0.4f,1),
|
||||||
@@ -78,7 +78,7 @@ void DancingCharacters::DrawPrimitives()
|
|||||||
ActorFrame::DrawPrimitives();
|
ActorFrame::DrawPrimitives();
|
||||||
|
|
||||||
DISPLAY->SetLightOff( 0 );
|
DISPLAY->SetLightOff( 0 );
|
||||||
DISPLAY->EnableLighting( false );
|
DISPLAY->SetLighting( false );
|
||||||
|
|
||||||
DISPLAY->ExitPerspective();
|
DISPLAY->ExitPerspective();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
FadingBanner::FadingBanner()
|
FadingBanner::FadingBanner()
|
||||||
{
|
{
|
||||||
m_iIndexFront = 0;
|
m_iIndexFront = 0;
|
||||||
|
for( int i=0; i<2; i++ )
|
||||||
|
this->AddChild( &m_Banner[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
|
void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
|
||||||
@@ -26,14 +28,13 @@ void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
|
|||||||
|
|
||||||
void FadingBanner::Update( float fDeltaTime )
|
void FadingBanner::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
Actor::Update( fDeltaTime );
|
ActorFrame::Update( fDeltaTime );
|
||||||
for( int i=0; i<2; i++ )
|
|
||||||
m_Banner[i].Update( fDeltaTime );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadingBanner::DrawPrimitives()
|
void FadingBanner::DrawPrimitives()
|
||||||
{
|
{
|
||||||
Actor::DrawPrimitives();
|
// draw manually
|
||||||
|
// ActorFrame::DrawPrimitives();
|
||||||
m_Banner[GetBackIndex()].Draw();
|
m_Banner[GetBackIndex()].Draw();
|
||||||
m_Banner[m_iIndexFront].Draw();
|
m_Banner[m_iIndexFront].Draw();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Banner.h"
|
#include "Banner.h"
|
||||||
|
#include "ActorFrame.h"
|
||||||
|
|
||||||
class FadingBanner : public Actor
|
class FadingBanner : public ActorFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FadingBanner();
|
FadingBanner();
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
void DrawPrimitives()
|
void DrawPrimitives()
|
||||||
{
|
{
|
||||||
DISPLAY->EnableZBuffer();
|
DISPLAY->SetZBuffer( true );
|
||||||
|
|
||||||
if( GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
|
if( GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY->DisableZBuffer();
|
DISPLAY->SetZBuffer( false );
|
||||||
|
|
||||||
m_sprFrame.Draw();
|
m_sprFrame.Draw();
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ Model::Model ()
|
|||||||
{
|
{
|
||||||
m_pModel = NULL;
|
m_pModel = NULL;
|
||||||
m_pBones = NULL;
|
m_pBones = NULL;
|
||||||
|
m_bTextureWrapping = true;
|
||||||
|
m_bUseZBuffer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Model::~Model ()
|
Model::~Model ()
|
||||||
@@ -723,13 +725,13 @@ bool Model::LoadMilkshapeAsciiBones( CString sPath )
|
|||||||
|
|
||||||
void Model::DrawPrimitives()
|
void Model::DrawPrimitives()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!m_pModel)
|
if (!m_pModel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DISPLAY->Scale( 1, -1, 1 ); // flip so positive Y is up
|
Actor::DrawPrimitives(); // set Actor-specified render states
|
||||||
|
|
||||||
DISPLAY->SetBlendModeNormal();
|
DISPLAY->Scale( 1, -1, 1 ); // flip Y so positive is up
|
||||||
DISPLAY->EnableZBuffer();
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)m_pModel->Meshes.size(); i++)
|
for (int i = 0; i < (int)m_pModel->Meshes.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -796,7 +798,7 @@ void Model::DrawPrimitives()
|
|||||||
DISPLAY->DrawIndexedTriangles( &TempVertices[0], (Uint16*)&pMesh->Triangles[0], pMesh->Triangles.size()*3 );
|
DISPLAY->DrawIndexedTriangles( &TempVertices[0], (Uint16*)&pMesh->Triangles[0], pMesh->Triangles.size()*3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY->DisableZBuffer();
|
DISPLAY->SetZBuffer( false );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -418,12 +418,12 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
RageTexture* pTexture = pBottomCap->GetTexture();
|
RageTexture* pTexture = pBottomCap->GetTexture();
|
||||||
const RectF *pRect = pBottomCap->GetCurrentTextureCoordRect();
|
const RectF *pRect = pBottomCap->GetCurrentTextureCoordRect();
|
||||||
DISPLAY->SetTexture( pTexture );
|
DISPLAY->SetTexture( pTexture );
|
||||||
DISPLAY->SetBlendModeNormal();
|
DISPLAY->SetBlendMode( BLEND_NORMAL );
|
||||||
if( bDrawGlowOnly )
|
if( bDrawGlowOnly )
|
||||||
DISPLAY->SetTextureModeGlow();
|
DISPLAY->SetTextureModeGlow();
|
||||||
else
|
else
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
DISPLAY->EnableTextureWrapping(false);
|
DISPLAY->SetTextureWrapping(false);
|
||||||
|
|
||||||
const float fFrameWidth = pBottomCap->GetUnzoomedWidth();
|
const float fFrameWidth = pBottomCap->GetUnzoomedWidth();
|
||||||
const float fFrameHeight = pBottomCap->GetUnzoomedHeight();
|
const float fFrameHeight = pBottomCap->GetUnzoomedHeight();
|
||||||
@@ -483,12 +483,12 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
RageTexture* pTexture = pSprBody->GetTexture();
|
RageTexture* pTexture = pSprBody->GetTexture();
|
||||||
const RectF *pRect = pSprBody->GetCurrentTextureCoordRect();
|
const RectF *pRect = pSprBody->GetCurrentTextureCoordRect();
|
||||||
DISPLAY->SetTexture( pTexture );
|
DISPLAY->SetTexture( pTexture );
|
||||||
DISPLAY->SetBlendModeNormal();
|
DISPLAY->SetBlendMode( BLEND_NORMAL );
|
||||||
if( bDrawGlowOnly )
|
if( bDrawGlowOnly )
|
||||||
DISPLAY->SetTextureModeGlow();
|
DISPLAY->SetTextureModeGlow();
|
||||||
else
|
else
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
DISPLAY->EnableTextureWrapping();
|
DISPLAY->SetTextureWrapping( true );
|
||||||
|
|
||||||
|
|
||||||
const float fFrameWidth = pSprBody->GetUnzoomedWidth();
|
const float fFrameWidth = pSprBody->GetUnzoomedWidth();
|
||||||
@@ -561,12 +561,12 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
RageTexture* pTexture = pSprTopCap->GetTexture();
|
RageTexture* pTexture = pSprTopCap->GetTexture();
|
||||||
const RectF *pRect = pSprTopCap->GetCurrentTextureCoordRect();
|
const RectF *pRect = pSprTopCap->GetCurrentTextureCoordRect();
|
||||||
DISPLAY->SetTexture( pTexture );
|
DISPLAY->SetTexture( pTexture );
|
||||||
DISPLAY->SetBlendModeNormal();
|
DISPLAY->SetBlendMode( BLEND_NORMAL );
|
||||||
if( bDrawGlowOnly )
|
if( bDrawGlowOnly )
|
||||||
DISPLAY->SetTextureModeGlow();
|
DISPLAY->SetTextureModeGlow();
|
||||||
else
|
else
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
DISPLAY->EnableTextureWrapping(false);
|
DISPLAY->SetTextureWrapping(false);
|
||||||
|
|
||||||
const float fFrameWidth = pSprTopCap->GetUnzoomedWidth();
|
const float fFrameWidth = pSprTopCap->GetUnzoomedWidth();
|
||||||
const float fFrameHeight = pSprTopCap->GetUnzoomedHeight();
|
const float fFrameHeight = pSprTopCap->GetUnzoomedHeight();
|
||||||
@@ -705,7 +705,7 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame
|
|||||||
|
|
||||||
if( cache->m_bUseLighting )
|
if( cache->m_bUseLighting )
|
||||||
{
|
{
|
||||||
DISPLAY->EnableLighting( true );
|
DISPLAY->SetLighting( true );
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
RageColor(0.0f,0.0f,0.0f,1),
|
RageColor(0.0f,0.0f,0.0f,1),
|
||||||
@@ -719,7 +719,7 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame
|
|||||||
if( cache->m_bUseLighting )
|
if( cache->m_bUseLighting )
|
||||||
{
|
{
|
||||||
DISPLAY->SetLightOff( 0 );
|
DISPLAY->SetLightOff( 0 );
|
||||||
DISPLAY->EnableLighting( false );
|
DISPLAY->SetLighting( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ void RageDisplay::SetupOpenGL()
|
|||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
|
/* Reject pixels that are completely transparent early in the pipeline */
|
||||||
|
glAlphaFunc( GL_GREATER, 0.01f );
|
||||||
|
glEnable( GL_ALPHA_TEST );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set state variables
|
* Set state variables
|
||||||
*/
|
*/
|
||||||
@@ -906,13 +910,6 @@ void RageDisplay::SetTextureModeModulate()
|
|||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the blend mode for both texture and alpha. This is all that's
|
|
||||||
* available pre-OpenGL 1.4. */
|
|
||||||
void RageDisplay::SetBlendMode(int src, int dst)
|
|
||||||
{
|
|
||||||
glBlendFunc( GLenum(src), GLenum(dst) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void RageDisplay::SetTextureModeGlow(GlowMode m)
|
void RageDisplay::SetTextureModeGlow(GlowMode m)
|
||||||
{
|
{
|
||||||
if(m == GLOW_WHITEN && !m_oglspecs->EXT_texture_env_combine)
|
if(m == GLOW_WHITEN && !m_oglspecs->EXT_texture_env_combine)
|
||||||
@@ -921,7 +918,7 @@ void RageDisplay::SetTextureModeGlow(GlowMode m)
|
|||||||
switch(m)
|
switch(m)
|
||||||
{
|
{
|
||||||
case GLOW_BRIGHTEN:
|
case GLOW_BRIGHTEN:
|
||||||
SetBlendMode( GL_SRC_ALPHA, GL_ONE );
|
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GLOW_WHITEN:
|
case GLOW_WHITEN:
|
||||||
@@ -940,33 +937,46 @@ void RageDisplay::SetTextureModeGlow(GlowMode m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageDisplay::SetBlendModeNormal()
|
void RageDisplay::SetBlendMode( BlendMode mode )
|
||||||
{
|
{
|
||||||
SetBlendMode( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
switch( mode )
|
||||||
}
|
{
|
||||||
void RageDisplay::SetBlendModeAdd()
|
case BLEND_NORMAL:
|
||||||
{
|
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||||
SetBlendMode( GL_ONE, GL_ONE );
|
break;
|
||||||
|
case BLEND_ADD:
|
||||||
|
glBlendFunc( GL_ONE, GL_ONE );
|
||||||
|
break;
|
||||||
|
case BLEND_NO_EFFECT:
|
||||||
|
glBlendFunc( GL_ZERO, GL_ONE );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RageDisplay::ZBufferEnabled() const
|
bool RageDisplay::IsZBufferEnabled() const
|
||||||
{
|
{
|
||||||
bool a;
|
bool a;
|
||||||
glGetBooleanv( GL_DEPTH_TEST, (unsigned char*)&a );
|
glGetBooleanv( GL_DEPTH_TEST, (unsigned char*)&a );
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageDisplay::EnableZBuffer()
|
void RageDisplay::SetZBuffer( bool b )
|
||||||
{
|
{
|
||||||
|
if( b )
|
||||||
glEnable( GL_DEPTH_TEST );
|
glEnable( GL_DEPTH_TEST );
|
||||||
}
|
else
|
||||||
void RageDisplay::DisableZBuffer()
|
|
||||||
{
|
|
||||||
glDisable( GL_DEPTH_TEST );
|
glDisable( GL_DEPTH_TEST );
|
||||||
}
|
}
|
||||||
void RageDisplay::EnableTextureWrapping(bool b)
|
void RageDisplay::ClearZBuffer()
|
||||||
{
|
{
|
||||||
GLenum mode = b? GL_REPEAT:GL_CLAMP;
|
glClear( GL_DEPTH_BUFFER_BIT );
|
||||||
|
}
|
||||||
|
|
||||||
|
void RageDisplay::SetTextureWrapping( bool b )
|
||||||
|
{
|
||||||
|
GLenum mode = b ? GL_REPEAT : GL_CLAMP;
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode );
|
||||||
}
|
}
|
||||||
@@ -986,7 +996,7 @@ void RageDisplay::SetMaterial(
|
|||||||
glMaterialf( GL_FRONT, GL_SHININESS, shininess );
|
glMaterialf( GL_FRONT, GL_SHININESS, shininess );
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageDisplay::EnableLighting(bool b)
|
void RageDisplay::SetLighting( bool b )
|
||||||
{
|
{
|
||||||
if( b ) glEnable( GL_LIGHTING );
|
if( b ) glEnable( GL_LIGHTING );
|
||||||
else glDisable( GL_LIGHTING );
|
else glDisable( GL_LIGHTING );
|
||||||
@@ -1017,3 +1027,11 @@ void RageDisplay::SetLightDirectional(
|
|||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RageDisplay::SetBackfaceCull( bool b )
|
||||||
|
{
|
||||||
|
if( b )
|
||||||
|
glEnable( GL_CULL_FACE );
|
||||||
|
else
|
||||||
|
glDisable( GL_CULL_FACE );
|
||||||
|
}
|
||||||
|
|||||||
+12
-10
@@ -22,6 +22,7 @@ struct RageVertex;
|
|||||||
const int REFRESH_DEFAULT = 0;
|
const int REFRESH_DEFAULT = 0;
|
||||||
struct oglspecs_t;
|
struct oglspecs_t;
|
||||||
|
|
||||||
|
|
||||||
class RageDisplay
|
class RageDisplay
|
||||||
{
|
{
|
||||||
friend class RageTexture;
|
friend class RageTexture;
|
||||||
@@ -58,16 +59,18 @@ public:
|
|||||||
void PostMultMatrix( const RageMatrix &f );
|
void PostMultMatrix( const RageMatrix &f );
|
||||||
void PreMultMatrix( const RageMatrix &f );
|
void PreMultMatrix( const RageMatrix &f );
|
||||||
|
|
||||||
void SetTexture( RageTexture* pTexture );
|
void SetBlendMode( BlendMode mode );
|
||||||
|
|
||||||
|
void SetTexture( RageTexture* pTexture );
|
||||||
void SetTextureModeModulate();
|
void SetTextureModeModulate();
|
||||||
void SetTextureModeGlow(GlowMode m = GLOW_WHITEN );
|
void SetTextureModeGlow( GlowMode m = GLOW_WHITEN );
|
||||||
void SetBlendModeNormal();
|
void SetTextureWrapping( bool b );
|
||||||
void SetBlendModeAdd();
|
|
||||||
bool ZBufferEnabled() const;
|
bool IsZBufferEnabled() const;
|
||||||
void EnableZBuffer();
|
void SetZBuffer( bool b );
|
||||||
void DisableZBuffer();
|
void ClearZBuffer();
|
||||||
void EnableTextureWrapping(bool b=true);
|
|
||||||
|
void SetBackfaceCull( bool b );
|
||||||
|
|
||||||
void SetMaterial(
|
void SetMaterial(
|
||||||
float emissive[4],
|
float emissive[4],
|
||||||
@@ -77,7 +80,7 @@ public:
|
|||||||
float shininess
|
float shininess
|
||||||
);
|
);
|
||||||
|
|
||||||
void EnableLighting(bool b=true);
|
void SetLighting( bool b );
|
||||||
void SetLightOff( int index );
|
void SetLightOff( int index );
|
||||||
void SetLightDirectional(
|
void SetLightDirectional(
|
||||||
int index,
|
int index,
|
||||||
@@ -119,7 +122,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddVerts( const RageVertex v[], int iNumVerts );
|
void AddVerts( const RageVertex v[], int iNumVerts );
|
||||||
void SetBlendMode(int src, int dst);
|
|
||||||
void SetupOpenGL();
|
void SetupOpenGL();
|
||||||
void SetupExtensions();
|
void SetupExtensions();
|
||||||
void SetViewport(int shift_left, int shift_down);
|
void SetViewport(int shift_left, int shift_down);
|
||||||
|
|||||||
@@ -11,11 +11,12 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This is shared between Actor and RageDisplay. I don't want to put this in
|
/* These are shared between Actor and RageDisplay. I don't want to put this in
|
||||||
* Actor (because Rage shouldn't touch Actor) and I don't want to have Actor.h
|
* Actor (because Rage shouldn't touch Actor) and I don't want to have Actor.h
|
||||||
* depend on RageDisplay (since that'd boost RDisplay.h a lot), so let's just
|
* depend on RageDisplay (since that'd boost RDisplay.h a lot), so let's just
|
||||||
* put this here. */
|
* put this here. */
|
||||||
enum GlowMode { GLOW_BRIGHTEN, GLOW_WHITEN };
|
enum GlowMode { GLOW_BRIGHTEN, GLOW_WHITEN };
|
||||||
|
enum BlendMode { BLEND_NORMAL, BLEND_ADD, BLEND_NO_EFFECT };
|
||||||
|
|
||||||
struct RageVector2
|
struct RageVector2
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
/*
|
|
||||||
* This is a demonstration 3d object. I created this to give some basic
|
|
||||||
* code that sets up normal 3d object rendering. (The Space code sets
|
|
||||||
* up perspective and then renders 2d, which is different.) This actor
|
|
||||||
* should be positioned just like any other actor, calling SetX and SetY
|
|
||||||
* in the parent; that position will become the center of the frustum.
|
|
||||||
*/
|
|
||||||
#include "global.h"
|
|
||||||
|
|
||||||
#include "Sample3dObject.h"
|
|
||||||
|
|
||||||
#include "RageDisplay.h"
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "SDL.h"
|
|
||||||
#include "SDL_opengl.h"
|
|
||||||
|
|
||||||
Sample3dObject::Sample3dObject()
|
|
||||||
{
|
|
||||||
rot = 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sample3dObject::Update( float fDeltaTime )
|
|
||||||
{
|
|
||||||
rot += fDeltaTime * 360.f;
|
|
||||||
rot = float(fmod(rot, 360.f));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* One note about rendering: you get a 640x480 viewport to render in, centered
|
|
||||||
* on the location the actor is set to. That means that if the center isn't
|
|
||||||
* the center of the real screen, part of the view is offscreen and there's
|
|
||||||
* a portion of the screen you can't render to. If you want to render things
|
|
||||||
* like fullscreen background animations (characters), call SetX(CENTER_X) on
|
|
||||||
* and SetY(CENTER_Y) on the object so it gets the whole screen.
|
|
||||||
*/
|
|
||||||
void Sample3dObject::DrawPrimitives()
|
|
||||||
{
|
|
||||||
/* If this is a sub-object (3d object within a 3d object), this won't
|
|
||||||
* actually do anything: */
|
|
||||||
DISPLAY->EnterPerspective(60);
|
|
||||||
|
|
||||||
DISPLAY->SetTexture(NULL);
|
|
||||||
DISPLAY->EnableZBuffer();
|
|
||||||
|
|
||||||
glColor4f(1,1,1,1);
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
/* By default, 0,0,0 is the center of the object, at the location the actor
|
|
||||||
* is set to. We have to translate away from the viewpoint (negative Z)
|
|
||||||
* to get away from the viewer (and in front of the near clip plane). */
|
|
||||||
glTranslatef (0,0,-5);
|
|
||||||
|
|
||||||
{ /* Standard ugly OpenGL lighting stuff. */
|
|
||||||
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
|
||||||
GLfloat light_position[] = { 0.0, 0.0, 0.0, 1.0 };
|
|
||||||
GLfloat lm_ambient[] = { 0.3f, 0.3f, 0.3f, 1.0f };
|
|
||||||
|
|
||||||
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
|
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
|
|
||||||
glMaterialf(GL_FRONT, GL_SHININESS, 100.0);
|
|
||||||
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
|
|
||||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient);
|
|
||||||
|
|
||||||
glEnable(GL_LIGHTING);
|
|
||||||
glEnable(GL_LIGHT0);
|
|
||||||
}
|
|
||||||
|
|
||||||
GLfloat sphere_diffuse[] = { 0.7f, 0.0f, 0.7f, 1.0f };
|
|
||||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, sphere_diffuse);
|
|
||||||
GLUquadricObj *quadObj = gluNewQuadric();
|
|
||||||
gluQuadricDrawStyle(quadObj, GLenum(GLU_FILL));
|
|
||||||
gluQuadricNormals(quadObj, GLenum(GLU_SMOOTH));
|
|
||||||
|
|
||||||
glRotatef (rot, 0.0, 1.0, 0.0);
|
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glTranslatef (1,0,0);
|
|
||||||
gluSphere(quadObj, .25, 8, 16);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glTranslatef (-1,0,0);
|
|
||||||
gluSphere(quadObj, .35, 8, 16);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
gluDeleteQuadric(quadObj);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
DISPLAY->ExitPerspective();
|
|
||||||
DISPLAY->DisableZBuffer();
|
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
|
||||||
glDisable(GL_LIGHT0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2002 by the person(s) listed below. All rights reserved.
|
|
||||||
*
|
|
||||||
* Glenn Maynard
|
|
||||||
*/
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#ifndef SAMPLE_3D_OBJECT
|
|
||||||
#define SAMPLE_3D_OBJECT
|
|
||||||
|
|
||||||
#include "ActorFrame.h"
|
|
||||||
|
|
||||||
class Sample3dObject: public ActorFrame
|
|
||||||
{
|
|
||||||
float rot;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Sample3dObject();
|
|
||||||
void Update( float fDeltaTime );
|
|
||||||
void DrawPrimitives();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2002 by the person(s) listed below. All rights reserved.
|
|
||||||
*
|
|
||||||
* Glenn Maynard
|
|
||||||
*/
|
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "Notes.h"
|
#include "Notes.h"
|
||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
|
#include "RageTextureManager.h"
|
||||||
|
|
||||||
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
||||||
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ void ScreenSandbox::Update( float fDeltaTime )
|
|||||||
|
|
||||||
void ScreenSandbox::DrawPrimitives()
|
void ScreenSandbox::DrawPrimitives()
|
||||||
{
|
{
|
||||||
DISPLAY->EnableLighting( true );
|
DISPLAY->SetLighting( true );
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
RageColor(0,0,0,0),
|
RageColor(0,0,0,0),
|
||||||
@@ -73,7 +73,7 @@ void ScreenSandbox::DrawPrimitives()
|
|||||||
Screen::DrawPrimitives();
|
Screen::DrawPrimitives();
|
||||||
|
|
||||||
DISPLAY->SetLightOff( 0 );
|
DISPLAY->SetLightOff( 0 );
|
||||||
DISPLAY->EnableLighting( false );
|
DISPLAY->SetLighting( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSandbox::MenuLeft( PlayerNumber pn )
|
void ScreenSandbox::MenuLeft( PlayerNumber pn )
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "Notes.h"
|
#include "Notes.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
|
#include "RageTextureManager.h"
|
||||||
|
|
||||||
|
|
||||||
const int NUM_SCORE_DIGITS = 9;
|
const int NUM_SCORE_DIGITS = 9;
|
||||||
@@ -69,9 +70,17 @@ ScreenSelectMusic::ScreenSelectMusic() : Screen("ScreenSelectMusic")
|
|||||||
m_MusicWheel.SetName( "Wheel" );
|
m_MusicWheel.SetName( "Wheel" );
|
||||||
this->AddChild( &m_MusicWheel );
|
this->AddChild( &m_MusicWheel );
|
||||||
|
|
||||||
|
m_sprBannerMask.SetName( "Banner" ); // use the same metrics and animation as Banner
|
||||||
|
m_sprBannerMask.Load( THEME->GetPathToG("ScreenSelectMusic banner mask") );
|
||||||
|
m_sprBannerMask.SetBlendMode( BLEND_NO_EFFECT ); // don't draw to color buffer
|
||||||
|
m_sprBannerMask.SetUseZBuffer( true ); // do draw to the zbuffer
|
||||||
|
m_sprBannerMask.SetZ( m_sprBannerMask.GetZ()+0.05f );
|
||||||
|
this->AddChild( &m_sprBannerMask );
|
||||||
|
|
||||||
// this is loaded SetSong and TweenToSong
|
// this is loaded SetSong and TweenToSong
|
||||||
m_Banner.SetName( "Banner" );
|
m_Banner.SetName( "Banner" );
|
||||||
m_Banner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
m_Banner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
||||||
|
m_Banner.SetUseZBuffer( true ); // do have to pass the z test
|
||||||
this->AddChild( &m_Banner );
|
this->AddChild( &m_Banner );
|
||||||
|
|
||||||
m_sprBannerFrame.SetName( "BannerFrame" );
|
m_sprBannerFrame.SetName( "BannerFrame" );
|
||||||
@@ -202,8 +211,9 @@ void ScreenSelectMusic::DrawPrimitives()
|
|||||||
|
|
||||||
void ScreenSelectMusic::TweenOnScreen()
|
void ScreenSelectMusic::TweenOnScreen()
|
||||||
{
|
{
|
||||||
SET_XY_AND_ON_COMMAND( m_sprBannerFrame );
|
SET_XY_AND_ON_COMMAND( m_sprBannerMask );
|
||||||
SET_XY_AND_ON_COMMAND( m_Banner );
|
SET_XY_AND_ON_COMMAND( m_Banner );
|
||||||
|
SET_XY_AND_ON_COMMAND( m_sprBannerFrame );
|
||||||
SET_XY_AND_ON_COMMAND( m_BPMDisplay );
|
SET_XY_AND_ON_COMMAND( m_BPMDisplay );
|
||||||
SET_XY_AND_ON_COMMAND( m_sprStage );
|
SET_XY_AND_ON_COMMAND( m_sprStage );
|
||||||
SET_XY_AND_ON_COMMAND( m_sprCDTitle );
|
SET_XY_AND_ON_COMMAND( m_sprCDTitle );
|
||||||
@@ -237,8 +247,9 @@ void ScreenSelectMusic::TweenOnScreen()
|
|||||||
|
|
||||||
void ScreenSelectMusic::TweenOffScreen()
|
void ScreenSelectMusic::TweenOffScreen()
|
||||||
{
|
{
|
||||||
OFF_COMMAND( m_sprBannerFrame );
|
OFF_COMMAND( m_sprBannerMask );
|
||||||
OFF_COMMAND( m_Banner );
|
OFF_COMMAND( m_Banner );
|
||||||
|
OFF_COMMAND( m_sprBannerFrame );
|
||||||
OFF_COMMAND( m_BPMDisplay );
|
OFF_COMMAND( m_BPMDisplay );
|
||||||
OFF_COMMAND( m_sprStage );
|
OFF_COMMAND( m_sprStage );
|
||||||
OFF_COMMAND( m_sprCDTitle );
|
OFF_COMMAND( m_sprCDTitle );
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ protected:
|
|||||||
|
|
||||||
MenuElements m_Menu;
|
MenuElements m_Menu;
|
||||||
|
|
||||||
Sprite m_sprBannerFrame;
|
Sprite m_sprBannerMask;
|
||||||
FadingBanner m_Banner;
|
FadingBanner m_Banner;
|
||||||
|
Sprite m_sprBannerFrame;
|
||||||
BPMDisplay m_BPMDisplay;
|
BPMDisplay m_BPMDisplay;
|
||||||
Sprite m_sprStage;
|
Sprite m_sprStage;
|
||||||
Sprite m_sprCDTitle;
|
Sprite m_sprCDTitle;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ void Sprite::DrawPrimitives()
|
|||||||
case align_top: quadVerticies.top = 0; quadVerticies.bottom = m_size.y; break;
|
case align_top: quadVerticies.top = 0; quadVerticies.bottom = m_size.y; break;
|
||||||
case align_middle: quadVerticies.top = -m_size.y/2; quadVerticies.bottom = m_size.y/2; break;
|
case align_middle: quadVerticies.top = -m_size.y/2; quadVerticies.bottom = m_size.y/2; break;
|
||||||
case align_bottom: quadVerticies.top = -m_size.y; quadVerticies.bottom = 0; break;
|
case align_bottom: quadVerticies.top = -m_size.y; quadVerticies.bottom = 0; break;
|
||||||
default: ASSERT( false );
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -276,28 +276,24 @@ void Sprite::DrawPrimitives()
|
|||||||
|
|
||||||
DISPLAY->SetTexture( m_pTexture );
|
DISPLAY->SetTexture( m_pTexture );
|
||||||
|
|
||||||
|
// Must call this after setting the texture or else texture
|
||||||
|
// parameters have no effect.
|
||||||
|
Actor::SetRenderStates(); // set Actor-specified render states
|
||||||
|
|
||||||
if( m_pTexture )
|
if( m_pTexture )
|
||||||
{
|
{
|
||||||
float TexCoords[8];
|
float TexCoords[8];
|
||||||
GetActiveTexCoords(TexCoords);
|
GetActiveTexCoords(TexCoords);
|
||||||
TexCoordsFromArray(v, TexCoords);
|
TexCoordsFromArray(v, TexCoords);
|
||||||
|
|
||||||
DISPLAY->EnableTextureWrapping(m_bTextureWrapping);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY->SetTextureModeModulate();
|
DISPLAY->SetTextureModeModulate();
|
||||||
if( m_bBlendAdd )
|
|
||||||
DISPLAY->SetBlendModeAdd();
|
|
||||||
else
|
|
||||||
DISPLAY->SetBlendModeNormal();
|
|
||||||
|
|
||||||
/* Draw if we're not fully transparent or the zbuffer is enabled (which ignores
|
/* Draw if we're not fully transparent */
|
||||||
* alpha). */
|
|
||||||
if( m_temp.diffuse[0].a > 0 ||
|
if( m_temp.diffuse[0].a > 0 ||
|
||||||
m_temp.diffuse[1].a > 0 ||
|
m_temp.diffuse[1].a > 0 ||
|
||||||
m_temp.diffuse[2].a > 0 ||
|
m_temp.diffuse[2].a > 0 ||
|
||||||
m_temp.diffuse[3].a > 0 ||
|
m_temp.diffuse[3].a > 0 )
|
||||||
DISPLAY->ZBufferEnabled() )
|
|
||||||
{
|
{
|
||||||
//////////////////////
|
//////////////////////
|
||||||
// render the shadow
|
// render the shadow
|
||||||
@@ -311,13 +307,6 @@ void Sprite::DrawPrimitives()
|
|||||||
DISPLAY->PopMatrix();
|
DISPLAY->PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the texture doesn't have alpha, and we're not changing alpha in diffuse,
|
|
||||||
* don't bother to blend when doing the diffuse pass. */
|
|
||||||
/* I'm not sure this actually helps anywhere.
|
|
||||||
if(m_pTexture && !m_bBlendAdd && m_pTexture->GetActualID().iAlphaBits == 0 &&
|
|
||||||
m_temp.diffuse[0].a + m_temp.diffuse[1].a + m_temp.diffuse[2].a + m_temp.diffuse[3].a == 4)
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
*/
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
// render the diffuse pass
|
// render the diffuse pass
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||||
# ** DO NOT EDIT **
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
@@ -57,7 +57,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /pdb:none
|
# SUBTRACT LINK32 /verbose /pdb:none
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Release6
|
IntDir=.\../Release6
|
||||||
TargetDir=\Stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -92,7 +92,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\Stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -1028,14 +1028,6 @@ SOURCE=.\Quad.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Sample3dObject.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Sample3dObject.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Sprite.cpp
|
SOURCE=.\Sprite.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -1217,12 +1217,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
|||||||
<File
|
<File
|
||||||
RelativePath="OptionsCursor.h">
|
RelativePath="OptionsCursor.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="Sample3dObject.cpp">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="Sample3dObject.h">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="ScrollBar.cpp">
|
RelativePath="ScrollBar.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
Reference in New Issue
Block a user