checkin of v1.50

This commit is contained in:
Chris Danford
2002-01-16 10:01:32 +00:00
parent 7f3a131195
commit 0add9e0bb3
66 changed files with 3425 additions and 1313 deletions
-71
View File
@@ -1,71 +0,0 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: Background.h
Desc: A graphic displayed in the background during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "Background.h"
#include "RageUtil.h"
const CString sVisDir = "Visualizations\\";
void Background::LoadFromSong( Song& song )
{
CString sBGTexturePath = song.GetBackgroundPath();
sBGTexturePath.MakeLower();
bool bIsAMovieBackground = ( sBGTexturePath.Right(3) == "avi" ||
sBGTexturePath.Right(3) == "mpg" ||
sBGTexturePath.Right(3) == "mpeg" );
if( bIsAMovieBackground )
{
Sprite::LoadFromTexture( sBGTexturePath );
Sprite::StretchTo( CRect(0,480,640,0) ); // flip
Sprite::SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,0.8f,1) );
// don't load m_sprVis
}
else // !bIsAMovieBackground
{
Sprite::LoadFromTexture( sBGTexturePath );
Sprite::StretchTo( CRect(0,0,640,480) );
Sprite::SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,0.8f,1) );
if( GAMEINFO->m_GameOptions.m_bRandomVis )
{
// load a random visualization
CStringArray sVisualizationPaths;
GetDirListing( sVisDir + "*.*", sVisualizationPaths );
if( sVisualizationPaths.GetSize() > 0 ) // there is at least one visualization
{
int iIndexRandom = rand() % sVisualizationPaths.GetSize();
m_sprVis.LoadFromTexture( sVisDir + sVisualizationPaths[iIndexRandom] );
m_sprVis.StretchTo( CRect(0,480,640,0) ); // flip
m_sprVis.SetBlendModeAdd();
//m_sprVis.SetColor( D3DXCOLOR(1,1,1,0.5f) );
}
}
}
}
void Background::Update( float fDeltaTime)
{
Sprite::Update( fDeltaTime );
m_sprVis.Update( fDeltaTime );
}
void Background::Draw()
{
Sprite::Draw();
m_sprVis.Draw();
}