middle of working on 1.90

This commit is contained in:
Chris Danford
2002-03-31 07:55:25 +00:00
parent 065d213655
commit d641cb4ae3
24 changed files with 191 additions and 51 deletions
+1
View File
@@ -40,6 +40,7 @@ Actor::Actor()
if( PREFS ) m_bShadow = PREFS->m_GraphicOptions.m_bShadows;
else m_bShadow = true;
m_fShadowLength = 5;
m_bBlendAdd = false;
}
+2
View File
@@ -160,6 +160,7 @@ public:
// other properties
void TurnShadowOn() { m_bShadow = true; };
void TurnShadowOff() { m_bShadow = false; };
void SetShadowLength( const float fLength ) { m_fShadowLength = fLength; };
void SetBlendModeAdd() { m_bBlendAdd = true; };
void SetBlendModeNormal() { m_bBlendAdd = false; };
@@ -268,6 +269,7 @@ protected:
// other properties
//
bool m_bShadow;
float m_fShadowLength;
bool m_bBlendAdd;
};
+9 -5
View File
@@ -26,17 +26,21 @@ BPMDisplay::BPMDisplay()
m_rectFrame.SetZoomX( 120 );
m_rectFrame.SetZoomY( 40 );
m_textBPM.Load( THEME->GetPathTo(FONT_LCD_NUMBERS) );
m_textBPM.Load( THEME->GetPathTo(FONT_BOLD) );
m_textBPM.TurnShadowOff();
m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 );
//m_textBPM.SetSequence( ssprintf("999") );
m_textBPM.SetXY( -30, 0 );
m_textBPM.SetZoom( 0.7f );
m_textBPM.SetXY( -23, 0 );
m_textBPM.SetZoom( 1.0f );
m_textBPM.SetDiffuseColorTopEdge( D3DXCOLOR(1,1,0,1) ); // yellow
m_textBPM.SetDiffuseColorBottomEdge( D3DXCOLOR(1,0.5f,0,1) ); // orange
m_textLabel.Load( THEME->GetPathTo(FONT_FUTURISTIC) );
m_textLabel.SetXY( 54, 10 );
m_textLabel.Load( THEME->GetPathTo(FONT_BOLD) );
m_textLabel.TurnShadowOff();
m_textLabel.SetXY( 34, 2 );
m_textLabel.SetText( "BPM" );
m_textLabel.SetZoom( 0.7f );
m_textLabel.SetZoomX( 0.5f );
m_textLabel.SetDiffuseColorTopEdge( D3DXCOLOR(1,1,0,1) ); // yellow
m_textLabel.SetDiffuseColorBottomEdge( D3DXCOLOR(1,0.5f,0,1) ); // orange
+14 -5
View File
@@ -19,6 +19,8 @@
bool Banner::LoadFromSong( Song* pSong ) // NULL means no song
{
Sprite::TurnShadowOff();
if( pSong == NULL ) Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER), TEXTURE_HINT_NOMIPMAPS );
else if( pSong->HasBanner() ) Banner::Load( pSong->GetBannerPath(), TEXTURE_HINT_NOMIPMAPS );
else if( pSong->HasBackground() ) Banner::Load( pSong->GetBackgroundPath(), TEXTURE_HINT_NOMIPMAPS );
@@ -37,9 +39,7 @@ bool Banner::Load( const CString &sFilePath, DWORD dwHints, bool bForceReload )
void Banner::CropToRightSize()
{
Sprite::TurnShadowOff();
int iSourceWidth = m_pTexture->GetSourceWidth();
int iSourceWidth = m_pTexture->GetSourceWidth();
int iSourceHeight = m_pTexture->GetSourceHeight();
// save the original X&Y. We're going to resore them later.
@@ -54,14 +54,23 @@ void Banner::CropToRightSize()
0.98f, 0.22f, // bottom right
0.78f, 0.02f, // top right
};
SetCustomImageCoords( fCustomImageCoords );
Sprite::SetCustomImageCoords( fCustomImageCoords );
SetWidth( BANNER_WIDTH );
SetHeight( BANNER_HEIGHT );
SetZoom( 1 );
}
else // this is a normal sized banner
else if( iSourceWidth * 2 > iSourceHeight )
{
Sprite::StopUsingCustomCoords();
Sprite::StretchTo( CRect(0, 0,
(int)BANNER_WIDTH,
(int)BANNER_HEIGHT )
);
}
else // this is probably a background graphic or something not intended to be a banner
{
Sprite::StopUsingCustomCoords();
// first find the correct zoom
Sprite::ScaleToCover( CRect(0, 0,
+2 -2
View File
@@ -16,8 +16,8 @@
#include "Song.h"
const float BANNER_WIDTH = 250;
const float BANNER_HEIGHT = 100;
const float BANNER_WIDTH = 253;
const float BANNER_HEIGHT = 94;
class Banner : public Sprite
+5 -2
View File
@@ -54,8 +54,11 @@ bool BitmapText::Load( const CString &sFontFilePath )
void BitmapText::SetText( const CString &sText )
void BitmapText::SetText( CString sText )
{
if( m_pFont->m_bCapitalsOnly )
sText.MakeUpper();
//
// save the string and crop if necessary
//
@@ -258,7 +261,7 @@ void BitmapText::RenderPrimitives()
if( m_bShadow )
{
SCREEN->PushMatrix();
SCREEN->Translate( 5, 5, 0 ); // shift by 5 units
SCREEN->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
+1 -1
View File
@@ -30,7 +30,7 @@ public:
bool Load( const CString &sFontName );
void SetText( const CString &sText );
void SetText( CString sText );
int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; };
+2
View File
@@ -90,6 +90,8 @@ Font::Font( const CString &sFontFilePath )
m_iCharToFrameNo[i] = i;
}
m_bCapitalsOnly = ("1" == ini.GetValue("Font", "CapitalsOnly"));
//
// load character widths
+4
View File
@@ -34,9 +34,13 @@ public:
CString m_sTexturePath;
RageTexture* m_pTexture;
bool m_bCapitalsOnly;
int m_iCharToFrameNo[MAX_FONT_CHARS];
int m_iFrameNoToWidth[MAX_FONT_CHARS]; // in soure coordinate space
protected:
};
+28
View File
@@ -0,0 +1,28 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: GrooveRadar
Desc: See header.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "RageUtil.h"
#include "GrooveRadar.h"
#include "ThemeManager.h"
#include "RageBitmapTexture.h"
GrooveRadar::GrooveRadar()
{
m_sprRadar.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_RADAR) );
this->AddActor( &m_sprRadar );
}
void GrooveRadar::LoadFromSong( Song* pSong ) // NULL means no song
{
}
+34
View File
@@ -0,0 +1,34 @@
/*
-----------------------------------------------------------------------------
Class: GrooveRadar
Desc: The song's GrooveRadar displayed in SelectSong.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _GrooveRadar_H_
#define _GrooveRadar_H_
#include "ActorFrame.h"
#include "Sprite.h"
#include "Song.h"
class GrooveRadar : public ActorFrame
{
public:
GrooveRadar::GrooveRadar();
void LoadFromSong( Song* pSong ); // NULL means no Song
protected:
Sprite m_sprRadar;
};
#endif
+1
View File
@@ -55,6 +55,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
m_textHelp.SetText( sHelpText );
m_textHelp.SetZoom( 0.5f );
m_textHelp.SetEffectBlinking();
m_textHelp.SetShadowLength( 2 );
m_soundSwoosh.Load( THEME->GetPathTo(SOUND_MENU_SWOOSH) );
+11 -6
View File
@@ -89,12 +89,12 @@ WheelItemDisplay::WheelItemDisplay()
m_sprSectionBackground.Load( THEME->GetPathTo(GRAPHIC_SECTION_BACKGROUND) );
m_sprSectionBackground.SetXY( -30, 0 );
m_textSectionName.Load( THEME->GetPathTo(FONT_OUTLINE) );
m_textSectionName.Load( THEME->GetPathTo(FONT_BOLD) );
m_textSectionName.TurnShadowOff();
m_textSectionName.SetHorizAlign( align_center );
m_textSectionName.SetHorizAlign( align_left );
m_textSectionName.SetVertAlign( align_middle );
m_textSectionName.SetXY( m_sprSectionBackground.GetX(), 0 );
m_textSectionName.SetZoom( 1.5f );
m_textSectionName.SetXY( m_sprSectionBackground.GetX() - m_sprSectionBackground.GetUnzoomedWidth()/2 + 10, 0 );
m_textSectionName.SetZoom( 1.2f );
m_textSectionName.SetDiffuseColor( COLOR_SECTION_LETTER );
}
@@ -123,14 +123,19 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
int iIndexSplit = m_sSectionName.Find( ' ', m_sSectionName.GetLength()/3 );
m_sSectionName.SetAt( iIndexSplit, '\n' );
m_textSectionName.SetZoom( 0.75f );
m_textSectionName.SetZoom( 0.6f );
m_textSectionName.SetText( m_sSectionName );
}
else // this is a short name
{
m_textSectionName.SetZoom( 1.5f );
m_textSectionName.SetZoom( 1.2f );
m_textSectionName.SetText( m_sSectionName );
}
float fTextWidth, fSpriteWidth;
fTextWidth = m_textSectionName.GetWidestLineWidthInSourcePixels() * m_textSectionName.GetZoom();
fSpriteWidth = m_sprSectionBackground.GetUnzoomedWidth() * m_sprSectionBackground.GetZoom() - 20;
if( fTextWidth > fSpriteWidth )
m_textSectionName.SetZoomX( m_textSectionName.GetZoom() * fSpriteWidth / fTextWidth );
m_sprSectionBackground.SetDiffuseColor( m_colorTint );
break;
case TYPE_MUSIC:
+1 -1
View File
@@ -27,7 +27,7 @@
#include "MusicStatusDisplay.h"
#include "Window.h" // for WindowMessage
const int NUM_WHEEL_ITEMS_TO_DRAW = 13;
const int NUM_WHEEL_ITEMS_TO_DRAW = 11;
const float FADE_TIME = 0.5f;
+27
View File
@@ -103,6 +103,7 @@ void PrefsManager::ReadPrefsFromDisk()
if( name_string == "TextureColor" ) m_GraphicOptions.m_iTextureColor = atoi( value_string );
if( name_string == "Shadows" ) m_GraphicOptions.m_bShadows = ( value_string == "1" );
if( name_string == "30fpsLock" ) m_GraphicOptions.m_b30fpsLock = ( value_string == "1" );
if( name_string == "Backgrounds" ) m_GraphicOptions.m_bBackgrounds = ( value_string == "1" );
}
}
@@ -140,6 +141,7 @@ void PrefsManager::SavePrefsToDisk()
ini.SetValue( "GraphicOptions", "TextureColor", ssprintf("%d", m_GraphicOptions.m_iTextureColor) );
ini.SetValue( "GraphicOptions", "Shadows", m_GraphicOptions.m_bShadows ? "1":"0" );
ini.SetValue( "GraphicOptions", "30fpsLock", m_GraphicOptions.m_b30fpsLock ? "1":"0" );
ini.SetValue( "GraphicOptions", "Backgrounds", m_GraphicOptions.m_bBackgrounds ? "1":"0" );
ini.SetValue( "GameOptions", "IgnoreJoyAxes", m_GameOptions.m_bIgnoreJoyAxes ? "1":"0" );
@@ -417,4 +419,29 @@ bool PrefsManager::IsButtonDown( PlayerInput PlayerI )
}
CString PrefsManager::GetStageText()
{
if( m_iCurrentStage == 3 )
return "Final";
CString sNumberSuffix;
if( ( (m_iCurrentStage/10) % 10 ) == 1 ) // in the teens (e.g. 19, 213)
{
sNumberSuffix = "th";
}
else // not in the teens
{
const int iLastDigit = m_iCurrentStage%10;
switch( iLastDigit )
{
case 1: sNumberSuffix = "st"; break;
case 2: sNumberSuffix = "nd"; break;
case 3: sNumberSuffix = "rd"; break;
default:sNumberSuffix = "th"; break;
}
}
return ssprintf( "%d%s", PREFS->m_iCurrentStage, sNumberSuffix );
}
+1
View File
@@ -38,6 +38,7 @@ public:
ScoreSummary m_ScoreSummary[NUM_PLAYERS]; // for passing from Dancing to Results
SongSortOrder m_SongSortOrder; // used by MusicWheel and should be saved until the app exits
int m_iCurrentStage; // number of stages played +1
CString GetStageText();
GameOptions m_GameOptions;
GraphicOptions m_GraphicOptions;
+7 -2
View File
@@ -178,7 +178,7 @@ void Sprite::Update( float fDeltaTime )
void Sprite::RenderPrimitives()
{
SCREEN->Translate( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels
SCREEN->TranslateLocal( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels
if( m_pTexture == NULL )
return;
@@ -264,7 +264,7 @@ void Sprite::RenderPrimitives()
if( m_bShadow )
{
SCREEN->PushMatrix();
SCREEN->Translate( 5, 5, 0 ); // shift by 5 units
SCREEN->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
@@ -383,3 +383,8 @@ void Sprite::SetCustomImageCoords( float fImageCoords[8] ) // order: bottom left
SetCustomTextureCoords( fImageCoords );
}
void Sprite::StopUsingCustomCoords()
{
m_bUsingCustomTexCoords = false;
}
+2
View File
@@ -30,6 +30,7 @@ public:
virtual bool Load( CString sFilePath, DWORD dwHints = 0, bool bForceReload = false )
{
ASSERT( sFilePath != "" );
if( sFilePath.Right(7) == ".sprite" )
return LoadFromSpriteFile( sFilePath, dwHints, bForceReload );
else
@@ -52,6 +53,7 @@ public:
void SetCustomSourceRect( FRECT rectSourceCoords ); // in source pixel space
void SetCustomImageRect( FRECT rectImageCoords ); // in image pixel space
void SetCustomImageCoords( float fImageCoords[8] );
void StopUsingCustomCoords();
protected:
+2 -2
View File
@@ -29,7 +29,7 @@
#include "FontManager.h"
#include "WindowSandbox.h"
#include "WindowMenuResults.h"
#include "WindowResults.h"
#include "WindowTitleMenu.h"
#include "WindowPlayerOptions.h"
@@ -488,7 +488,7 @@ HRESULT CreateObjects( HWND hWnd )
//WM->SetNewWindow( new WindowLoading );
//WM->SetNewWindow( new WindowSandbox );
//WM->SetNewWindow( new WindowMenuResults );
//WM->SetNewWindow( new WindowResults );
//WM->SetNewWindow( new WindowPlayerOptions );
WM->SetNewWindow( new WindowTitleMenu );
+24 -6
View File
@@ -144,6 +144,12 @@
<File
RelativePath=".\Window.h">
</File>
<File
RelativePath="WindowAdvancedOptions.cpp">
</File>
<File
RelativePath="WindowAdvancedOptions.h">
</File>
<File
RelativePath=".\WindowCaution.cpp">
</File>
@@ -204,12 +210,6 @@
<File
RelativePath=".\WindowMenu.h">
</File>
<File
RelativePath=".\WindowMenuResults.cpp">
</File>
<File
RelativePath=".\WindowMenuResults.h">
</File>
<File
RelativePath=".\WindowMessage.h">
</File>
@@ -231,6 +231,12 @@
<File
RelativePath=".\WindowPrompt.h">
</File>
<File
RelativePath="WindowResults.cpp">
</File>
<File
RelativePath="WindowResults.h">
</File>
<File
RelativePath=".\WindowSandbox.cpp">
</File>
@@ -546,6 +552,18 @@
<File
RelativePath=".\GranularityIndicator.h">
</File>
<File
RelativePath="GrooveRadar.cpp">
</File>
<File
RelativePath="GrooveRadar.h">
</File>
<File
RelativePath="InfoFrame.cpp">
</File>
<File
RelativePath="InfoFrame.h">
</File>
<File
RelativePath="MenuElements.cpp">
</File>
+3 -3
View File
@@ -18,9 +18,9 @@
TextBanner::TextBanner()
{
m_textTitle.Load( THEME->GetPathTo(FONT_FUTURISTIC) );
m_textSubTitle.Load( THEME->GetPathTo(FONT_FUTURISTIC) );
m_textArtist.Load( THEME->GetPathTo(FONT_FUTURISTIC) );
m_textTitle.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
m_textSubTitle.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
m_textArtist.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 );
m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 );
+5 -8
View File
@@ -173,15 +173,12 @@ CString ThemeManager::ElementToAssetPath( ThemeElement te )
case SOUND_EDIT_CHANGE_LINE: sAssetPath = "Sounds\\edit change line"; break;
case SOUND_EDIT_CHANGE_SNAP: sAssetPath = "Sounds\\edit change snap"; break;
case FONT_OUTLINE: sAssetPath = "Fonts\\Outline"; break;
case FONT_CAPITALS: sAssetPath = "Fonts\\Capitals"; break;
case FONT_NORMAL: sAssetPath = "Fonts\\Normal"; break;
case FONT_FUTURISTIC: sAssetPath = "Fonts\\Futuristic"; break;
case FONT_BOLD_NUMBERS: sAssetPath = "Fonts\\Bold Numbers"; break;
case FONT_LCD_NUMBERS: sAssetPath = "Fonts\\LCD Numbers"; break;
case FONT_BOLD: sAssetPath = "Fonts\\Bold"; break;
case FONT_COMBO_NUMBERS: sAssetPath = "Fonts\\Combo Numbers"; break;
case FONT_FEET: sAssetPath = "Fonts\\Feet"; break;
case FONT_COMBO_NUMBERS: sAssetPath = "Fonts\\MAX Numbers"; break;
case FONT_SCORE_NUMBERS: sAssetPath = "Fonts\\Bold Numbers"; break;
case FONT_NORMAL: sAssetPath = "Fonts\\Normal"; break;
case FONT_SCORE_NUMBERS: sAssetPath = "Fonts\\Score Numbers"; break;
case FONT_TEXT_BANNER: sAssetPath = "Fonts\\Text Banner"; break;
case ANNOUNCER_ATTRACT: sAssetPath = "Announcer\\attract"; break;
case ANNOUNCER_BAD_COMMENT: sAssetPath = "Announcer\\bad comment"; break;
+4 -7
View File
@@ -105,15 +105,12 @@ enum ThemeElement {
SOUND_EDIT_CHANGE_LINE,
SOUND_EDIT_CHANGE_SNAP,
FONT_OUTLINE,
FONT_CAPITALS,
FONT_NORMAL,
FONT_FUTURISTIC,
FONT_BOLD_NUMBERS,
FONT_LCD_NUMBERS,
FONT_FEET,
FONT_BOLD,
FONT_COMBO_NUMBERS,
FONT_FEET,
FONT_NORMAL,
FONT_SCORE_NUMBERS,
FONT_TEXT_BANNER,
ANNOUNCER_ATTRACT,
ANNOUNCER_BAD_COMMENT,
+1 -1
View File
@@ -37,7 +37,7 @@ void TransitionStarWipe::RenderPrimitives()
return;
}
float fPercentOpen = GetPercentageOpen();
float fPercentOpen = 1-GetPercentageOpen();
/*
switch( m_TransitionState )
{