Let's see what the merge diagram looks like now.

This commit is contained in:
Jason Felds
2011-02-25 11:13:09 -05:00
11 changed files with 1426 additions and 776 deletions
+13 -19
View File
@@ -204,7 +204,7 @@ void BackgroundImpl::Init()
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
{ {
bOneOrMoreChars = true; bOneOrMoreChars = true;
// Disable dancing characters if BH will be showing. // Disable dancing characters if Beginner Helper will be showing.
if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() && if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() &&
GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner ) GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner )
bShowingBeginnerHelper = true; bShowingBeginnerHelper = true;
@@ -285,10 +285,11 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
continue; continue;
} }
// Look for vsFileToResolve[i] in: /* Look for vsFileToResolve[i] in:
// - song's dir * song's dir
// - RandomMovies dir * RandomMovies dir
// - BGAnimations dir. * BGAnimations dir.
*/
vector<RString> vsPaths, vsThrowAway; vector<RString> vsPaths, vsThrowAway;
// Look for BGAnims in the song dir // Look for BGAnims in the song dir
@@ -594,12 +595,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
BackgroundUtil::SortBackgroundChangesArray( layer.m_aBGChanges ); BackgroundUtil::SortBackgroundChangesArray( layer.m_aBGChanges );
} }
Layer &mainlayer = m_Layer[0]; Layer &mainlayer = m_Layer[0];
/* If the first BGAnimation isn't negative, add a lead-in image showing
/* If the first BGAnimation isn't negative, add a lead-in image showing the song * the song background. */
* background. */
if( mainlayer.m_aBGChanges.empty() || mainlayer.m_aBGChanges.front().m_fStartBeat >= 0 ) if( mainlayer.m_aBGChanges.empty() || mainlayer.m_aBGChanges.front().m_fStartBeat >= 0 )
{ {
BackgroundChange change; BackgroundChange change;
@@ -636,7 +635,6 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
} }
} }
// Look for the random file marker, and replace the segment with LoadFromRandom. // Look for the random file marker, and replace the segment with LoadFromRandom.
for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ ) for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ )
{ {
@@ -659,7 +657,6 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ ) for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ )
ASSERT( !mainlayer.m_aBGChanges[i].m_def.m_sFile1.empty() ); ASSERT( !mainlayer.m_aBGChanges[i].m_def.m_sFile1.empty() );
// Re-sort. // Re-sort.
BackgroundUtil::SortBackgroundChangesArray( mainlayer.m_aBGChanges ); BackgroundUtil::SortBackgroundChangesArray( mainlayer.m_aBGChanges );
@@ -702,7 +699,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
int iThrowAway; int iThrowAway;
pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway ); pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway );
/* Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it. */ // Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
// Find the BGSegment we're in // Find the BGSegment we're in
@@ -711,7 +708,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
float fDeltaTime = fCurrentTime - fLastMusicSeconds; float fDeltaTime = fCurrentTime - fLastMusicSeconds;
if( i != -1 && i != m_iCurBGChangeIndex ) // we're changing backgrounds if( i != -1 && i != m_iCurBGChangeIndex ) // we're changing backgrounds
{ {
// LOG->Trace( "old bga %d -> new bga %d (%s), %f, %f", m_iCurBGChangeIndex, i, m_aBGChanges[i].GetTextDescription().c_str(), m_aBGChanges[i].m_fStartBeat, fBeat ); //LOG->Trace( "old bga %d -> new bga %d (%s), %f, %f", m_iCurBGChangeIndex, i, m_aBGChanges[i].GetTextDescription().c_str(), m_aBGChanges[i].m_fStartBeat, fBeat );
BackgroundChange oldChange; BackgroundChange oldChange;
if( m_iCurBGChangeIndex != -1 ) if( m_iCurBGChangeIndex != -1 )
@@ -739,7 +736,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( m_pFadingBGA == m_pCurrentBGA ) if( m_pFadingBGA == m_pCurrentBGA )
{ {
m_pFadingBGA = NULL; m_pFadingBGA = NULL;
// LOG->Trace( "bg didn't actually change. Ignoring." ); //LOG->Trace( "bg didn't actually change. Ignoring." );
} }
else else
{ {
@@ -890,8 +887,8 @@ BrightnessOverlay::BrightnessOverlay()
void BrightnessOverlay::Update( float fDeltaTime ) void BrightnessOverlay::Update( float fDeltaTime )
{ {
ActorFrame::Update( fDeltaTime ); ActorFrame::Update( fDeltaTime );
/* If we're actually playing, then we're past fades, etc; update the background /* If we're actually playing, then we're past fades, etc; update the
* brightness to follow Cover. */ * background brightness to follow Cover. */
if( !GAMESTATE->m_bGameplayLeadIn ) if( !GAMESTATE->m_bGameplayLeadIn )
SetActualBrightness(); SetActualBrightness();
} }
@@ -939,8 +936,6 @@ void BrightnessOverlay::FadeToActualBrightness()
SetActualBrightness(); SetActualBrightness();
} }
Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); } Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); }
Background::~Background() { SAFE_DELETE( m_pImpl ); } Background::~Background() { SAFE_DELETE( m_pImpl ); }
void Background::Init() { m_pImpl->Init(); } void Background::Init() { m_pImpl->Init(); }
@@ -951,7 +946,6 @@ void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBr
DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); } DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); }
void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); } void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); }
/* /*
* (c) 2001-2004 Chris Danford, Ben Nordstrom * (c) 2001-2004 Chris Danford, Ben Nordstrom
* All rights reserved. * All rights reserved.
+1 -2
View File
@@ -23,7 +23,7 @@ public:
virtual void Unload(); virtual void Unload();
void FadeToActualBrightness(); void FadeToActualBrightness();
void SetBrightness( float fBrightness ); /* overrides pref and Cover */ void SetBrightness( float fBrightness ); // overrides pref and Cover
DancingCharacters* GetDancingCharacters(); DancingCharacters* GetDancingCharacters();
@@ -33,7 +33,6 @@ protected:
BackgroundImpl *m_pImpl; BackgroundImpl *m_pImpl;
}; };
#endif #endif
/* /*
+18 -8
View File
@@ -14,6 +14,15 @@
#define DC_X( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterXP%d",choice+1)) #define DC_X( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterXP%d",choice+1))
#define DC_Y( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterYP%d",choice+1)) #define DC_Y( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterYP%d",choice+1))
/*
* TODO:
* - Metrics/Lua for lighting and camera sweeping.
* - Ability to load secondary elements i.e. stages.
* - Remove support for 2D characters (Lua can do it).
* - Cleanup!
*
* -- Colby
*/
const float CAMERA_REST_DISTANCE = 32.f; const float CAMERA_REST_DISTANCE = 32.f;
const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f; const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f;
@@ -34,7 +43,6 @@ const float MODEL_X_ONE_PLAYER = 0;
const float MODEL_X_TWO_PLAYERS[NUM_PLAYERS] = { +8, -8 }; const float MODEL_X_TWO_PLAYERS[NUM_PLAYERS] = { +8, -8 };
const float MODEL_ROTATIONY_TWO_PLAYERS[NUM_PLAYERS] = { -90, 90 }; const float MODEL_ROTATIONY_TWO_PLAYERS[NUM_PLAYERS] = { -90, 90 };
DancingCharacters::DancingCharacters() DancingCharacters::DancingCharacters()
{ {
m_bDrawDangerLight = false; m_bDrawDangerLight = false;
@@ -168,7 +176,7 @@ void DancingCharacters::Update( float fDelta )
{ {
if( GAMESTATE->m_bFreeze || GAMESTATE->m_bDelay ) if( GAMESTATE->m_bFreeze || GAMESTATE->m_bDelay )
{ {
// spin the camera Matrix style // spin the camera Matrix-style
m_CameraPanYStart += fDelta*40; m_CameraPanYStart += fDelta*40;
m_CameraPanYEnd += fDelta*40; m_CameraPanYEnd += fDelta*40;
} }
@@ -200,7 +208,6 @@ void DancingCharacters::Update( float fDelta )
} }
bWasGameplayStarting = bGameplayStarting; bWasGameplayStarting = bGameplayStarting;
static float fLastBeat = GAMESTATE->m_fSongBeat; static float fLastBeat = GAMESTATE->m_fSongBeat;
float fThisBeat = GAMESTATE->m_fSongBeat; float fThisBeat = GAMESTATE->m_fSongBeat;
if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat && if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat &&
@@ -211,7 +218,6 @@ void DancingCharacters::Update( float fDelta )
} }
fLastBeat = fThisBeat; fLastBeat = fThisBeat;
// time for a new sweep? // time for a new sweep?
if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat ) if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat )
{ {
@@ -247,7 +253,8 @@ void DancingCharacters::Update( float fDelta )
m_fThisCameraStartBeat = (float) iCurBeat; m_fThisCameraStartBeat = (float) iCurBeat;
m_fThisCameraEndBeat = float(iCurBeat + 8); m_fThisCameraEndBeat = float(iCurBeat + 8);
} }
/*
// is there any of this still around? This block of code is _ugly_. -Colby
// update any 2D stuff // update any 2D stuff
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
@@ -286,6 +293,7 @@ void DancingCharacters::Update( float fDelta )
} }
} }
} }
*/
} }
void DancingCharacters::Change2DAnimState( PlayerNumber pn, int iState ) void DancingCharacters::Change2DAnimState( PlayerNumber pn, int iState )
@@ -326,6 +334,7 @@ void DancingCharacters::DrawPrimitives()
bool bDanger = m_bDrawDangerLight; bool bDanger = m_bDrawDangerLight;
DISPLAY->SetLighting( true ); DISPLAY->SetLighting( true );
RageColor ambient = bFailed ? RageColor(0.2f,0.1f,0.1f,1) : (bDanger ? RageColor(0.4f,0.1f,0.1f,1) : RageColor(0.4f,0.4f,0.4f,1)); RageColor ambient = bFailed ? RageColor(0.2f,0.1f,0.1f,1) : (bDanger ? RageColor(0.4f,0.1f,0.1f,1) : RageColor(0.4f,0.4f,0.4f,1));
RageColor diffuse = bFailed ? RageColor(0.4f,0.1f,0.1f,1) : (bDanger ? RageColor(0.8f,0.1f,0.1f,1) : RageColor(1,0.95f,0.925f,1)); RageColor diffuse = bFailed ? RageColor(0.4f,0.1f,0.1f,1) : (bDanger ? RageColor(0.8f,0.1f,0.1f,1) : RageColor(1,0.95f,0.925f,1));
RageColor specular = RageColor(0.8f,0.8f,0.8f,1); RageColor specular = RageColor(0.8f,0.8f,0.8f,1);
@@ -349,12 +358,12 @@ void DancingCharacters::DrawPrimitives()
DISPLAY->SetLightOff( 0 ); DISPLAY->SetLightOff( 0 );
DISPLAY->SetLighting( false ); DISPLAY->SetLighting( false );
DISPLAY->ClearZBuffer();
} }
DISPLAY->CameraPopMatrix(); DISPLAY->CameraPopMatrix();
/*
// Ugly! -Colby
// now draw any potential 2D stuff // now draw any potential 2D stuff
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
@@ -375,6 +384,7 @@ void DancingCharacters::DrawPrimitives()
if(m_bgFail[p].IsLoaded() && m_i2DAnimState[p] == AS2D_FAIL) if(m_bgFail[p].IsLoaded() && m_i2DAnimState[p] == AS2D_FAIL)
m_bgFail[p]->Draw(); m_bgFail[p]->Draw();
} }
*/
} }
/* /*
+5 -5
View File
@@ -25,7 +25,7 @@ void Foreground::Unload()
void Foreground::LoadFromSong( const Song *pSong ) void Foreground::LoadFromSong( const Song *pSong )
{ {
/* Song graphics can get very big; never keep them in memory. */ // Song graphics can get very big; never keep them in memory.
RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy(); RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy();
TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE ); TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE );
@@ -58,7 +58,7 @@ void Foreground::LoadFromSong( const Song *pSong )
void Foreground::Update( float fDeltaTime ) void Foreground::Update( float fDeltaTime )
{ {
/* Calls to Update() should *not* be scaled by music rate. Undo it. */ // Calls to Update() should *not* be scaled by music rate. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
for( unsigned i=0; i < m_BGAnimations.size(); ++i ) for( unsigned i=0; i < m_BGAnimations.size(); ++i )
@@ -67,7 +67,7 @@ void Foreground::Update( float fDeltaTime )
if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat ) if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat )
{ {
/* The animation hasn't started yet. */ // The animation hasn't started yet.
continue; continue;
} }
@@ -89,14 +89,14 @@ void Foreground::Update( float fDeltaTime )
fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
} }
/* This shouldn't go down, but be safe: */ // This shouldn't go down, but be safe:
fDeltaTime = max( fDeltaTime, 0 ); fDeltaTime = max( fDeltaTime, 0 );
bga.m_bga->Update( fDeltaTime / fRate ); bga.m_bga->Update( fDeltaTime / fRate );
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat )
{ {
/* Finished. */ // Finished.
bga.m_bga->SetVisible( false ); bga.m_bga->SetVisible( false );
bga.m_bFinished = true; bga.m_bFinished = true;
continue; continue;
+1 -4
View File
@@ -1,18 +1,15 @@
/* Foreground - Foreground in front of notes while playing. */
#ifndef FOREGROUND_H #ifndef FOREGROUND_H
#define FOREGROUND_H #define FOREGROUND_H
#include "ActorFrame.h" #include "ActorFrame.h"
class Song; class Song;
/** @brief Foreground in front of notes while playing. */
class Foreground: public ActorFrame class Foreground: public ActorFrame
{ {
public: public:
~Foreground(); ~Foreground();
void Unload(); void Unload();
void LoadFromSong( const Song *pSong ); void LoadFromSong( const Song *pSong );
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
+11 -12
View File
@@ -65,6 +65,7 @@ void Model::Load( const RString &sFile )
#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() )
// TODO: Move MS3D loading into its own class. - Colby
void Model::LoadMilkshapeAscii( const RString &sPath ) void Model::LoadMilkshapeAscii( const RString &sPath )
{ {
LoadPieces( sPath, sPath, sPath ); LoadPieces( sPath, sPath, sPath );
@@ -288,19 +289,17 @@ bool Model::EarlyAbortDraw() const
void Model::DrawCelShaded() void Model::DrawCelShaded()
{ {
// TODO: use shell shader for outline. // TODO: use shell shader for outline.
this->SetGlow(RageColor(0,0,0,1));
this->SetDiffuseAlpha(0);
DISPLAY->SetPolygonMode( POLYGON_LINE );
DISPLAY->SetLineWidth( 3 );
this->SetZWrite( false );
this->Draw();
this->SetDiffuseAlpha(1);
this->SetGlow(RageColor(1,1,1,0));
DISPLAY->SetPolygonMode( POLYGON_FILL );
this->SetZWrite( true ); this->SetZWrite( true );
DISPLAY->SetCelShaded( true );
// First pass: outline/shell
// DISPLAY->SetCelShaded(1);
this->Draw(); this->Draw();
DISPLAY->SetCelShaded( false );
// Second pass: normal shading
// DISPLAY->SetCelShaded(2);
// this->Draw();
// DISPLAY->SetCelShaded(0)
} }
void Model::DrawPrimitives() void Model::DrawPrimitives()
@@ -375,7 +374,7 @@ void Model::DrawPrimitives()
} }
// go // go
DrawMesh( i ); DrawMesh(i);
// Turn off environment mapping on tex unit 0. // Turn off environment mapping on tex unit 0.
DISPLAY->SetSphereEnvironmentMapping( TextureUnit_1, false ); DISPLAY->SetSphereEnvironmentMapping( TextureUnit_1, false );
-2
View File
@@ -1210,13 +1210,11 @@ void ScreenGameplay::LoadNextSong()
if( m_pCombinedLifeMeter ) if( m_pCombinedLifeMeter )
m_pCombinedLifeMeter->OnLoadSong(); m_pCombinedLifeMeter->OnLoadSong();
if( m_pSongForeground ) if( m_pSongForeground )
m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong ); m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong );
m_fTimeSinceLastDancingComment = 0; m_fTimeSinceLastDancingComment = 0;
/* m_soundMusic and m_pSongBackground take a very long time to load, /* m_soundMusic and m_pSongBackground take a very long time to load,
* so cap fDelta at 0 so m_NextSong will show up on screen. * so cap fDelta at 0 so m_NextSong will show up on screen.
* -Chris */ * -Chris */
File diff suppressed because it is too large Load Diff
+1 -11
View File
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// $Workfile: stdafx.h $ // $Workfile: stdafx.h $
// $Archive: /ZipArchive/stdafx.h $ // $Archive: /ZipArchive/stdafx.h $
// $Date: 2006-01-20 13:43:41 -0600 (Fri, 20 Jan 2006) $ $Author: gmaynard $ // $Date: 2003-07-21 21:10:30 -0500 (Mon, 21 Jul 2003) $ $Author: gmaynard $
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// This source file is part of the ZipArchive library source distribution and // This source file is part of the ZipArchive library source distribution and
// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/) // is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
@@ -38,20 +38,10 @@
#define ZIP_ARCHIVE_MFC #define ZIP_ARCHIVE_MFC
#if defined(_DEBUG)
#undef _DEBUG
#define RESTORE_DEBUG
#endif
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afx.h> #include <afx.h>
#include <afxwin.h> #include <afxwin.h>
#if defined(RESTORE_DEBUG)
#undef RESTORE_DEBUG
#define _DEBUG
#endif
//{{AFX_INSERT_LOCATION}} //{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
Windows MFC