Mini-rewrite of input mapping, theme support, and added KSF reader.

This commit is contained in:
Chris Danford
2002-07-31 19:40:40 +00:00
parent 488798fef6
commit 4ec08edf2d
88 changed files with 1444 additions and 851 deletions
+66 -22
View File
@@ -100,8 +100,11 @@ In menus:
* Enter = Start, Escape = Back
In gameplay:
* F11 = decrease offset
* F12 = increase offset
* F8 = toggle AutoPlay
* F9 = decrease offset
* F10 = increase offset
* F11 = decrease BPM of current segment
* F12 = increase BPM of current segment
* Hold Escape = abort playing
************************************************************
@@ -217,18 +220,22 @@ upgrade to the latest drivers, which will hopefully fix the errors.
You need to download DirectX 8.1. http://www.microsoft.com/directx
* StepMania reports "Direct3DCreate failed".
You need to download DirectX 8.1. http://www.microsoft.com/directx
* StepMania reports "Direct3DCreateDevice failed".
This error means that your video card or drivers do not support Direct3D 8.
Download the latest drivers for your video card. If your video card is older
than 2 or 3 years, Direct3D 8 drivers may not be available. Sorry.
* Music rates of over 100% do not work on my computer. Why?
Some very old sound cards do not support sound playback rates that are greater
than the original sample rate. This problem is likely to be corrected by newer
sound card drivers.
* StepMania reports "Direct3D Create Device failed".
This error means that your video card or drivers do not support Direct3D 8.
Download the latest drivers for your video card. If your video card is older
than 2 or 3 years, Direct3D 8 drivers may not be available. Sorry.
* Im looking to purchase a video card. What works well with StepMania?
Just about any video card manufactured in the last year will run StepMania
@@ -239,6 +246,18 @@ GeForce chip or an ATI Radeon chip.
1. Install the latest drivers for your video card.
2. Press F5 in the game to toggle between high detail and low detail modes.
3. Tweak the Display Resolution and Texture Resolution setting in the GameOptions
screen.
* Chris, will you tell me when the next version will be released?
I'd rather not going to say. Sorry. It's gotten me in trouble before.
* Why won't you tell me? I promise I won't tell anyone else.
The reason I won't tell is because I don't know yet and I don't want to make
anyone angry if it takes longer than I expect (it usually does).
************************************************************
10. StepMania Packages - .smzip
@@ -614,32 +633,57 @@ variables take effect.
************************************************************
------------------------CVS after 3.00 beta 5----------------
BUG FIX: Old hashing algorithm caused some songs to have the same cache
filename, causing at least one broken duplicate of a song in the game and
at least one inaccessible song. New hashing algorithm is stronger and far
less likely to do this.
BUG FIX: New hashing algorithm prevents multiple songs from hashing to the same
cache file.
BUG FIX: "Select Group" screen now only displays songs and groups available in
the current style (instead of all songs).
BUG FIX: Opening a "(NEW)" sequence in Edit/Record/Synch mode with a style
over 4 panels (such as dance-solo or ez2-single) incorrectly initialized
the sequence as 4-column. This caused the problems (1) only the leftmost
4 panels in the sequence could be edited, and (2) sequences saved in this
way would cause an error such as "Actual number of note columns (6) is
different from the NotesType (4)." either when selected from the song
wheel or when starting the program again. This has been fixed.
OPTIMIZATION: Faster song loading.
BUG FIX: Oni life meter now works correctly.
over 4 panels (such as dance-solo or ez2-single) now works.
BUG FIX: Oni life meter finished.
NEW FEATURE: Theme support. See readme for more info.
------------------------Version 3.00 beta 4------------------
BUG FIX: Stop times now read correctly again in BMSs.
BUG FIX: #SOLO steps in DWIs now read correctly.
OPTIMIZATION: Startup time greatly reduced thanks to hiding the log window and
SM parsing optimizations
CHANGE: Display resolution and max texture size sliders re-enabled
NEW FEATURE: Refresh rate slider
NEW FEATURE: 0.5x, 0.75x scroll speed
NEW FEATURE: Song rates up to 1.5X
NEW FEATURE: Effect Mini
CHANGE: Now hold L&R while pressing start to change sort on Select Music
CHANGE: Combo display now draws behind notes
BUG FIX: Stage counter reset after fail (thanks Andy)
BUG FIX: Roulette chooses from only last preferred group
BUG FIX: Fail End of Song setting doesn't get stuck at end of song.
CHANGE: Back button must now be held for 1/2 a second to prevent accidental presses.
BUG FIX: No more slowdown when song background showing song background (I think).
BUG FIX: Fixed clipping problems related to scroll speed
BUG FIX: Hold notes no longer jitter at certain scroll speeds
NEW FEATURE: During gameplay: F8 = toggle AutoPlay
NEW FEATURE: During gameplay: F9 = decrease offset, F10 = increase offset,
NEW FEATURE: During gameplay: F11 = decrease BPM of current segment, F12 =
increase BPM of current segment.
CHANGE: Life meters graphics are now part of the theme system
CHANGE: New Song Option: Choose Oni life battery or normal life meter
BUG FIX: Life Bar no-recover and sudden death options now work.
BUG FIX: Select Difficulty arrow no longer messed up on early input
BUG FIX: Fixed scoring inaccuracies in Oni
NEW FEATURE: Endless, next to Oni Nonstop
BUG FIX: Inaccurate earned Chaos radar values fixed
BUG FIX: Score multiplier now based on note number and not current combo size.
This change causes higher, but MAX2-accurate scores.
NEW FEATURE: KSF file reading. Just drop the KSF folders into a group folder.
NEW FEATURE: Pump It Up support
NEW FEATURE: Life Difficulty option - this option determines how much the life
meter changes when steps are judged. This option corresponds to Difficulty in
DDR Arcade machines.
CHANGE: Old difficulty option renamed to Judge Difficulty.
NEW FEATURE: MenuInput option. Setting this option to "USE ONLY DEDICATED MENU
BUTTONS" will allow the menus to be controlled only by the buttons mapped to
MenuLeft, MenuRight, etc. This is useful if you have a controller with
buttons that can be dedicated to controlling the menus (like a DDR arcade
cabinet). Also, using only dedicated menu buttons will allow you to enter
codes at the Select Music screen using the dance panels.
------------------------Version 3.00 beta 4------------------
BUG FIX: Fixed crash entering Config Joy/Key (duh!)
+2 -2
View File
@@ -153,7 +153,7 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the
void Actor::Update( float fDeltaTime )
{
// LOG->WriteLine( "Actor::Update( %f )", fDeltaTime );
// LOG->Trace( "Actor::Update( %f )", fDeltaTime );
// update effect
switch( m_Effect )
@@ -178,7 +178,7 @@ void Actor::Update( float fDeltaTime )
m_bTweeningTowardEndColor = TRUE;
}
}
//LOG->WriteLine( "Actor::m_fPercentBetweenColors %f", m_fPercentBetweenColors );
//LOG->Trace( "Actor::m_fPercentBetweenColors %f", m_fPercentBetweenColors );
break;
case wagging:
m_fWagTimer += fDeltaTime;
+1 -1
View File
@@ -30,7 +30,7 @@ void ActorFrame::DrawPrimitives()
void ActorFrame::Update( float fDeltaTime )
{
// LOG->WriteLine( "ActorFrame::Update( %f )", fDeltaTime );
// LOG->Trace( "ActorFrame::Update( %f )", fDeltaTime );
Actor::Update( fDeltaTime );
+1 -1
View File
@@ -23,7 +23,7 @@ const CString ANNOUNCER_BASE_DIR = "Announcers\\";
AnnouncerManager::AnnouncerManager()
{
LOG->WriteLine("AnnouncerManager::AnnouncerManager()");
LOG->Trace("AnnouncerManager::AnnouncerManager()");
CStringArray arrayAnnouncerNames;
GetAnnouncerNames( arrayAnnouncerNames );
+1 -1
View File
@@ -73,7 +73,7 @@ float ArrowGetXPos( const PlayerNumber pn, int iColNum, float fYOffset )
switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType )
{
case PlayerOptions::EFFECT_DRUNK:
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart()/4 + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart()*2 + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
break;
}
return fPixelOffsetFromCenter;
+2 -2
View File
@@ -61,7 +61,7 @@ BitmapText::~BitmapText()
bool BitmapText::Load( const CString &sFontFilePath )
{
LOG->WriteLine( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
// load font
m_pFont = FONT->LoadFont( sFontFilePath );
@@ -74,7 +74,7 @@ bool BitmapText::Load( const CString &sFontFilePath )
void BitmapText::SetText( CString sText )
{
//LOG->WriteLine( "BitmapText::SetText()" );
//LOG->Trace( "BitmapText::SetText()" );
if( m_pFont->m_bCapitalsOnly )
sText.MakeUpper();
+1 -1
View File
@@ -87,7 +87,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
}
else
LOG->WriteLine( "Unexpected value named '%s'", sValueName );
LOG->Trace( "Unexpected value named '%s'", sValueName );
}
}
+1 -1
View File
@@ -22,7 +22,7 @@
Font::Font( const CString &sFontFilePath )
{
//LOG->WriteLine( "Font::LoadFromFontName(%s)", sFontFilePath );
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath );
for( int i=0; i<MAX_FONT_CHARS; i++ )
{
m_iCharToFrameNo[i] = -1;
+8 -8
View File
@@ -40,7 +40,7 @@ FontManager::~FontManager()
while( pos != NULL ) // iterate over all k/v pairs in map
{
m_mapPathToFont.GetNextAssoc( pos, sFontFilePath, pFont );
LOG->WriteLine( "FONT LEAK: '%s', RefCount = %d.", sFontFilePath, pFont->m_iRefCount );
LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", sFontFilePath, pFont->m_iRefCount );
SAFE_DELETE( pFont );
}
@@ -55,7 +55,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
{
sFontFilePath.MakeLower();
// LOG->WriteLine( "FontManager::LoadFont(%s).", sFontFilePath );
// LOG->Trace( "FontManager::LoadFont(%s).", sFontFilePath );
// Convert the path to lowercase so that we don't load duplicates.
@@ -67,7 +67,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
if( m_mapPathToFont.Lookup( sFontFilePath, pFont ) ) // if the texture already exists in the map
{
LOG->WriteLine( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
pFont->m_iRefCount++;
}
else // the texture is not already loaded
@@ -77,7 +77,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
pFont = (Font*) new Font( sFontFilePath );
LOG->WriteLine( "FontManager: Loading '%s' from disk.", sFontFilePath);
LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
m_mapPathToFont.SetAt( sFontFilePath, pFont );
}
@@ -102,11 +102,11 @@ void FontManager::UnloadFont( CString sFontFilePath )
{
sFontFilePath.MakeLower();
// LOG->WriteLine( "FontManager::UnloadTexture(%s).", sFontFilePath );
// LOG->Trace( "FontManager::UnloadTexture(%s).", sFontFilePath );
if( sFontFilePath == "" )
{
LOG->WriteLine( "FontManager::UnloadTexture(): tried to Unload a blank" );
LOG->Trace( "FontManager::UnloadTexture(): tried to Unload a blank" );
return;
}
@@ -117,13 +117,13 @@ void FontManager::UnloadFont( CString sFontFilePath )
pFont->m_iRefCount--;
if( pFont->m_iRefCount == 0 ) // there are no more references to this texture
{
LOG->WriteLine( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
SAFE_DELETE( pFont ); // free the texture
m_mapPathToFont.RemoveKey( sFontFilePath ); // and remove the key in the map
}
else
{
LOG->WriteLine( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
LOG->Trace( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
}
}
+72 -1
View File
@@ -13,10 +13,12 @@
#include "GameDef.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "IniFile.h"
#include "StyleDef.h"
#include "RageException.h"
#include "GameState.h"
#include "InputMapper.h"
#include "PrefsManager.h"
CString GameDef::ElementToGraphicSuffix( const SkinElement gbg )
@@ -130,3 +132,72 @@ void GameDef::AssertSkinIsComplete( CString sSkin )
throw RageException( "Game button graphic at %s is missing.", sPathToGraphic );
}
}
MenuInput GameDef::GameInputToMenuInput( GameInput GameI )
{
PlayerNumber pn;
StyleDef::StyleType type = StyleDef::TWO_PLAYERS_USE_TWO_SIDES;
if( GAMESTATE->m_CurStyle != STYLE_NONE )
type = GAMESTATE->GetCurrentStyleDef()->m_StyleType;
switch( type )
{
case StyleDef::ONE_PLAYER_USES_ONE_SIDE:
case StyleDef::TWO_PLAYERS_USE_TWO_SIDES:
pn = (PlayerNumber)GameI.controller;
break;
case StyleDef::ONE_PLAYER_USES_TWO_SIDES:
pn = GAMESTATE->m_MasterPlayerNumber;
break;
default:
ASSERT(0); // invalid m_StyleType
};
for( int i=0; i<NUM_MENU_BUTTONS; i++ )
if( m_DedicatedMenuButton[i] == GameI.button )
return MenuInput( pn, (MenuButton)i );
for( i=0; i<NUM_MENU_BUTTONS; i++ )
if( m_SecondaryMenuButton[i] == GameI.button )
return MenuInput( pn, (MenuButton)i );
return MenuInput(); // invalid GameInput
}
void GameDef::MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] )
{
ASSERT( MenuI.IsValid() );
GameIout[0].MakeInvalid(); // initialize
GameIout[1].MakeInvalid();
GameIout[2].MakeInvalid();
GameIout[3].MakeInvalid();
GameController controller[2];
int iNumSidesUsing = 1;
switch( GAMESTATE->GetCurrentStyleDef()->m_StyleType )
{
case StyleDef::ONE_PLAYER_USES_ONE_SIDE:
case StyleDef::TWO_PLAYERS_USE_TWO_SIDES:
controller[0] = (GameController)MenuI.player;
iNumSidesUsing = 1;
break;
case StyleDef::ONE_PLAYER_USES_TWO_SIDES:
controller[0] = GAME_CONTROLLER_1;
controller[1] = GAME_CONTROLLER_2;
iNumSidesUsing = 2;
break;
default:
ASSERT(0); // invalid m_StyleType
};
GameButton button[2] = { m_DedicatedMenuButton[MenuI.button], m_SecondaryMenuButton[MenuI.button] };
int iNumButtonsUsing = PREFSMAN->m_bOnlyDedicatedMenuButtons ? 1 : 2;
for( int i=0; i<iNumSidesUsing; i++ )
{
for( int j=0; j<iNumButtonsUsing; j++ )
GameIout[i*2+j].controller = controller[i];
GameIout[i*2+j].button = button[j];
}
}
+38 -32
View File
@@ -13,13 +13,12 @@
#include "Notes.h"
#include "NoteData.h"
#include "GameInput.h"
#include "GameConstantsAndTypes.h"
#include "MenuInput.h"
#include "GameConstantsAndTypes.h"
const int MAX_STYLES_PER_GAME = 10;
enum SkinElement {
GRAPHIC_NOTE_COLOR_PART,
GRAPHIC_NOTE_GRAY_PART,
@@ -30,6 +29,26 @@ enum SkinElement {
NUM_GAME_BUTTON_GRAPHICS // leave this at the end
};
//
// PrimaryMenuButton and SecondaryMenuButton are used to support using DeviceInputs that only
// navigate the menus.
//
// A button being a primary menu button means that this GameButton will generate a the
// corresponding MenuInput.
// A button being a primary menu button means that this GameButton will generate a the
// corresponding MenuInput IF AND ONLY IF the GameButton corresponding to the pimary input
// is not mapped.
//
// Example 1: A user is using a an arcade DDR machine as their controllre. This machine has
// MenuLeft, MenuStart, and MenuRight buttons on the cabinet, so they should be used to navigate menus.
// The user will map these DeviceInputs to the GameButtons "MenuLeft (optional)", "MenuStart", and
// "MenuRight (optional)".
//
// Example 2: A user is using PlayStation DDR soft pads to play. His controller don't have dedicated
// DeviceInputs for MenuLeft and MenuRight. The user maps Up, Down, Left, and Right as normal.
// Since the Left and Right GameButtons have the flag FLAG_SECONDARY_MENU_*, they will function as
// MenuLeft and MenuRight as long as "MenuLeft (optional)" and "MenuRight (optional)" are not mapped.
//
class StyleDef;
@@ -38,22 +57,26 @@ class GameDef
public:
char m_szName[60];
char m_szDescription[60];
int m_iNumInstruments;
int m_iButtonsPerInstrument;
char m_szButtonNames[60][MAX_GAME_BUTTONS]; // e.g. "left", "right", "middle C", "snare"
int m_iNumControllers;
int m_iButtonsPerController;
char m_szButtonNames[MAX_GAME_BUTTONS][60]; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare"
char m_szButtonDescriptions[MAX_GAME_BUTTONS][60]; // just a longer name shown in the mapping screen
GameButton m_DedicatedMenuButton[NUM_MENU_BUTTONS];
GameButton m_SecondaryMenuButton[NUM_MENU_BUTTONS];
int m_iDefaultKeyboardKey[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // default keyboard keys only have an effect the current game is this game
// int ButtonNameToIndex( const CString &sButtonName )
// {
// for( int i=0; i<m_iButtonsPerInstrument; i++ )
// if( m_sButtonNames[i] == sButtonName )
// return i;
// return -1;
// }
GameButton ButtonNameToIndex( const CString &sButtonName )
{
for( int i=0; i<m_iButtonsPerController; i++ )
if( stricmp(m_szButtonNames[i], sButtonName) == 0 )
return i;
return GAME_BUTTON_INVALID;
}
int m_iMenuButtons[NUM_MENU_BUTTONS]; // map from MenuButton to m_sButtonNames
MenuInput GameInputToMenuInput( GameInput GameI );
void MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] );
// skin stuff
// note skin stuff
void GetSkinNames( CStringArray &asSkinNames );
bool HasASkinNamed( CString sSkin );
void AssertSkinsAreComplete();
@@ -62,21 +85,4 @@ public:
CString GetPathToGraphic( const CString sSkinName, const CString sButtonName, const SkinElement gbg );
void GetTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &arrayTweenColors );
CString ElementToGraphicSuffix( const SkinElement gbg );
inline MenuInput GameInputToMenuInput( const GameInput GameI )
{
PlayerNumber p = (PlayerNumber)GameI.controller;
for( int b=0; b<NUM_MENU_BUTTONS; b++ )
{
if( m_iMenuButtons[b] == GameI.button )
return MenuInput( p, (MenuButton)b );
}
return MenuInput( PLAYER_INVALID, MENU_BUTTON_INVALID );
};
inline GameInput MenuInputToGameInput( const MenuInput MenuI )
{
return GameInput( (GameController)MenuI.player, (GameButton)m_iMenuButtons[MenuI.button] );
};
};
+1 -1
View File
@@ -26,7 +26,7 @@ bool GameInput::fromString( CString s )
split( s, "-", a);
if( a.GetSize() != 2 ) {
MakeBlank();
MakeInvalid();
return false;
}
+63 -29
View File
@@ -11,49 +11,83 @@
*/
enum GameController
{
GAME_CONTROLLER_1 = 0,
GAME_CONTROLLER_2,
GAME_CONTROLLER_1 = 0, // left controller
GAME_CONTROLLER_2, // right controller
MAX_GAME_CONTROLLERS, // leave this at the end
GAME_CONTROLLER_NONE,
GAME_CONTROLLER_INVALID,
};
enum GameButton
typedef int GameButton;
enum // DanceButtons
{
GAME_BUTTON_1 = 0,
GAME_BUTTON_2,
GAME_BUTTON_3,
GAME_BUTTON_4,
GAME_BUTTON_5,
GAME_BUTTON_6,
GAME_BUTTON_7,
GAME_BUTTON_8,
GAME_BUTTON_9,
GAME_BUTTON_10,
GAME_BUTTON_11,
GAME_BUTTON_12,
GAME_BUTTON_13,
GAME_BUTTON_14,
GAME_BUTTON_15,
GAME_BUTTON_16,
MAX_GAME_BUTTONS, // leave this at the end
GAME_BUTTON_NONE
DANCE_BUTTON_LEFT,
DANCE_BUTTON_RIGHT,
DANCE_BUTTON_UP,
DANCE_BUTTON_DOWN,
DANCE_BUTTON_UPLEFT,
DANCE_BUTTON_UPRIGHT,
DANCE_BUTTON_START,
DANCE_BUTTON_BACK,
DANCE_BUTTON_MENULEFT,
DANCE_BUTTON_MENURIGHT,
DANCE_BUTTON_MENUUP,
DANCE_BUTTON_MENUDOWN,
NUM_DANCE_BUTTONS, // leave this at the end
};
enum // PumpButtons
{
PUMP_BUTTON_UPLEFT,
PUMP_BUTTON_UPRIGHT,
PUMP_BUTTON_CENTER,
PUMP_BUTTON_DOWNLEFT,
PUMP_BUTTON_DOWNRIGHT,
PUMP_BUTTON_START,
PUMP_BUTTON_BACK,
PUMP_BUTTON_MENULEFT,
PUMP_BUTTON_MENURIGHT,
PUMP_BUTTON_MENUUP,
PUMP_BUTTON_MENUDOWN,
NUM_PUMP_BUTTONS, // leave this at the end
};
enum // EZ2Buttons
{
EZ2_BUTTON_FOOTUPLEFT,
EZ2_BUTTON_FOOTUPRIGHT,
EZ2_BUTTON_FOOTDOWN,
EZ2_BUTTON_HANDUPLEFT,
EZ2_BUTTON_HANDUPRIGHT,
EZ2_BUTTON_HANDLRLEFT,
EZ2_BUTTON_HANDLRRIGHT,
EZ2_BUTTON_START,
EZ2_BUTTON_BACK,
EZ2_BUTTON_MENULEFT,
EZ2_BUTTON_MENURIGHT,
EZ2_BUTTON_MENUUP,
EZ2_BUTTON_MENUDOWN,
NUM_EZ2_BUTTONS, // leave this at the end
};
const GameButton MAX_GAME_BUTTONS = 14;
const GameButton GAME_BUTTON_INVALID = MAX_GAME_BUTTONS+1;
struct GameInput
{
GameInput() { MakeBlank(); };
GameInput() { MakeInvalid(); };
GameInput( GameController c, GameButton b ) { controller = c; button = b; };
GameController controller; //
GameButton button; // instrument button
GameController controller;
GameButton button;
bool operator==( const GameInput &other ) { return controller == other.controller && button == other.button; };
inline bool IsBlank() const { return controller == GAME_CONTROLLER_NONE; };
inline bool IsValid() const { return !IsBlank(); };
inline void MakeBlank() { controller = GAME_CONTROLLER_NONE; button = GAME_BUTTON_NONE; };
inline bool IsValid() const { return controller != GAME_CONTROLLER_INVALID; };
inline void MakeInvalid() { controller = GAME_CONTROLLER_INVALID; button = GAME_BUTTON_INVALID; };
CString toString();
bool fromString( CString s );
+303 -156
View File
@@ -14,51 +14,30 @@
#include "PrefsManager.h"
#include "GameConstantsAndTypes.h"
#include "GameState.h"
#include "GameInput.h" // for GameButton constants
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h> // for DIK_* key codes
GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program
GameButton DANCE_BUTTON_LEFT = (GameButton)0;
GameButton DANCE_BUTTON_RIGHT = (GameButton)1;
GameButton DANCE_BUTTON_UP = (GameButton)2;
GameButton DANCE_BUTTON_DOWN = (GameButton)3;
GameButton DANCE_BUTTON_UPLEFT = (GameButton)4;
GameButton DANCE_BUTTON_UPRIGHT = (GameButton)5;
GameButton DANCE_BUTTON_SELECT = (GameButton)6;
GameButton DANCE_BUTTON_START = (GameButton)7;
int NUM_DANCE_BUTTONS = 8;
GameButton PUMP_BUTTON_UPLEFT = (GameButton)0;
GameButton PUMP_BUTTON_UPRIGHT = (GameButton)1;
GameButton PUMP_BUTTON_CENTER = (GameButton)2;
GameButton PUMP_BUTTON_DOWNLEFT = (GameButton)3;
GameButton PUMP_BUTTON_DOWNRIGHT = (GameButton)4;
GameButton PUMP_BUTTON_SELECT = (GameButton)5;
int NUM_PUMP_BUTTONS = 6;
GameButton EZ2_BUTTON_UPLEFT = (GameButton)0;
GameButton EZ2_BUTTON_UPLEFTHAND = (GameButton)1;
GameButton EZ2_BUTTON_LRLEFTHAND = (GameButton)2;
GameButton EZ2_BUTTON_DOWN = (GameButton)3;
GameButton EZ2_BUTTON_LRRIGHTHAND = (GameButton)4;
GameButton EZ2_BUTTON_UPRIGHTHAND = (GameButton)5;
GameButton EZ2_BUTTON_UPRIGHT = (GameButton)6;
GameButton EZ2_BUTTON_SELECT = (GameButton)7;
int NUM_EZ2_BUTTONS = 8;
const int DANCE_COL_SPACING = 64;
const int DANCE_6PANEL_VERSUS_COL_SPACING = 54;
const int PUMP_COL_SPACING = 60;
const int EZ2_COL_SPACING = 20; // CHANGE THIS LATER (Actually don't know colspaces yet)
const int PUMP_COL_SPACING = 50;
const int EZ2_COL_SPACING = 50;
//
// Important: Every game must define the buttons: "Start", "Back", "MenuLeft", and "MenuRight"
//
GameDef g_GameDefs[NUM_GAMES] =
{
{ // GAME_DANCE
"dance", // m_szName
"Dance Dance Revolution", // m_szDescription
2, // m_iNumInstruments
NUM_DANCE_BUTTONS, // m_iButtonsPerInstrument
2, // m_iNumControllers
NUM_DANCE_BUTTONS, // m_iButtonsPerController
{ // m_szButtonNames
"Left",
"Right",
@@ -66,62 +45,232 @@ GameDef g_GameDefs[NUM_GAMES] =
"Down",
"UpLeft",
"UpRight",
"Start",
"Back",
"Start"
"MenuLeft",
"MenuRight",
"MenuUp",
"MenuDown",
},
{ // m_iMenuButtons[NUM_MENU_BUTTONS]; // map from MenuButton to m_szButtonNames
{ // m_szButtonDescriptions
"Left (MenuLeft)",
"Right (MenuRight)",
"Up (MenuUp)",
"Down (MenuDown)",
"UpLeft",
"UpRight",
"Start",
"Back",
"MenuLeft (dedicated)",
"MenuRight (dedicated)",
"MenuUp (dedicated)",
"MenuDown (dedicated)",
},
{ // m_DedicatedMenuButton
DANCE_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
DANCE_BUTTON_MENURIGHT, // MENU_BUTTON_RIGHT
DANCE_BUTTON_MENUUP, // MENU_BUTTON_UP
DANCE_BUTTON_MENUDOWN, // MENU_BUTTON_DOWN
DANCE_BUTTON_START, // MENU_BUTTON_START
DANCE_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_SecondaryMenuButton
DANCE_BUTTON_LEFT, // MENU_BUTTON_LEFT
DANCE_BUTTON_RIGHT, // MENU_BUTTON_RIGHT
DANCE_BUTTON_UP, // MENU_BUTTON_UP
DANCE_BUTTON_DOWN, // MENU_BUTTON_DOWN
DANCE_BUTTON_START, // MENU_BUTTON_START
DANCE_BUTTON_SELECT, // MENU_BUTTON_BACK
DANCE_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_iDefaultKeyboardKey
{ // PLAYER_1
DIK_LEFT, // DANCE_BUTTON_LEFT,
DIK_RIGHT, // DANCE_BUTTON_RIGHT,
DIK_UP, // DANCE_BUTTON_UP,
DIK_DOWN, // DANCE_BUTTON_DOWN,
-1, //no default key // DANCE_BUTTON_UPLEFT,
-1, //no default key // DANCE_BUTTON_UPRIGHT,
DIK_RETURN, // DANCE_BUTTON_START,
DIK_ESCAPE, // DANCE_BUTTON_BACK
-1, //no default key // DANCE_BUTTON_MENULEFT
-1, //no default key // DANCE_BUTTON_MENURIGHT
DIK_UP, // DANCE_BUTTON_MENUUP
DIK_DOWN, // DANCE_BUTTON_MENUDOWN
},
{ // PLAYER_2
DIK_NUMPAD4, // DANCE_BUTTON_LEFT,
DIK_NUMPAD6, // DANCE_BUTTON_RIGHT,
DIK_NUMPAD8, // DANCE_BUTTON_UP,
DIK_NUMPAD2, // DANCE_BUTTON_DOWN,
DIK_NUMPAD7, // DANCE_BUTTON_UPLEFT,
DIK_NUMPAD9, // DANCE_BUTTON_UPRIGHT,
DIK_NUMPADENTER, // DANCE_BUTTON_START,
DIK_NUMPAD0, // DANCE_BUTTON_BACK
-1, //no default key // DANCE_BUTTON_MENULEFT
-1, //no default key // DANCE_BUTTON_MENURIGHT
-1, //no default key // DANCE_BUTTON_MENUUP
-1, //no default key // DANCE_BUTTON_MENUDOWN
},
}
},
{ // GAME_PUMP
"pump", // m_szName
"Pump It Up", // m_szDescription
2, // m_iNumInstruments
NUM_DANCE_BUTTONS, // m_iButtonsPerInstrument //? DANCE buttons (from Andy)
2, // m_iNumControllers
NUM_PUMP_BUTTONS, // m_iButtonsPerController
{ // m_szButtonNames
"UpLeft",
"UpRight",
"Center",
"DownLeft",
"DownRight",
"Back"
"Start",
"Back",
"MenuLeft",
"MenuRight",
"MenuUp",
"MenuDown",
},
{ // m_iMenuButtons[NUM_MENU_BUTTONS]; // map from MenuButton to m_szButtonNames
{ // m_szButtonDescriptions
"UpLeft (MenuLeft)",
"UpRight (MenuRight)",
"Center (Start)",
"DownLeft (MenuUp)",
"DownRight (MenuDown)",
"Start (dedicated)",
"Back",
"MenuLeft (dedicated)",
"MenuRight (dedicated)",
"MenuUp (dedicated)",
"MenuDown (dedicated)",
},
{ // m_DedicatedMenuButton
PUMP_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
PUMP_BUTTON_MENURIGHT, // MENU_BUTTON_RIGHT
PUMP_BUTTON_MENUUP, // MENU_BUTTON_UP
PUMP_BUTTON_MENUDOWN, // MENU_BUTTON_DOWN
PUMP_BUTTON_START, // MENU_BUTTON_START
PUMP_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_SecondaryMenuButton
PUMP_BUTTON_UPLEFT, // MENU_BUTTON_LEFT
PUMP_BUTTON_UPRIGHT, // MENU_BUTTON_RIGHT
PUMP_BUTTON_DOWNRIGHT, // MENU_BUTTON_UP
PUMP_BUTTON_DOWNLEFT, // MENU_BUTTON_DOWN
PUMP_BUTTON_DOWNLEFT, // MENU_BUTTON_UP
PUMP_BUTTON_DOWNRIGHT, // MENU_BUTTON_DOWN
PUMP_BUTTON_CENTER, // MENU_BUTTON_START
PUMP_BUTTON_SELECT, // MENU_BUTTON_BACK
PUMP_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_iDefaultKeyboardKey
{ // PLAYER_1
DIK_Q, // PUMP_BUTTON_UPLEFT,
DIK_E, // PUMP_BUTTON_UPRIGHT,
DIK_S, // PUMP_BUTTON_CENTER,
DIK_Z, // PUMP_BUTTON_DOWNLEFT,
DIK_C, // PUMP_BUTTON_DOWNRIGHT,
DIK_RETURN, // PUMP_BUTTON_START,
DIK_ESCAPE, // PUMP_BUTTON_BACK,
DIK_LEFT, // PUMP_BUTTON_MENULEFT
DIK_RIGHT, // PUMP_BUTTON_MENURIGHT
DIK_UP, // PUMP_BUTTON_MENUUP
DIK_DOWN, // PUMP_BUTTON_MENUDOWN
},
{ // PLAYER_2
DIK_NUMPAD7, // PUMP_BUTTON_UPLEFT,
DIK_NUMPAD9, // PUMP_BUTTON_UPRIGHT,
DIK_NUMPAD5, // PUMP_BUTTON_CENTER,
DIK_NUMPAD1, // PUMP_BUTTON_DOWNLEFT,
DIK_NUMPAD3, // PUMP_BUTTON_DOWNRIGHT,
DIK_NUMPADENTER, // PUMP_BUTTON_START,
DIK_NUMPAD0, // PUMP_BUTTON_BACK,
-1, //no default key // PUMP_BUTTON_MENULEFT
-1, //no default key // PUMP_BUTTON_MENURIGHT
-1, //no default key // PUMP_BUTTON_MENUUP
-1, //no default key // PUMP_BUTTON_MENUDOWN
},
}
},
{ // GAME_EZ2 ********* TEMPORARY DDR BORROWAGE FOR MENUS (The Input System needs WORK!) ********
{
"ez2", // m_szName
"Ez2dancer", // m_szDescription
2, // m_iNumInstruments
NUM_DANCE_BUTTONS, // m_iButtonsPerInstrument // If it works, i'll go with it, but i'm a bit unsure here...
2, // m_iNumControllers
NUM_EZ2_BUTTONS, // m_iButtonsPerController
{ // m_szButtonNames
"UpLeft",
"UpLeftHand",
"LrLeftHand",
"Down",
"LrRightHand",
"UpRightHand",
"UpRight",
"Start"
"FootUpLeft",
"FootUpRight",
"FootDown",
"HandUpLeft",
"HandUpRight",
"HandLrLeft",
"HandLrRight",
"Start",
"Back",
"MenuLeft",
"MenuRight",
"MenuUp",
"MenuDown",
},
{ // m_iMenuButtons[NUM_MENU_BUTTONS]; // map from MenuButton to m_szButtonNames
DANCE_BUTTON_LEFT, // MENU_BUTTON_LEFT
DANCE_BUTTON_RIGHT, // MENU_BUTTON_RIGHT
DANCE_BUTTON_UP, // MENU_BUTTON_UP
DANCE_BUTTON_DOWN, // MENU_BUTTON_DOWN
DANCE_BUTTON_START, // MENU_BUTTON_START
DANCE_BUTTON_SELECT, // MENU_BUTTON_BACK
{ // m_szButtonDescriptions
"FootUpLeft (MenuUp)",
"FootUpRight (MenuDown)",
"FootDown (Start)",
"HandUpLeft (MenuLeft)",
"HandUpRight (MenuRight)",
"HandLrLeft",
"HandLrRight",
"Start (dedicated)",
"Back",
"MenuLeft (dedicated)",
"MenuRight (dedicated)",
"MenuUp (dedicated)",
"MenuDown (dedicated)",
},
{ // m_DedicatedMenuButton
EZ2_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
EZ2_BUTTON_MENURIGHT, // MENU_BUTTON_RIGHT
EZ2_BUTTON_MENUUP, // MENU_BUTTON_UP
EZ2_BUTTON_MENUDOWN, // MENU_BUTTON_DOWN
EZ2_BUTTON_START, // MENU_BUTTON_START
EZ2_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_SecondaryMenuButton
EZ2_BUTTON_HANDUPLEFT, // MENU_BUTTON_LEFT
EZ2_BUTTON_HANDUPRIGHT, // MENU_BUTTON_RIGHT
EZ2_BUTTON_FOOTUPLEFT, // MENU_BUTTON_UP
EZ2_BUTTON_FOOTUPRIGHT, // MENU_BUTTON_DOWN
EZ2_BUTTON_FOOTDOWN, // MENU_BUTTON_START
EZ2_BUTTON_BACK, // MENU_BUTTON_BACK
},
{ // m_iDefaultKeyboardKey
{ // PLAYER_1
DIK_Z, // EZ2_BUTTON_FOOTUPLEFT,
DIK_C, // EZ2_BUTTON_FOOTUPRIGHT,
DIK_X, // EZ2_BUTTON_FOOTDOWN,
DIK_Q, // EZ2_BUTTON_HANDUPLEFT,
DIK_A, // EZ2_BUTTON_HANDUPRIGHT,
DIK_E, // EZ2_BUTTON_HANDLRLEFT,
DIK_D, // EZ2_BUTTON_HANDLRRIGHT,
DIK_RETURN, // EZ2_BUTTON_START,
DIK_ESCAPE, // EZ2_BUTTON_BACK,
DIK_LEFT, // EZ2_BUTTON_MENULEFT
DIK_RIGHT, // EZ2_BUTTON_MENURIGHT
DIK_UP, // EZ2_BUTTON_MENUUP
DIK_DOWN, // EZ2_BUTTON_MENUDOWN
},
{ // PLAYER_2
DIK_NUMPAD1, // EZ2_BUTTON_FOOTUPLEFT,
DIK_NUMPAD3, // EZ2_BUTTON_FOOTUPRIGHT,
DIK_NUMPAD2, // EZ2_BUTTON_FOOTDOWN,
DIK_NUMPAD7, // EZ2_BUTTON_HANDUPLEFT,
DIK_NUMPAD9, // EZ2_BUTTON_HANDUPRIGHT,
DIK_NUMPAD4, // EZ2_BUTTON_HANDLRLEFT,
DIK_NUMPAD6, // EZ2_BUTTON_HANDLRRIGHT,
DIK_NUMPADENTER, // EZ2_BUTTON_START,
DIK_NUMPAD0, // EZ2_BUTTON_BACK,
-1, //no default key // EZ2_BUTTON_MENULEFT
-1, //no default key // EZ2_BUTTON_MENURIGHT
-1, //no default key // EZ2_BUTTON_MENUUP
-1, //no default key // EZ2_BUTTON_MENUDOWN
},
},
},
@@ -387,23 +536,22 @@ StyleDef g_StyleDefs[NUM_STYLES] =
5, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*1.0f }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*0.5f }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*0.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*1.0f },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*2 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
2,0,4,1,3 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
// 0,1,2,3,4
},
},
{ // EZ2_STYLE_SINGLE_HARD
@@ -414,23 +562,22 @@ StyleDef g_StyleDefs[NUM_STYLES] =
5, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*1.0f }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*0.5f }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*0.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*1.0f },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
2,0,4,1,3 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
// 0,1,2,3,4
},
},
{ // EZ2_STYLE_DOUBLE
@@ -441,32 +588,32 @@ StyleDef g_StyleDefs[NUM_STYLES] =
10, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*4.5f }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*3.5f }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, -EZ2_COL_SPACING*2.5f },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, -EZ2_COL_SPACING*1.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, -EZ2_COL_SPACING*0.5f },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, +EZ2_COL_SPACING*0.5f },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, +EZ2_COL_SPACING*1.5f },
{ TRACK_8, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*2.5f },
{ TRACK_9, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*3.5f },
{ TRACK_10, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*4.5f },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*4.5f },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*3.5f },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, -EZ2_COL_SPACING*2.5f },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, -EZ2_COL_SPACING*1.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, -EZ2_COL_SPACING*0.5f },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, +EZ2_COL_SPACING*0.5f },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, +EZ2_COL_SPACING*1.5f },
{ TRACK_8, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*2.5f },
{ TRACK_9, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*3.5f },
{ TRACK_10, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*4.5f },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*4.5f }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*3.5f }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, -EZ2_COL_SPACING*2.5f },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, -EZ2_COL_SPACING*1.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, -EZ2_COL_SPACING*0.5f },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, +EZ2_COL_SPACING*0.5f },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, +EZ2_COL_SPACING*1.5f },
{ TRACK_8, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*2.5f },
{ TRACK_9, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*3.5f },
{ TRACK_10, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*4.5f },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*4.5f },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*3.5f },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, -EZ2_COL_SPACING*2.5f },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, -EZ2_COL_SPACING*1.5f },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, -EZ2_COL_SPACING*0.5f },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, +EZ2_COL_SPACING*0.5f },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, +EZ2_COL_SPACING*1.5f },
{ TRACK_8, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*2.5f },
{ TRACK_9, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*3.5f },
{ TRACK_10, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*4.5f },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
2,0,4,1,3 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
2,0,4,1,3,7,5,9,6,8 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
},
},
{ // EZ2_STYLE_REAL
@@ -477,22 +624,22 @@ StyleDef g_StyleDefs[NUM_STYLES] =
7, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*3 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_LRLEFTHAND, -EZ2_COL_SPACING*2 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_1, EZ2_BUTTON_LRRIGHTHAND, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*3 },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*3 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDLRLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_1, EZ2_BUTTON_HANDLRRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*3 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*3 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_LRLEFTHAND, -EZ2_COL_SPACING*2 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_LRRIGHTHAND, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*3 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*3 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDLRLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_HANDLRRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*3 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
@@ -500,25 +647,25 @@ StyleDef g_StyleDefs[NUM_STYLES] =
},
},
{ // EZ2_STYLE_SINGLE_VERSUS
"ez2-single-versus", // m_szName
"ez2-single-versus", // m_szName
NOTES_TYPE_EZ2_SINGLE, // m_NotesType
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
{ 160, 480 }, // m_iCenterX
5, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
@@ -526,25 +673,25 @@ StyleDef g_StyleDefs[NUM_STYLES] =
},
},
{ // EZ2_STYLE_SINGLE_VERSUS
"ez2-single-hard-versus", // m_szName
NOTES_TYPE_EZ2_SINGLE_HARD, // m_NotesType
"ez2-single-hard-versus", // m_szName
NOTES_TYPE_EZ2_SINGLE_HARD, // m_NotesType
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
{ 160, 480 }, // m_iCenterX
5, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*2 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*2 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
@@ -553,29 +700,29 @@ StyleDef g_StyleDefs[NUM_STYLES] =
},
{ // EZ2_STYLE_REAL_VERSUS
"ez2-real-versus", // m_szName
"ez2-real-versus", // m_szName
NOTES_TYPE_EZ2_REAL, // m_NotesType
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
{ 160, 480 }, // m_iCenterX
7, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*3 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_LRLEFTHAND, -EZ2_COL_SPACING*2 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_1, EZ2_BUTTON_LRRIGHTHAND, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_1, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*3 },
{ TRACK_1, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*3 },
{ TRACK_2, GAME_CONTROLLER_1, EZ2_BUTTON_HANDLRLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_3, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_1, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_1, EZ2_BUTTON_HANDLRRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_1, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*3 },
},
{ // PLAYER_2
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFT, -EZ2_COL_SPACING*3 }, // CHANGE THESE WHEN WE CAN SEE THE
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_LRLEFTHAND, -EZ2_COL_SPACING*2 }, // NOTES IN-GAME !!!!!!!!!!
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_UPLEFTHAND, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_DOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHTHAND, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_LRRIGHTHAND, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_UPRIGHT, +EZ2_COL_SPACING*3 },
{ TRACK_1, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPLEFT, -EZ2_COL_SPACING*3 },
{ TRACK_2, GAME_CONTROLLER_2, EZ2_BUTTON_HANDLRLEFT, -EZ2_COL_SPACING*2 },
{ TRACK_3, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPLEFT, -EZ2_COL_SPACING*1 },
{ TRACK_4, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTDOWN, +EZ2_COL_SPACING*0 },
{ TRACK_5, GAME_CONTROLLER_2, EZ2_BUTTON_HANDUPRIGHT, +EZ2_COL_SPACING*1 },
{ TRACK_6, GAME_CONTROLLER_2, EZ2_BUTTON_HANDLRRIGHT, +EZ2_COL_SPACING*2 },
{ TRACK_7, GAME_CONTROLLER_2, EZ2_BUTTON_FOOTUPRIGHT, +EZ2_COL_SPACING*3 },
},
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
+1 -1
View File
@@ -46,7 +46,7 @@ void HoldJudgement::DrawPrimitives()
void HoldJudgement::SetHoldJudgement( HoldNoteScore hns )
{
//LOG->WriteLine( "Judgement::SetJudgement()" );
//LOG->Trace( "Judgement::SetJudgement()" );
switch( hns )
{
+1 -1
View File
@@ -233,7 +233,7 @@ bool IniFile::SetValueI(CString keyname, CString valuename, int value, bool crea
bool IniFile::SetValueF(CString keyname, CString valuename, float value, bool create)
{
CString temp;
temp.Format("%e",value);
temp.Format("%f",value);
return SetValue(keyname, valuename, temp, create);
}
+1 -1
View File
@@ -84,4 +84,4 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
}
}
}
}
}
+1
View File
@@ -55,3 +55,4 @@ public:
extern InputFilter* INPUTFILTER; // global and accessable from anywhere in our program
+91 -89
View File
@@ -14,6 +14,7 @@
#include "IniFile.h"
#include "GameManager.h"
#include "GameState.h"
#include "RageLog.h"
InputMapper* INPUTMAPPER = NULL; // global and accessable from anywhere in our program
@@ -26,45 +27,81 @@ InputMapper::InputMapper()
InputMapper::~InputMapper()
{
// don't worry about releasing the Song array. Let the OS do it :-)
SaveMappingsToDisk();
}
void InputMapper::ClearAllMappings()
{
for( int i=0; i<MAX_GAME_CONTROLLERS; i++ )
for( int j=0; j<MAX_GAME_BUTTONS; j++ )
for( int k=0; k<NUM_GAME_TO_DEVICE_SLOTS; k++ )
m_GItoDI[i][j][k].MakeInvalid();
}
void InputMapper::ClearDefaultMappings()
{
// default mappings are in the third slot
for( int i=0; i<MAX_GAME_CONTROLLERS; i++ )
for( int j=0; j<MAX_GAME_BUTTONS; j++ )
m_GItoDI[i][j][2].MakeInvalid();
}
void InputMapper::AddDefaultMappingsForCurrentGame()
{
GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
for( int c=0; c<MAX_GAME_CONTROLLERS; c++ )
{
for( int b=0; b<pGameDef->m_iButtonsPerController; b++ )
{
int key = pGameDef->m_iDefaultKeyboardKey[c][b];
DeviceInput DeviceI( DEVICE_KEYBOARD, key );
GameInput GameI( (GameController)c, (GameButton)b );
if( key != -1 && !IsMapped(DeviceI) )
SetInputMap( DeviceI, GameI, 2 );
}
}
}
void InputMapper::ReadMappingsFromDisk()
{
ASSERT( GAMEMAN != NULL );
ClearAllMappings();
CString sPath = GAMESTATE->GetCurrentGameDef()->m_szName + CString("Map.ini");
IniFile ini;
ini.SetPath( GAMESTATE->GetCurrentGameDef()->m_szName + CString("Map.ini") );
ini.SetPath( sPath );
if( !ini.ReadFile() ) {
return; // load nothing
//throw RageException( "could not read config file" );
LOG->Warn( "could not input mapping file '%s'.", sPath );
}
IniFile::key* pKey = ini.GetKey( "Input" );
if( pKey == NULL )
return;
for( int i=0; i<pKey->names.GetSize(); i++ )
if( pKey != NULL )
{
CString name = pKey->names[i];
CString value = pKey->values[i];
GameInput GameI;
GameI.fromString( name );
CStringArray sDeviceInputStrings;
split( value, ",", sDeviceInputStrings, false );
for( int i=0; i<sDeviceInputStrings.GetSize() && i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
for( int i=0; i<pKey->names.GetSize(); i++ )
{
DeviceInput DeviceI;
DeviceI.fromString( sDeviceInputStrings[i] );
if( !DeviceI.IsBlank() )
SetInputMap( DeviceI, GameI, i );
CString name = pKey->names[i];
CString value = pKey->values[i];
GameInput GameI;
GameI.fromString( name );
CStringArray sDeviceInputStrings;
split( value, ",", sDeviceInputStrings, false );
for( int i=0; i<sDeviceInputStrings.GetSize() && i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
{
DeviceInput DeviceI;
DeviceI.fromString( sDeviceInputStrings[i] );
if( DeviceI.IsValid() )
SetInputMap( DeviceI, GameI, i );
}
}
}
ClearDefaultMappings();
AddDefaultMappingsForCurrentGame();
}
@@ -95,11 +132,7 @@ void InputMapper::SaveMappingsToDisk()
}
///////////////////////////////////////
// Input mapping stuff
///////////////////////////////////////
void InputMapper::SetInputMap( DeviceInput DeviceI, GameInput GameI, int iSlotIndex, bool bOverrideHardCoded )
void InputMapper::SetInputMap( DeviceInput DeviceI, GameInput GameI, int iSlotIndex )
{
// remove the old input
ClearFromInputMap( DeviceI );
@@ -122,7 +155,7 @@ void InputMapper::ClearFromInputMap( DeviceInput DeviceI )
for( int s=0; s<NUM_GAME_TO_DEVICE_SLOTS; s++ )
{
if( m_GItoDI[p][b][s] == DeviceI )
m_GItoDI[p][b][s].MakeBlank();
m_GItoDI[p][b][s].MakeInvalid();
}
}
}
@@ -132,14 +165,29 @@ void InputMapper::ClearFromInputMap( DeviceInput DeviceI )
void InputMapper::ClearFromInputMap( GameInput GameI, int iSlotIndex )
{
if( GameI.IsBlank() )
if( !GameI.IsValid() )
return;
m_GItoDI[GameI.controller][GameI.button][iSlotIndex].MakeBlank();
m_GItoDI[GameI.controller][GameI.button][iSlotIndex].MakeInvalid();
UpdateTempDItoGI();
}
bool InputMapper::IsMapped( DeviceInput DeviceI )
{
return m_tempDItoGI[DeviceI.device][DeviceI.button].IsValid();
}
bool InputMapper::IsMapped( GameInput GameI )
{
for( int i=0; i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
if( m_GItoDI[GameI.controller][GameI.button][i].IsValid() )
return true;
return false;
}
void InputMapper::UpdateTempDItoGI()
{
// clear out m_tempDItoGI
@@ -147,7 +195,7 @@ void InputMapper::UpdateTempDItoGI()
{
for( int b=0; b<NUM_DEVICE_BUTTONS; b++ )
{
m_tempDItoGI[d][b].MakeBlank();
m_tempDItoGI[d][b].MakeInvalid();
}
}
@@ -162,10 +210,8 @@ void InputMapper::UpdateTempDItoGI()
GameInput GameI( (GameController)n, (GameButton)b );
DeviceInput DeviceI = m_GItoDI[n][b][s];
if( DeviceI.IsBlank() )
continue;
m_tempDItoGI[DeviceI.device][DeviceI.button] = GameI;
if( DeviceI.IsValid() )
m_tempDItoGI[DeviceI.device][DeviceI.button] = GameI;
}
}
}
@@ -183,58 +229,11 @@ bool InputMapper::GameToDevice( GameInput GameI, int iSoltNum, DeviceInput& Devi
return DeviceI.device != DEVICE_NONE;
}
struct HardCodedMenuKey
{
InputDevice device;
int device_button;
PlayerNumber player_no;
MenuButton menu_button;
};
const HardCodedMenuKey g_HardCodedMenuKeys[] =
{
{ DEVICE_KEYBOARD, DIK_UP, PLAYER_1, MENU_BUTTON_UP },
{ DEVICE_KEYBOARD, DIK_DOWN, PLAYER_1, MENU_BUTTON_DOWN },
{ DEVICE_KEYBOARD, DIK_LEFT, PLAYER_1, MENU_BUTTON_LEFT },
{ DEVICE_KEYBOARD, DIK_RIGHT, PLAYER_1, MENU_BUTTON_RIGHT },
{ DEVICE_KEYBOARD, DIK_RETURN, PLAYER_1, MENU_BUTTON_START },
{ DEVICE_KEYBOARD, DIK_ESCAPE, PLAYER_1, MENU_BUTTON_BACK },
};
const int NUM_HARD_CODED_MENU_KEYS = sizeof(g_HardCodedMenuKeys) / sizeof(HardCodedMenuKey);
MenuInput InputMapper::DeviceToMenu( DeviceInput DeviceI )
{
for( int i=0; i<NUM_HARD_CODED_MENU_KEYS; i++ )
{
if( g_HardCodedMenuKeys[i].device == DeviceI.device &&
g_HardCodedMenuKeys[i].device_button == DeviceI.button )
{
return MenuInput( g_HardCodedMenuKeys[i].player_no, g_HardCodedMenuKeys[i].menu_button );
}
}
return MenuInput( PLAYER_INVALID, MENU_BUTTON_INVALID );
}
DeviceInput InputMapper::MenuToDevice( MenuInput MenuI )
{
for( int i=0; i<NUM_HARD_CODED_MENU_KEYS; i++ )
{
if( g_HardCodedMenuKeys[i].player_no == MenuI.player &&
g_HardCodedMenuKeys[i].menu_button == MenuI.button )
{
return DeviceInput( g_HardCodedMenuKeys[i].device, g_HardCodedMenuKeys[i].device_button );
}
}
return DeviceInput( DEVICE_NONE, -1 );
}
void InputMapper::GameToStyle( GameInput GameI, StyleInput &StyleI )
{
if( GAMESTATE->m_CurStyle == STYLE_NONE )
{
StyleI.MakeBlank();
StyleI.MakeInvalid();
return;
}
@@ -254,12 +253,14 @@ void InputMapper::StyleToGame( StyleInput StyleI, GameInput &GameI )
GameI = pStyleDef->StyleInputToGameInput( StyleI );
}
void InputMapper::MenuToGame( MenuInput MenuI, GameInput &GameI )
void InputMapper::MenuToGame( MenuInput MenuI, GameInput GameIout[4] )
{
GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
GameI = pGameDef->MenuInputToGameInput( MenuI );
pGameDef->MenuInputToGameInput( MenuI, GameIout );
}
bool InputMapper::IsButtonDown( GameInput GameI )
{
for( int i=0; i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
@@ -278,9 +279,13 @@ bool InputMapper::IsButtonDown( GameInput GameI )
bool InputMapper::IsButtonDown( MenuInput MenuI )
{
GameInput GameI;
GameInput GameI[4];
MenuToGame( MenuI, GameI );
return IsButtonDown( GameI );
for( int i=0; i<4; i++ )
if( GameI[i].IsValid() && IsButtonDown(GameI[i]) )
return true;
return false;
}
@@ -290,6 +295,3 @@ bool InputMapper::IsButtonDown( StyleInput StyleI )
StyleToGame( StyleI, GameI );
return IsButtonDown( GameI );
}
+10 -6
View File
@@ -32,23 +32,26 @@ public:
void ReadMappingsFromDisk();
void SaveMappingsToDisk();
void ClearAllMappings();
void ClearDefaultMappings();
// input mapping stuff
void SetInputMap( DeviceInput DeviceI, GameInput GameI, int iSlotIndex, bool bOverrideHardCoded = false );
void SetInputMap( DeviceInput DeviceI, GameInput GameI, int iSlotIndex );
void ClearFromInputMap( DeviceInput DeviceI );
void ClearFromInputMap( GameInput GameI, int iSlotIndex );
void AddDefaultMappingsForCurrentGame();
bool IsMapped( DeviceInput DeviceI );
bool IsMapped( GameInput GameI );
bool DeviceToGame( DeviceInput DeviceI, GameInput& GameI ); // return true if there is a mapping from device to pad
bool GameToDevice( GameInput GameI, int iSoltNum, DeviceInput& DeviceI ); // return true if there is a mapping from pad to device
MenuInput DeviceToMenu( DeviceInput DeviceI );
DeviceInput MenuToDevice( MenuInput MenuI );
void GameToStyle( GameInput GameI, StyleInput &StyleI );
void StyleToGame( StyleInput StyleI, GameInput &GameI );
void GameToMenu( GameInput GameI, MenuInput &MenuI );
void MenuToGame( MenuInput MenuI, GameInput &GameI );
void MenuToGame( MenuInput MenuI, GameInput GameIout[4] );
bool IsButtonDown( GameInput GameI );
bool IsButtonDown( MenuInput MenuI );
@@ -67,3 +70,4 @@ protected:
extern InputMapper* INPUTMAPPER; // global and accessable from anywhere in our program
+9 -8
View File
@@ -26,14 +26,15 @@ InputQueue::InputQueue()
m_aQueue[p].SetSize( MAX_INPUT_QUEUE_LENGTH );
}
void InputQueue::HandleInput( const PlayerNumber p, const MenuButton b )
void InputQueue::RememberInput( const GameInput GameI )
{
if( m_aQueue[p].GetSize() >= MAX_INPUT_QUEUE_LENGTH ) // full
m_aQueue[p].RemoveAt( 0, m_aQueue[p].GetSize()-MAX_INPUT_QUEUE_LENGTH+1 );
m_aQueue[p].Add( MenuButtonAndTime(b,TIMER->GetTimeSinceStart()) );
int c = GameI.controller;
if( m_aQueue[c].GetSize() >= MAX_INPUT_QUEUE_LENGTH ) // full
m_aQueue[c].RemoveAt( 0, m_aQueue[c].GetSize()-MAX_INPUT_QUEUE_LENGTH+1 );
m_aQueue[c].Add( GameButtonAndTime(GameI.button,TIMER->GetTimeSinceStart()) );
};
bool InputQueue::MatchesPattern( const PlayerNumber p, const MenuButton* button_sequence, const int iNumButtons, float fMaxSecondsBack )
bool InputQueue::MatchesPattern( const GameController c, const GameButton* button_sequence, const int iNumButtons, float fMaxSecondsBack )
{
if( fMaxSecondsBack == -1 )
fMaxSecondsBack = 0.4f + iNumButtons*0.15f;
@@ -41,9 +42,9 @@ bool InputQueue::MatchesPattern( const PlayerNumber p, const MenuButton* button_
float fOldestTimeAllowed = TIMER->GetTimeSinceStart() - fMaxSecondsBack;
int sequence_index = iNumButtons-1; // count down
for( int queue_index=m_aQueue[p].GetSize()-1; queue_index>=0; queue_index-- ) // iterate newest to oldest
for( int queue_index=m_aQueue[c].GetSize()-1; queue_index>=0; queue_index-- ) // iterate newest to oldest
{
MenuButtonAndTime BandT = m_aQueue[p][queue_index];
GameButtonAndTime BandT = m_aQueue[c][queue_index];
if( BandT.button != button_sequence[sequence_index] ||
BandT.fTime < fOldestTimeAllowed )
{
@@ -51,7 +52,7 @@ bool InputQueue::MatchesPattern( const PlayerNumber p, const MenuButton* button_
}
if( sequence_index == 0 ) // we matched the whole pattern
{
m_aQueue[p].RemoveAll(); // empty the queue so we don't match on it again
m_aQueue[c].RemoveAll(); // empty the queue so we don't match on it again
return true;
}
sequence_index--;
+8 -8
View File
@@ -10,8 +10,8 @@
-----------------------------------------------------------------------------
*/
#include "MenuInput.h"
#include "GameConstantsAndTypes.h"
#include "GameInput.h"
const int MAX_INPUT_QUEUE_LENGTH = 8;
@@ -20,19 +20,19 @@ class InputQueue
public:
InputQueue();
void HandleInput( const PlayerNumber p, const MenuButton b );
bool MatchesPattern( const PlayerNumber p, const MenuButton* button_sequence, const int iNumButtons, float fMaxSecondsBack = -1 );
void RememberInput( GameInput );
bool MatchesPattern( const GameController c, const GameButton* button_sequence, const int iNumButtons, float fMaxSecondsBack = -1 );
protected:
struct MenuButtonAndTime
struct GameButtonAndTime
{
MenuButtonAndTime() {}
MenuButtonAndTime( MenuButton b, float t ) { button = b; fTime = t; };
MenuButton button;
GameButtonAndTime() {}
GameButtonAndTime( GameButton b, float t ) { button = b; fTime = t; };
GameButton button;
float fTime;
};
CArray<MenuButtonAndTime,MenuButtonAndTime> m_aQueue[NUM_PLAYERS];
CArray<GameButtonAndTime,GameButtonAndTime> m_aQueue[MAX_GAME_CONTROLLERS];
};
+1 -1
View File
@@ -48,7 +48,7 @@ void Judgement::DrawPrimitives()
void Judgement::SetJudgement( TapNoteScore score )
{
//LOG->WriteLine( "Judgement::SetJudgement()" );
//LOG->Trace( "Judgement::SetJudgement()" );
switch( score )
{
+7 -3
View File
@@ -104,15 +104,19 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
{
case TNS_PERFECT: fDeltaLife = +0; break;
case TNS_GREAT: fDeltaLife = +0; break;
case TNS_GOOD: fDeltaLife = -1; break;
case TNS_BOO: fDeltaLife = -1; break;
case TNS_MISS: fDeltaLife = -1; break;
case TNS_GOOD: fDeltaLife = -100; break;
case TNS_BOO: fDeltaLife = -100; break;
case TNS_MISS: fDeltaLife = -100; break;
}
break;
default:
ASSERT(0);
}
if( fDeltaLife > 0 )
fDeltaLife *= PREFSMAN->m_fLifeDifficultyScale;
else
fDeltaLife /= PREFSMAN->m_fLifeDifficultyScale;
m_fLifePercentage += fDeltaLife;
CLAMP( m_fLifePercentage, 0, 1 );
+5 -3
View File
@@ -105,6 +105,11 @@ void LifeMeterBattery::ChangeLife( TapNoteScore score )
m_iTrailingLivesLeft = m_iLivesLeft;
m_iLivesLeft--;
m_soundLoseLife.Play();
m_textNumLives.SetZoom( 1.5f );
m_textNumLives.BeginTweening( 0.15f );
m_textNumLives.SetTweenZoom( 1.1f );
Refresh();
m_fBatteryBlinkTime = BATTERY_BLINK_TIME;
break;
@@ -159,9 +164,6 @@ void LifeMeterBattery::Refresh()
else
{
m_textNumLives.SetText( ssprintf("x%d", m_iLivesLeft) );
m_textNumLives.SetZoom( 1.5f );
m_textNumLives.BeginTweening( 0.15f );
m_textNumLives.SetTweenZoom( 1.1f );
m_sprBattery.SetState( 3 );
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ MenuElements::MenuElements()
void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bShowStyleIcon, bool bTimerEnabled, int iTimerSeconds )
{
LOG->WriteLine( "MenuElements::MenuElements()" );
LOG->Trace( "MenuElements::MenuElements()" );
m_sprBG.Load( sBackgroundPath );
+5 -7
View File
@@ -28,19 +28,17 @@ enum MenuButton
struct MenuInput
{
MenuInput() { MakeBlank(); };
MenuInput() { MakeInvalid(); };
MenuInput( PlayerNumber p, MenuButton b ) { player = p; button = b; };
PlayerNumber player;
MenuButton button;
bool operator==( const MenuInput &other ) { return player == other.player && button == other.button; };
// bool operator==( const MenuInput &other ) { return player == other.player && button == other.button; };
inline bool IsBlank() const { return player == PLAYER_INVALID; };
inline bool IsValid() const { return !IsBlank(); };
inline void MakeBlank() { player = PLAYER_INVALID; button = MENU_BUTTON_INVALID; };
inline bool IsValid() const { return player != PLAYER_INVALID; };
inline void MakeInvalid() { player = PLAYER_INVALID; button = MENU_BUTTON_INVALID; };
};
+4 -4
View File
@@ -294,7 +294,7 @@ void WheelItemDisplay::DrawPrimitives()
MusicWheel::MusicWheel()
{
LOG->WriteLine( "MusicWheel::MusicWheel()" );
LOG->Trace( "MusicWheel::MusicWheel()" );
// for debugging
@@ -897,7 +897,7 @@ void MusicWheel::Update( float fDeltaTime )
default: ASSERT(0);
}
LOG->WriteLine( "m_iSwitchesLeftInSpinDown id %d, m_fTimeLeftInState is %f", m_iSwitchesLeftInSpinDown, m_fTimeLeftInState );
LOG->Trace( "m_iSwitchesLeftInSpinDown id %d, m_fTimeLeftInState is %f", m_iSwitchesLeftInSpinDown, m_fTimeLeftInState );
if( m_iSwitchesLeftInSpinDown < 2 )
randomf(0,1) >= 0.5f ? NextMusic() : PrevMusic();
@@ -1027,7 +1027,7 @@ void MusicWheel::NextMusic( bool bSendSongChangedMessage )
case STATE_ROULETTE_SLOWING_DOWN:
break; // fall through
default:
LOG->WriteLine( "NextMusic() ignored" );
LOG->Trace( "NextMusic() ignored" );
return; // don't continue
}
@@ -1081,7 +1081,7 @@ void MusicWheel::NextSort()
bool MusicWheel::Select() // return true of a playable item was chosen
{
LOG->WriteLine( "MusicWheel::Select()" );
LOG->Trace( "MusicWheel::Select()" );
if( m_WheelState == STATE_ROULETTE_SPINNING )
{
+1 -1
View File
@@ -789,7 +789,7 @@ float NoteData::GetChaosRadarValue( float fSongSeconds )
for( int r=0; r<MAX_TAP_NOTE_ROWS; r++ )
{
if( !IsRowEmpty(r) && GetNoteType(r) >= NOTE_12TH )
iNumChaosNotes++;
iNumChaosNotes++;
}
float fReturn = iNumChaosNotes / fSongSeconds * 0.5f;
+2 -2
View File
@@ -135,8 +135,8 @@ float NoteDataWithScoring::GetActualChaosRadarValue( float fSongSeconds )
int iNumChaosNotesCompleted = 0;
for( int r=0; r<MAX_TAP_NOTE_ROWS; r++ )
{
if( IsRowComplete(r) && GetNoteType(r) >= NOTE_12TH )
iNumChaosNotesCompleted++;
if( !IsRowEmpty(r) && IsRowComplete(r) && GetNoteType(r) >= NOTE_12TH )
iNumChaosNotesCompleted++;
}
float fReturn = iNumChaosNotesCompleted / fSongSeconds * 0.5f;
+2 -2
View File
@@ -187,7 +187,7 @@ void NoteField::DrawFreezeText( const int iIndex, const float fSecs )
void NoteField::DrawPrimitives()
{
//LOG->WriteLine( "NoteField::DrawPrimitives()" );
//LOG->Trace( "NoteField::DrawPrimitives()" );
float fSongBeat = max( 0, GAMESTATE->m_fSongBeat );
@@ -198,7 +198,7 @@ void NoteField::DrawPrimitives()
const int iIndexFirstArrowToDraw = max( 0, BeatToNoteRow( fSongBeat - fBeatsToDrawBehind ) );
const int iIndexLastArrowToDraw = BeatToNoteRow( fSongBeat + fBeatsToDrawAhead );
//LOG->WriteLine( "Drawing elements %d through %d", iIndexFirstArrowToDraw, iIndexLastArrowToDraw );
//LOG->Trace( "Drawing elements %d through %d", iIndexFirstArrowToDraw, iIndexLastArrowToDraw );
if( GAMESTATE->m_bEditing )
{
+112 -11
View File
@@ -18,9 +18,9 @@
#include "RageUtil.h"
#include "RageLog.h"
#include "NoteData.h"
#include "GameInput.h"
#include "RageException.h"
#include "MsdFile.h"
typedef int DanceNote;
@@ -113,7 +113,7 @@ void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOu
bool Notes::LoadFromBMSFile( const CString &sPath )
{
LOG->WriteLine( "Notes::LoadFromBMSFile( '%s' )", sPath );
LOG->Trace( "Notes::LoadFromBMSFile( '%s' )", sPath );
NoteData* pNoteData = new NoteData;
pNoteData->m_iNumTracks = MAX_NOTE_TRACKS;
@@ -186,7 +186,7 @@ bool Notes::LoadFromBMSFile( const CString &sPath )
if( iPosOpenBracket != -1 && iPosCloseBracket != -1 )
m_sDescription = m_sDescription.Mid( iPosOpenBracket+1, iPosCloseBracket-iPosOpenBracket-1 );
m_sDescription.MakeLower();
LOG->WriteLine( "Notes description found to be '%s'", m_sDescription );
LOG->Trace( "Notes description found to be '%s'", m_sDescription );
// if there's a 6 in the description, it's probably part of "6panel" or "6-panel"
if( m_sDescription.Find("6") != -1 )
@@ -214,7 +214,7 @@ bool Notes::LoadFromBMSFile( const CString &sPath )
}
const int iNumNotesInThisMeasure = arrayNotes.GetSize();
//LOG->WriteLine( "%s:%s: iMeasureNo = %d, iNoteNum = %d, iNumNotesInThisMeasure = %d",
//LOG->Trace( "%s:%s: iMeasureNo = %d, iNoteNum = %d, iNumNotesInThisMeasure = %d",
// valuename, sNoteData, iMeasureNo, iNoteNum, iNumNotesInThisMeasure );
for( int j=0; j<iNumNotesInThisMeasure; j++ )
{
@@ -354,11 +354,13 @@ void DWIcharToNote( char c, GameController i, DanceNote &note1Out, DanceNote &no
bool Notes::LoadFromDWITokens(
CString sMode, CString sDescription,
int iNumFeet,
CString sStepData1, CString sStepData2 )
CString sMode,
CString sDescription,
CString sNumFeet,
CString sStepData1,
CString sStepData2 )
{
LOG->WriteLine( "Notes::LoadFromDWITokens()" );
LOG->Trace( "Notes::LoadFromDWITokens()" );
sStepData1.Replace( "\n", "" );
sStepData1.Replace( " ", "" );
@@ -407,7 +409,7 @@ bool Notes::LoadFromDWITokens(
m_sDescription = sDescription;
m_iMeter = iNumFeet;
m_iMeter = atoi( sNumFeet );
//m_DifficultyClass = DifficultyClassFromDescriptionAndMeter( m_sDescription, m_iMeter );
@@ -544,7 +546,7 @@ void Notes::LoadFromSMTokens(
sDifficultyClass.TrimRight();
// LOG->WriteLine( "Notes::LoadFromSMTokens()" );
// LOG->Trace( "Notes::LoadFromSMTokens()" );
m_NotesType = StringToNotesType(sNotesType);
m_sDescription = sDescription;
@@ -607,6 +609,105 @@ void Notes::TidyUpData()
}
}
bool Notes::LoadFromKSFFile( const CString &sPath )
{
LOG->Trace( "Notes::LoadFromKSFFile( '%s' )", sPath );
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
int iTickCount = -1; // this is the value we read for TICKCOUNT
for( int i=0; i<msd.m_iNumValues; i++ )
{
int iNumParams = msd.m_iNumParams[i];
CString* sParams = msd.m_sValuesAndParams[i];
CString sValueName = sParams[0];
// handle the data
if( 0==stricmp(sValueName,"TICKCOUNT") )
iTickCount = atoi(sParams[1]);
else if( 0==stricmp(sValueName,"STEP") )
{
if( iTickCount == -1 )
{
LOG->Warn( "In KSF file '%s', STEP was read before TICKCOUNT", sPath );
iTickCount = 2;
}
NoteData notedata; // read it into here
CStringArray asRows;
sParams[1].TrimLeft();
split( sParams[1], "\n", asRows, true );
for( int r=0; r<asRows.GetSize(); r++ )
{
CString& sRowString = asRows[r];
ASSERT( sRowString.GetLength() == 13 ); // why 13 notes per row. Beats me!
if( sRowString == "2222222222222" )
break;
float fBeatThisRow = r/(float)iTickCount; // the length of a note in a row depends on TICKCOUNT
int row = BeatToNoteRow(fBeatThisRow);
for( int t=0; t<13; t++ )
{
char c = sRowString[t];
if( c != '0' )
int kdsjf = 0;
notedata.m_TapNotes[t][row] = sRowString[t];
}
}
CString sDir, sFName, sExt;
splitrelpath( sPath, sDir, sFName, sExt );
sFName.MakeLower();
m_sDescription = sFName;
if( sFName.Find("crazy")!=-1 )
{
m_DifficultyClass = CLASS_HARD;
m_iMeter = 8;
}
else if( sFName.Find("hard")!=-1 )
{
m_DifficultyClass = CLASS_MEDIUM;
m_iMeter = 5;
}
else if( sFName.Find("easy")!=-1 )
{
m_DifficultyClass = CLASS_EASY;
m_iMeter = 2;
}
else
{
m_DifficultyClass = CLASS_MEDIUM;
m_iMeter = 5;
}
if( sFName.Find("double") != -1 )
{
notedata.m_iNumTracks = 10;
m_NotesType = NOTES_TYPE_PUMP_DOUBLE;
}
else
{
notedata.m_iNumTracks = 5;
m_NotesType = NOTES_TYPE_PUMP_SINGLE;
}
m_sSMNoteData = notedata.GetSMNoteDataString();
}
else
LOG->Trace( "Unexpected value named '%s'", sValueName );
}
return true;
}
DifficultyClass Notes::DifficultyClassFromDescriptionAndMeter( CString sDescription, int iMeter )
{
sDescription.MakeLower();
@@ -617,7 +718,7 @@ DifficultyClass Notes::DifficultyClassFromDescriptionAndMeter( CString sDescript
"easy",
"basic",
"light",
"SDFKSJDKFJS",
"GARBAGE", // but don't worry - this will never match because the compare string is all lowercase
},
{
"medium",
+3 -2
View File
@@ -26,11 +26,12 @@ public:
// Loading
bool LoadFromNotesFile( const CString &sPath );
bool LoadFromBMSFile( const CString &sPath );
bool LoadFromKSFFile( const CString &sPath );
bool LoadFromDWITokens(
CString sMode,
CString sDescription,
int iNumFeet,
CString sStepData1, const CString sStepData2
CString sNumFeet,
CString sStepData1, CString sStepData2
);
void LoadFromSMTokens(
CString sNotesType,
+11 -11
View File
@@ -61,7 +61,7 @@ Player::Player()
void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDisplay* pScore )
{
//LOG->WriteLine( "Player::Load()", );
//LOG->Trace( "Player::Load()", );
m_PlayerNumber = pn;
m_pLifeMeter = pLM;
@@ -131,7 +131,7 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
void Player::Update( float fDeltaTime )
{
//LOG->WriteLine( "Player::Update(%f)", fDeltaTime );
//LOG->Trace( "Player::Update(%f)", fDeltaTime );
const float fSongBeat = GAMESTATE->m_fSongBeat;
@@ -218,6 +218,8 @@ void Player::Update( float fDeltaTime )
void Player::DrawPrimitives()
{
m_frameCombo.Draw(); // draw this below everything else
D3DXMATRIX matOldView, matOldProj;
if( GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_EffectType == PlayerOptions::EFFECT_SPACE )
@@ -251,8 +253,6 @@ void Player::DrawPrimitives()
DISPLAY->GetDevice()->SetTransform( D3DTS_PROJECTION, &matNewProj );
}
m_frameCombo.Draw();
m_GrayArrowRow.Draw();
m_NoteField.Draw();
m_GhostArrowRow.Draw();
@@ -272,7 +272,7 @@ void Player::DrawPrimitives()
void Player::Step( int col )
{
//LOG->WriteLine( "Player::HandlePlayerStep()" );
//LOG->Trace( "Player::HandlePlayerStep()" );
ASSERT( col >= 0 && col <= m_iNumTracks );
@@ -282,7 +282,7 @@ void Player::Step( int col )
int iIndexStartLookingAt = BeatToNoteRow( GAMESTATE->m_fSongBeat );
int iNumElementsToExamine = BeatToNoteRow( GetMaxBeatDifference() ); // number of elements to examine on either end of iIndexStartLookingAt
//LOG->WriteLine( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine );
//LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine );
int iIndexOverlappingNote = -1; // leave as -1 if we don't find any
@@ -299,7 +299,7 @@ void Player::Step( int col )
////////////////////////////
// check the step to the left of iIndexStartLookingAt
////////////////////////////
//LOG->WriteLine( "Checking Notes[%d]", iCurrentIndexEarlier );
//LOG->Trace( "Checking Notes[%d]", iCurrentIndexEarlier );
if( m_TapNotes[col][iCurrentIndexEarlier] != '0' && // there is a note here
m_TapNoteScores[col][iCurrentIndexEarlier] == TNS_NONE ) // this note doesn't have a score
{
@@ -311,7 +311,7 @@ void Player::Step( int col )
////////////////////////////
// check the step to the right of iIndexStartLookingAt
////////////////////////////
//LOG->WriteLine( "Checking Notes[%d]", iCurrentIndexLater );
//LOG->Trace( "Checking Notes[%d]", iCurrentIndexLater );
if( m_TapNotes[col][iCurrentIndexLater] != '0' && // there is a note here
m_TapNoteScores[col][iCurrentIndexLater] == TNS_NONE ) // this note doesn't have a score
{
@@ -359,7 +359,7 @@ void Player::Step( int col )
void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
{
//LOG->WriteLine( "fBeatsUntilStep: %f, fPercentFromPerfect: %f",
//LOG->Trace( "fBeatsUntilStep: %f, fPercentFromPerfect: %f",
// fBeatsUntilStep, fPercentFromPerfect );
// find the minimum score of the row
@@ -422,7 +422,7 @@ void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat )
{
//LOG->WriteLine( "Notes::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat );
//LOG->Trace( "Notes::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat );
int iMissIfOlderThanThisIndex = BeatToNoteRow( fMissIfOlderThanThisBeat );
@@ -431,7 +431,7 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat )
// Instead, only check 10 elements back. Even 10 is overkill.
int iStartCheckingAt = max( 0, iMissIfOlderThanThisIndex-10 );
//LOG->WriteLine( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex );
//LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex );
for( int t=0; t<m_iNumTracks; t++ )
{
for( int r=iStartCheckingAt; r<iMissIfOlderThanThisIndex; r++ )
+32 -26
View File
@@ -27,6 +27,7 @@ PrefsManager::PrefsManager()
m_iTextureResolution = 512;
m_iRefreshRate = 0;
m_bIgnoreJoyAxes = false;
m_bOnlyDedicatedMenuButtons = false;
m_bShowFPS = false;
m_BackgroundMode = BGMODE_ANIMATIONS;
m_fBGBrightness = 0.8f;
@@ -35,6 +36,7 @@ PrefsManager::PrefsManager()
m_iNumArcadeStages = 3;
m_bAutoPlay = false;
m_fJudgeWindow = 0.18f;
m_fLifeDifficultyScale = 1.0f;
ReadGlobalPrefsFromDisk( true );
}
@@ -52,19 +54,21 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
if( !ini.ReadFile() )
return; // could not read config file, load nothing
ini.GetValueB( "Options", "Windowed", m_bWindowed );
ini.GetValueI( "Options", "DisplayResolution", m_iDisplayResolution );
ini.GetValueI( "Options", "TextureResolution", m_iTextureResolution );
ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.GetValueB( "Options", "ShowFPS", m_bShowFPS );
ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode );
ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness );
ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer );
ini.GetValueB( "Options", "EventMode", m_bEventMode );
ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay );
ini.GetValueF( "Options", "JudgeWindow", m_fJudgeWindow );
ini.GetValueB( "Options", "Windowed", m_bWindowed );
ini.GetValueI( "Options", "DisplayResolution", m_iDisplayResolution );
ini.GetValueI( "Options", "TextureResolution", m_iTextureResolution );
ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.GetValueB( "Options", "UseDedicatedMenuButtons",m_bOnlyDedicatedMenuButtons );
ini.GetValueB( "Options", "ShowFPS", m_bShowFPS );
ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode );
ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness );
ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer );
ini.GetValueB( "Options", "EventMode", m_bEventMode );
ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay );
ini.GetValueF( "Options", "JudgeWindow", m_fJudgeWindow );
ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
CString sAdditionalSongFolders;
ini.GetValue( "Options", "SongFolders", sAdditionalSongFolders );
@@ -84,19 +88,21 @@ void PrefsManager::SaveGlobalPrefsToDisk()
IniFile ini;
ini.SetPath( "StepMania.ini" );
ini.SetValueB( "Options", "Windowed", m_bWindowed );
ini.SetValueI( "Options", "DisplayResolution", m_iDisplayResolution );
ini.SetValueI( "Options", "TextureResolution", m_iTextureResolution );
ini.SetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.SetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.SetValueB( "Options", "ShowFPS", m_bShowFPS );
ini.SetValueI( "Options", "BackgroundMode", m_BackgroundMode);
ini.SetValueF( "Options", "BGBrightness", m_fBGBrightness );
ini.SetValueB( "Options", "EventMode", m_bEventMode );
ini.SetValueB( "Options", "MenuTimer", m_bMenuTimer );
ini.SetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
ini.SetValueB( "Options", "AutoPlay", m_bAutoPlay );
ini.SetValueF( "Options", "JudgeWindow", m_fJudgeWindow );
ini.SetValueB( "Options", "Windowed", m_bWindowed );
ini.SetValueI( "Options", "DisplayResolution", m_iDisplayResolution );
ini.SetValueI( "Options", "TextureResolution", m_iTextureResolution );
ini.SetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.SetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.GetValueB( "Options", "UseDedicatedMenuButtons",m_bOnlyDedicatedMenuButtons );
ini.SetValueB( "Options", "ShowFPS", m_bShowFPS );
ini.SetValueI( "Options", "BackgroundMode", m_BackgroundMode);
ini.SetValueF( "Options", "BGBrightness", m_fBGBrightness );
ini.SetValueB( "Options", "EventMode", m_bEventMode );
ini.SetValueB( "Options", "MenuTimer", m_bMenuTimer );
ini.SetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages );
ini.SetValueB( "Options", "AutoPlay", m_bAutoPlay );
ini.SetValueF( "Options", "JudgeWindow", m_fJudgeWindow );
ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
ini.SetValue( "Options", "SongFolders", join(",", m_asSongFolders) );
+2
View File
@@ -32,6 +32,7 @@ public:
int m_iTextureResolution;
int m_iRefreshRate; // 0 means 'default'
bool m_bIgnoreJoyAxes;
bool m_bOnlyDedicatedMenuButtons;
bool m_bShowFPS;
BackgroundMode m_BackgroundMode;
float m_fBGBrightness;
@@ -40,6 +41,7 @@ public:
int m_iNumArcadeStages;
bool m_bAutoPlay;
float m_fJudgeWindow;
float m_fLifeDifficultyScale;
CStringArray m_asSongFolders;
+3 -3
View File
@@ -43,7 +43,7 @@ RageBitmapTexture::RageBitmapTexture(
) :
RageTexture( pScreen, sFilePath, dwMaxSize, dwTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch )
{
// LOG->WriteLine( "RageBitmapTexture::RageBitmapTexture()" );
// LOG->Trace( "RageBitmapTexture::RageBitmapTexture()" );
m_pd3dTexture = NULL;
@@ -169,7 +169,7 @@ void RageBitmapTexture::Create(
{
if( i==0 )
{
LOG->WriteLine( "WARNING! D3DXCreateTextureFromFileEx failed. Sleep and try one more time..." );
LOG->Trace( "WARNING! D3DXCreateTextureFromFileEx failed. Sleep and try one more time..." );
::Sleep( 10 );
continue;
}
@@ -206,7 +206,7 @@ void RageBitmapTexture::Create(
m_iImageHeight = m_iSourceHeight;
}
LOG->WriteLine( "RageBitmapTexture: Loaded '%s' (%ux%u) from disk. bStretch = %d, source %d,%d; image %d,%d.",
LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u) from disk. bStretch = %d, source %d,%d; image %d,%d.",
m_sFilePath,
GetTextureWidth(),
GetTextureHeight(),
+17 -17
View File
@@ -23,7 +23,7 @@ RageDisplay* DISPLAY = NULL;
RageDisplay::RageDisplay( HWND hWnd )
{
LOG->WriteLine( "RageDisplay::RageDisplay()" );
LOG->Trace( "RageDisplay::RageDisplay()" );
// Save the window handle
m_hWnd = hWnd;
@@ -61,7 +61,7 @@ RageDisplay::RageDisplay( HWND hWnd )
);
}
LOG->WriteLine(
LOG->Trace(
"Video card info:\n"
" - max texture width is %d\n"
" - max texture height is %d\n"
@@ -76,13 +76,13 @@ RageDisplay::RageDisplay( HWND hWnd )
// Enumerate possible display modes
LOG->WriteLine( "This display adaptor supports the following modes:" );
LOG->Trace( "This display adaptor supports the following modes:" );
for( UINT u=0; u<m_pd3d->GetAdapterModeCount(D3DADAPTER_DEFAULT); u++ )
{
D3DDISPLAYMODE mode;
if( SUCCEEDED( m_pd3d->EnumAdapterModes( D3DADAPTER_DEFAULT, u, &mode ) ) )
{
//LOG->WriteLine( " %ux%u %uHz, format %d", mode.Width, mode.Height, mode.RefreshRate, mode.Format );
//LOG->Trace( " %ux%u %uHz, format %d", mode.Width, mode.Height, mode.RefreshRate, mode.Format );
}
}
@@ -107,7 +107,7 @@ RageDisplay::~RageDisplay()
bool RageDisplay::SwitchDisplayMode(
const bool bWindowed, const int iWidth, const int iHeight, const int iBPP, const int iFullScreenHz )
{
LOG->WriteLine( "RageDisplay::SwitchDisplayModes( %d, %d, %d, %d, %d )", bWindowed, iWidth, iHeight, iBPP, iFullScreenHz );
LOG->Trace( "RageDisplay::SwitchDisplayModes( %d, %d, %d, %d, %d )", bWindowed, iWidth, iHeight, iBPP, iFullScreenHz );
if( !bWindowed )
SetCursor( NULL );
@@ -166,7 +166,7 @@ bool RageDisplay::SwitchDisplayMode(
fmtDisplay = fmtBackBuffer = arrayBackBufferFormats[i];
}
LOG->WriteLine( "Testing format: display %d, back buffer %d, windowed %d...", fmtDisplay, fmtBackBuffer, bWindowed );
LOG->Trace( "Testing format: display %d, back buffer %d, windowed %d...", fmtDisplay, fmtBackBuffer, bWindowed );
hr = m_pd3d->CheckDeviceType(
D3DADAPTER_DEFAULT,
@@ -178,18 +178,18 @@ bool RageDisplay::SwitchDisplayMode(
if( SUCCEEDED(hr) )
{
LOG->WriteLine( "This will work." );
LOG->Trace( "This will work." );
break; // done searching
}
else
{
LOG->WriteLine( "This won't work. Keep searching." );
LOG->Trace( "This won't work. Keep searching." );
}
}
if( i == arrayBackBufferFormats.GetSize() ) // we didn't find an appropriate format
{
LOG->WriteLineHr( hr, "failed to find an appropriate format for %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
LOG->Trace( hr, "failed to find an appropriate format for %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
return false;
}
@@ -212,7 +212,7 @@ bool RageDisplay::SwitchDisplayMode(
m_d3dpp.FullScreen_RefreshRateInHz = bWindowed ? D3DPRESENT_RATE_DEFAULT : iFullScreenHz;
m_d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
LOG->WriteLine( "Present Parameters: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
LOG->Trace( "Present Parameters: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
m_d3dpp.BackBufferWidth,
m_d3dpp.BackBufferHeight,
m_d3dpp.BackBufferFormat,
@@ -235,11 +235,11 @@ bool RageDisplay::SwitchDisplayMode(
D3DADAPTER_IDENTIFIER8 identifier;
if( FAILED( hr = m_pd3d->GetAdapterIdentifier( D3DADAPTER_DEFAULT, 0, &identifier ) ) )
{
LOG->WriteLineHr( hr, "GetAdapterIdentifier failed" );
LOG->Trace( hr, "GetAdapterIdentifier failed" );
return false;
}
LOG->WriteLine( "Driver: %s. Description: %s.",
LOG->Trace( "Driver: %s. Description: %s.",
identifier.Driver,
identifier.Description
);
@@ -250,10 +250,10 @@ bool RageDisplay::SwitchDisplayMode(
D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED,
&m_d3dpp, &m_pd3dDevice) ) )
{
LOG->WriteLineHr( hr, "failed to create device: %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
LOG->Trace( hr, "failed to create device: %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
return false;
}
LOG->WriteLine(
LOG->Trace(
"Video card info:\n"
" - available texture mem is %u\n",
m_pd3dDevice->GetAvailableTextureMem()
@@ -266,12 +266,12 @@ bool RageDisplay::SwitchDisplayMode(
// device is already created. Just reset it.
if( FAILED( hr = m_pd3dDevice->Reset( &m_d3dpp ) ) )
{
LOG->WriteLineHr( hr, "failed to reset device: %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
LOG->Trace( hr, "failed to reset device: %d, %u, %u, %u.", bWindowed, iWidth, iHeight, iBPP );
return false;
}
}
LOG->WriteLine( "Mode change was successful." );
LOG->Trace( "Mode change was successful." );
// Clear the back buffer and present it so we don't show the gibberish that was
// in video memory from the last app.
@@ -378,7 +378,7 @@ HRESULT RageDisplay::EndFrame()
m_iFramesRenderedSinceLastCheck = 0;
m_fLastUpdateTime = fTimeNow;
LOG->WriteLine( "FPS: %.0f", m_fFPS );
LOG->Trace( "FPS: %.0f", m_fFPS );
}
+2 -1
View File
@@ -187,6 +187,7 @@ CString DeviceInput::GetDescription()
case DIK_LWIN: sReturn += "Left Win"; break;
case DIK_RWIN: sReturn += "Right Win"; break;
case DIK_APPS: sReturn += "App Menu"; break;
case DIK_NUMPADENTER: sReturn += "NumPadEnter"; break;
default: sReturn += "Unknown Key"; break;
}
@@ -284,7 +285,7 @@ BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
RageInput::RageInput( HWND hWnd )
{
LOG->WriteLine( "RageInput::RageInput()" );
LOG->Trace( "RageInput::RageInput()" );
int i;
+2 -4
View File
@@ -72,8 +72,6 @@ struct DeviceInput
public:
InputDevice device;
int button;
enum EventType { EVENT_PRESS, EVENT_REPEAT }; // maybe add EVENT_RELEASE later?
float fTimeHeld; // only relevant for EVENT_REPEAT
DeviceInput() { device=DEVICE_NONE; };
DeviceInput( InputDevice d, int b ) { device=d; button=b; };
@@ -88,8 +86,8 @@ public:
CString toString();
bool fromString( const CString &s );
bool IsBlank() const { return device == DEVICE_NONE; };
void MakeBlank() { device = DEVICE_NONE; };
bool IsValid() const { return device != DEVICE_NONE; };
void MakeInvalid() { device = DEVICE_NONE; };
};
+19 -6
View File
@@ -38,10 +38,10 @@ RageLog::RageLog()
SYSTEMTIME st;
GetLocalTime( &st );
this->WriteLine( "Last compiled on %s.", __TIMESTAMP__ );
this->WriteLine( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d",
this->Trace( "Last compiled on %s.", __TIMESTAMP__ );
this->Trace( "Log starting %.4d-%.2d-%.2d %.2d:%.2d:%.2d",
st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond );
this->WriteLine( "\n" );
this->Trace( "\n" );
}
RageLog::~RageLog()
@@ -64,7 +64,7 @@ void RageLog::HideConsole()
FreeConsole();
}
void RageLog::WriteLine( LPCTSTR fmt, ...)
void RageLog::Trace( LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
@@ -80,13 +80,26 @@ void RageLog::WriteLine( LPCTSTR fmt, ...)
#endif
}
void RageLog::WriteLineHr( HRESULT hr, LPCTSTR fmt, ...)
void RageLog::Trace( HRESULT hr, LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
CString s = vssprintf( fmt, va );
s += ssprintf( "(%s)", DXGetErrorString8(hr) );
this->WriteLine( s );
this->Trace( s );
}
void RageLog::Warn( LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
CString sBuff = vssprintf( fmt, va );
Trace( "/////////////////////////////////////////\n"
"WARNING: %s\n"
"/////////////////////////////////////////",
sBuff );
}
void RageLog::Flush()
+3 -2
View File
@@ -17,8 +17,9 @@ public:
RageLog();
~RageLog();
void WriteLine( LPCTSTR fmt, ...);
void WriteLineHr( HRESULT hr, LPCTSTR fmt, ...);
void Trace( LPCTSTR fmt, ...);
void Trace( HRESULT hr, LPCTSTR fmt, ...);
void Warn( LPCTSTR fmt, ...);
void Flush();
void ShowConsole();
+2 -2
View File
@@ -254,7 +254,7 @@ RageMovieTexture::RageMovieTexture(
bool bStretch ) :
RageTexture( pScreen, sFilePath, dwMaxSize, dwTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch )
{
LOG->WriteLine( "RageBitmapTexture::RageBitmapTexture()" );
LOG->Trace( "RageBitmapTexture::RageBitmapTexture()" );
m_pd3dTexture[0] = m_pd3dTexture[1] = NULL;
m_iIndexActiveTexture = 0;
@@ -299,7 +299,7 @@ LPDIRECT3DTEXTURE8 RageMovieTexture::GetD3DTexture()
// time for it to catch up and copy all the frames it fell behind on.
// while( m_pCTR->IsLocked() ) {
// ::Sleep(1);
// LOG->WriteLine( "Sleeping waiting for unlock..." );
// LOG->Trace( "Sleeping waiting for unlock..." );
// }
// restart the movie if we reach the end
+3 -3
View File
@@ -26,7 +26,7 @@ RageSound* SOUND = NULL;
RageSound::RageSound( HWND hWnd )
{
LOG->WriteLine( "RageSound::RageSound()" );
LOG->Trace( "RageSound::RageSound()" );
// save the HWND
if( !hWnd )
@@ -54,7 +54,7 @@ RageSound::RageSound( HWND hWnd )
BASS_GetInfo( &m_info );
LOG->WriteLine(
LOG->Trace(
"Sound card info:\n"
" - play latency is %u ms\n"
" - total device hardware memory is %u bytes\n"
@@ -75,7 +75,7 @@ RageSound::RageSound( HWND hWnd )
RageSound::~RageSound()
{
LOG->WriteLine( "RageSound::~RageSound()" );
LOG->Trace( "RageSound::~RageSound()" );
BASS_Stop();
BASS_Free();
+2 -2
View File
@@ -31,7 +31,7 @@ RageTexture::RageTexture(
bool bDither,
bool bStretch )
{
// LOG->WriteLine( "RageTexture::RageTexture()" );
// LOG->Trace( "RageTexture::RageTexture()" );
// save a pointer to the D3D device
m_pd3dDevice = pScreen->GetDevice();
@@ -74,7 +74,7 @@ void RageTexture::CreateFrameRects()
(j+1)/(float)m_iFramesHigh*m_iImageHeight/(float)m_iTextureHeight );
m_TextureCoordRects.Add( frect ); // the index of this array element will be (i + j*m_iFramesWide)
//LOG->WriteLine( "Adding frect%d %f %f %f %f", (i + j*m_iFramesWide), frect.left, frect.top, frect.right, frect.bottom );
//LOG->Trace( "Adding frect%d %f %f %f %f", (i + j*m_iFramesWide), frect.left, frect.top, frect.right, frect.bottom );
}
}
}
+9 -9
View File
@@ -45,7 +45,7 @@ RageTextureManager::~RageTextureManager()
while( pos != NULL ) // iterate over all k/v pairs in map
{
m_mapPathToTexture.GetNextAssoc( pos, sPath, pTexture );
LOG->WriteLine( "TEXTUREMAN LEAK: '%s', RefCount = %d.", sPath, pTexture->m_iRefCount );
LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", sPath, pTexture->m_iRefCount );
SAFE_DELETE( pTexture );
}
@@ -60,7 +60,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
{
sTexturePath.MakeLower();
// LOG->WriteLine( "RageTextureManager::LoadTexture(%s).", sTexturePath );
// LOG->Trace( "RageTextureManager::LoadTexture(%s).", sTexturePath );
// holder for the new texture
RageTexture* pTexture;
@@ -76,7 +76,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
if( bForceReload )
pTexture->Reload( m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
LOG->WriteLine( "RageTextureManager: '%s' now has %d references.", sTexturePath, pTexture->m_iRefCount );
LOG->Trace( "RageTextureManager: '%s' now has %d references.", sTexturePath, pTexture->m_iRefCount );
}
else // the texture is not already loaded
{
@@ -89,13 +89,13 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
pTexture = (RageTexture*) new RageBitmapTexture( m_pScreen, sTexturePath, m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
LOG->WriteLine( "RageTextureManager: Finished loading '%s' - %d references.", sTexturePath, pTexture->m_iRefCount );
LOG->Trace( "RageTextureManager: Finished loading '%s' - %d references.", sTexturePath, pTexture->m_iRefCount );
m_mapPathToTexture.SetAt( sTexturePath, pTexture );
}
LOG->WriteLine( "Display: %u KB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem() );
LOG->Trace( "Display: %.2f KB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem()/1000000.0f );
return pTexture;
}
@@ -117,11 +117,11 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
{
sTexturePath.MakeLower();
// LOG->WriteLine( "RageTextureManager::UnloadTexture(%s).", sTexturePath );
// LOG->Trace( "RageTextureManager::UnloadTexture(%s).", sTexturePath );
if( sTexturePath == "" )
{
//LOG->WriteLine( "RageTextureManager::UnloadTexture(): tried to Unload a blank texture." );
//LOG->Trace( "RageTextureManager::UnloadTexture(): tried to Unload a blank texture." );
return;
}
@@ -132,13 +132,13 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
pTexture->m_iRefCount--;
if( pTexture->m_iRefCount == 0 ) // there are no more references to this texture
{
LOG->WriteLine( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath, pTexture->m_iRefCount );
LOG->Trace( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath, pTexture->m_iRefCount );
SAFE_DELETE( pTexture ); // free the texture
m_mapPathToTexture.RemoveKey( sTexturePath ); // and remove the key in the map
}
else
{
LOG->WriteLine( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath, pTexture->m_iRefCount );
LOG->Trace( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath, pTexture->m_iRefCount );
}
}
else // texture not found
+2 -2
View File
@@ -51,7 +51,7 @@ bool RandomSample::LoadSoundDir( CString sDir )
bool RandomSample::LoadSound( CString sSoundFilePath )
{
LOG->WriteLine( "RandomSample::LoadSound( %s )", sSoundFilePath );
LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath );
RageSoundSample* pSS = new RageSoundSample;
pSS->Load( sSoundFilePath );
@@ -67,7 +67,7 @@ void RandomSample::PlayRandom()
// play one of the samples
if( m_pSamples.GetSize() == 0 )
{
LOG->WriteLine( "WARNING: Tried to play a RandomSample that has 0 sounds loaded." );
LOG->Trace( "WARNING: Tried to play a RandomSample that has 0 sounds loaded." );
}
else
{
+3 -9
View File
@@ -1,17 +1,15 @@
#pragma once
/*
-----------------------------------------------------------------------------
File: RandomSample.h
Class: RandomSample
Desc: Holds multiple sounds samples and can play a random sound easily.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#ifndef _RandomSample_H_
#define _RandomSample_H_
#include "RageSound.h"
#include "RageSoundSample.h"
#include "RageUtil.h"
@@ -46,7 +44,3 @@ private:
int m_iIndexLastPlayed;
};
#endif
+1 -1
View File
@@ -23,7 +23,7 @@ const float SCORE_TWEEN_TIME = 0.5f;
ScoreDisplayNormal::ScoreDisplayNormal()
{
LOG->WriteLine( "ScoreDisplayNormal::ScoreDisplayNormal()" );
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
// init the text
Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
+1 -1
View File
@@ -23,7 +23,7 @@ const float SCORE_TWEEN_TIME = 0.5f;
ScoreDisplayOni::ScoreDisplayOni()
{
LOG->WriteLine( "ScoreDisplayOni::ScoreDisplayOni()" );
LOG->Trace( "ScoreDisplayOni::ScoreDisplayOni()" );
// init the text
Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
+6 -6
View File
@@ -48,6 +48,12 @@ void Screen::Update( float fDeltaTime )
void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE ) // don't make user hold back button if they're pressing escape
{
this->MenuBack( MenuI.player );
return;
}
// default input handler used by most menus
if( !MenuI.IsValid() )
return;
@@ -55,12 +61,6 @@ void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const
if( !GAMESTATE->IsPlayerEnabled(MenuI.player) )
return;
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE ) // don't make user hold back button if they're pressing escape
{
this->MenuBack( MenuI.player );
return;
}
switch( MenuI.button )
{
case MENU_BUTTON_UP: this->MenuUp( MenuI.player, type ); return;
+6 -6
View File
@@ -50,12 +50,12 @@ protected:
public:
// let subclass override if they want
virtual void MenuUp( const PlayerNumber p, const InputEventType type ) { if( type==IET_FIRST_PRESS) MenuUp(p); };
virtual void MenuDown( const PlayerNumber p, const InputEventType type ) { if( type==IET_FIRST_PRESS) MenuDown(p); };
virtual void MenuLeft( const PlayerNumber p, const InputEventType type ) { if( type==IET_FIRST_PRESS) MenuLeft(p); };
virtual void MenuRight( const PlayerNumber p, const InputEventType type ) { if( type==IET_FIRST_PRESS) MenuRight(p); };
virtual void MenuStart( const PlayerNumber p, const InputEventType type ) { if( type==IET_FIRST_PRESS) MenuStart(p); };
virtual void MenuBack( const PlayerNumber p, const InputEventType type ) { if( type==IET_SLOW_REPEAT) MenuBack(p); };
virtual void MenuUp( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuUp(p); };
virtual void MenuDown( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuDown(p); };
virtual void MenuLeft( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuLeft(p); };
virtual void MenuRight( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuRight(p); };
virtual void MenuStart( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuStart(p); };
virtual void MenuBack( const PlayerNumber p, const InputEventType type ) { if(type==IET_SLOW_REPEAT || type==IET_FAST_REPEAT) MenuBack(p); };
virtual void MenuUp( const PlayerNumber p ) {};
virtual void MenuDown( const PlayerNumber p ) {};
+2 -2
View File
@@ -48,7 +48,7 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() :
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
)
{
LOG->WriteLine( "ScreenAppearanceOptions::ScreenAppearanceOptions()" );
LOG->Trace( "ScreenAppearanceOptions::ScreenAppearanceOptions()" );
Init(
INPUTMODE_BOTH,
@@ -90,7 +90,7 @@ void ScreenAppearanceOptions::ImportOptions()
// fill in theme names
//
CStringArray arrayThemeNames;
THEME->GetThemeNames( arrayThemeNames );
THEME->GetThemeNamesForCurGame( arrayThemeNames );
m_OptionLineData[AO_THEME].iNumOptions = arrayThemeNames.GetSize() + 1;
+5 -5
View File
@@ -87,7 +87,7 @@ const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User+2);
ScreenEdit::ScreenEdit()
{
LOG->WriteLine( "ScreenEdit::ScreenEdit()" );
LOG->Trace( "ScreenEdit::ScreenEdit()" );
m_pSong = GAMESTATE->m_pCurSong;
@@ -193,7 +193,7 @@ ScreenEdit::ScreenEdit()
ScreenEdit::~ScreenEdit()
{
LOG->WriteLine( "ScreenEdit::~ScreenEdit()" );
LOG->Trace( "ScreenEdit::~ScreenEdit()" );
m_soundMusic.Stop();
}
@@ -247,7 +247,7 @@ void ScreenEdit::Update( float fDeltaTime )
m_Player.Update( fDeltaTime );
}
//LOG->WriteLine( "ScreenEdit::Update(%f)", fDeltaTime );
//LOG->Trace( "ScreenEdit::Update(%f)", fDeltaTime );
Screen::Update( fDeltaTime );
@@ -277,7 +277,7 @@ void ScreenEdit::Update( float fDeltaTime )
// fPositionSeconds += 0.08f; // HACK: The assist ticks are playing too late, so make them play a tiny bit earlier
// m_pSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS );
// LOG->WriteLine( "fPositionSeconds = %f, fSongBeat = %f, fBPS = %f", fPositionSeconds, fSongBeat, fBPS );
// LOG->Trace( "fPositionSeconds = %f, fSongBeat = %f, fBPS = %f", fPositionSeconds, fSongBeat, fBPS );
m_NoteFieldEdit.Update( fDeltaTime );
@@ -357,7 +357,7 @@ void ScreenEdit::DrawPrimitives()
void ScreenEdit::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
//LOG->WriteLine( "ScreenEdit::Input()" );
//LOG->Trace( "ScreenEdit::Input()" );
switch( m_EditMode )
{
+3 -3
View File
@@ -56,7 +56,7 @@ const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User+2);
ScreenEditMenu::ScreenEditMenu()
{
LOG->WriteLine( "ScreenEditMenu::ScreenEditMenu()" );
LOG->Trace( "ScreenEditMenu::ScreenEditMenu()" );
// data structures
@@ -136,7 +136,7 @@ ScreenEditMenu::ScreenEditMenu()
ScreenEditMenu::~ScreenEditMenu()
{
LOG->WriteLine( "ScreenEditMenu::~ScreenEditMenu()" );
LOG->Trace( "ScreenEditMenu::~ScreenEditMenu()" );
}
void ScreenEditMenu::DrawPrimitives()
@@ -148,7 +148,7 @@ void ScreenEditMenu::DrawPrimitives()
void ScreenEditMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenEditMenu::Input()" );
LOG->Trace( "ScreenEditMenu::Input()" );
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
+2 -2
View File
@@ -59,7 +59,7 @@ const ScreenMessage SM_GoToMusicScroll = ScreenMessage(SM_User+4);
ScreenEvaluation::ScreenEvaluation( bool bSummary )
{
LOG->WriteLine( "ScreenEvaluation::ScreenEvaluation()" );
LOG->Trace( "ScreenEvaluation::ScreenEvaluation()" );
int l, p; // for counting
@@ -706,7 +706,7 @@ void ScreenEvaluation::DrawPrimitives()
void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenEvaluation::Input()" );
LOG->Trace( "ScreenEvaluation::Input()" );
if( m_Menu.IsClosing() )
return;
+3 -3
View File
@@ -58,7 +58,7 @@ Desc: Sets up the screen display
ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
{
LOG->WriteLine( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
LOG->Trace( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
ez2_lasttimercheck[0] = TIMER->GetTimeSinceStart();
ez2_lasttimercheck[1] = 0.0f;
m_iSelectedStyle=3; // by bbf: frieza, was this supposed to be 3 ?
@@ -124,7 +124,7 @@ is terminated.
************************************/
ScreenEz2SelectPlayer::~ScreenEz2SelectPlayer()
{
LOG->WriteLine( "ScreenEz2SelectPlayer::~ScreenEz2SelectPlayer()" );
LOG->Trace( "ScreenEz2SelectPlayer::~ScreenEz2SelectPlayer()" );
}
@@ -215,7 +215,7 @@ Desc: Handles player input.
************************************/
void ScreenEz2SelectPlayer::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenEz2SelectPlayer::Input()" );
LOG->Trace( "ScreenEz2SelectPlayer::Input()" );
if( m_Menu.IsClosing() )
return;
+16 -32
View File
@@ -123,30 +123,22 @@ Desc: Sets up the screen display
ScreenEz2SelectStyle::ScreenEz2SelectStyle()
{
LOG->WriteLine( "ScreenEz2SelectStyle::ScreenEz2SelectStyle()" );
LOG->Trace( "ScreenEz2SelectStyle::ScreenEz2SelectStyle()" );
m_iSelectedStyle=0;
ez2p_lasttimercheck[0] = TIMER->GetTimeSinceStart();
// Load in the sprites we will be working with.
for( int i=0; i<NUM_EZ2STYLE_GRAPHICS; i++ )
{
CString sPadGraphicPath;
ThemeElement te;
switch( i )
{
case 0:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1); //HACK! Would LIKE to have own filename :)
break;
case 1:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2);
break;
case 2:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3);
break;
case 3:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0);
break;
{ //HACK! Would LIKE to have own filename :)
case 0: te = GRAPHIC_SELECT_STYLE_PREVIEW_1; break;
case 1: te = GRAPHIC_SELECT_STYLE_PREVIEW_2; break;
case 2: te = GRAPHIC_SELECT_STYLE_PREVIEW_3; break;
case 3: te = GRAPHIC_SELECT_STYLE_PREVIEW_0; break;
}
m_sprBackground[i].Load( sPadGraphicPath );
m_sprBackground[i].Load( THEME->GetPathTo(te) );
m_sprBackground[i].SetXY( CENTER_X, CENTER_Y );
m_sprBackground[i].SetZoom( 1 );
this->AddSubActor( &m_sprBackground[i] );
@@ -154,23 +146,15 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
for( i=0; i<NUM_EZ2STYLE_GRAPHICS; i++ )
{
CString sPadGraphicPath;
ThemeElement te;
switch( i )
{
case 0:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3); //HACK! Would LIKE to have own filename :)
break;
case 1:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0);
break;
case 2:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_1);
break;
case 3:
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2);
break;
case 0: te = GRAPHIC_SELECT_STYLE_INFO_3; break;
case 1: te = GRAPHIC_SELECT_STYLE_INFO_0; break;
case 2: te = GRAPHIC_SELECT_STYLE_INFO_1; break;
case 3: te = GRAPHIC_SELECT_STYLE_INFO_2; break;
}
m_sprOpt[i].Load( sPadGraphicPath );
m_sprOpt[i].Load( THEME->GetPathTo(te) );
m_sprOpt[i].SetXY( OPT_X[i], OPT_Y[i] );
m_sprOpt[i].SetZoom( 1 );
this->AddSubActor( &m_sprOpt[i] );
@@ -272,7 +256,7 @@ is terminated.
************************************/
ScreenEz2SelectStyle::~ScreenEz2SelectStyle()
{
LOG->WriteLine( "ScreenEz2SelectStyle::~ScreenEz2SelectStyle()" );
LOG->Trace( "ScreenEz2SelectStyle::~ScreenEz2SelectStyle()" );
}
@@ -299,7 +283,7 @@ Desc: Handles player input.
************************************/
void ScreenEz2SelectStyle::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenEz2SelectStyle::Input()" );
LOG->Trace( "ScreenEz2SelectStyle::Input()" );
if( m_Menu.IsClosing() )
return;
+7 -7
View File
@@ -81,7 +81,7 @@ const ScreenMessage SM_GoToScreenAfterFail = ScreenMessage(SM_User+125);
ScreenGameplay::ScreenGameplay()
{
LOG->WriteLine( "ScreenGameplay::ScreenGameplay()" );
LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
GAMESTATE->ResetStageStatistics(); // clear values
@@ -373,7 +373,7 @@ ScreenGameplay::ScreenGameplay()
ScreenGameplay::~ScreenGameplay()
{
LOG->WriteLine( "ScreenGameplay::~ScreenGameplay()" );
LOG->Trace( "ScreenGameplay::~ScreenGameplay()" );
for( int p=0; p<NUM_PLAYERS; p++ )
{
@@ -518,7 +518,7 @@ bool ScreenGameplay::AllFailedEarlier()
void ScreenGameplay::Update( float fDeltaTime )
{
//LOG->WriteLine( "ScreenGameplay::Update(%f)", fDeltaTime );
//LOG->Trace( "ScreenGameplay::Update(%f)", fDeltaTime );
Screen::Update( fDeltaTime );
m_soundMusic.Update( fDeltaTime );
@@ -542,7 +542,7 @@ void ScreenGameplay::Update( float fDeltaTime )
m_Background.SetSongBeat( fSongBeat, bFreeze, fPositionSeconds );
//LOG->WriteLine( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() );
//LOG->Trace( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() );
switch( m_DancingState )
@@ -662,7 +662,7 @@ void ScreenGameplay::DrawPrimitives()
void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
//LOG->WriteLine( "ScreenGameplay::Input()" );
//LOG->Trace( "ScreenGameplay::Input()" );
float fSongBeat, fBPS;
bool bFreeze;
@@ -697,7 +697,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
default: ASSERT(0);
}
if( type == IET_FAST_REPEAT )
fOffsetDelta *= 40;
fOffsetDelta *= 10;
BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( fSongBeat );
seg.m_fBPM += fOffsetDelta;
@@ -723,7 +723,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
default: ASSERT(0);
}
if( type == IET_FAST_REPEAT )
fOffsetDelta *= 40;
fOffsetDelta *= 10;
GAMESTATE->m_pCurSong->m_fBeat0OffsetInSeconds += fOffsetDelta;
+3 -3
View File
@@ -41,7 +41,7 @@ ScreenManager::ScreenManager()
ScreenManager::~ScreenManager()
{
LOG->WriteLine( "ScreenManager::~ScreenManager()" );
LOG->Trace( "ScreenManager::~ScreenManager()" );
// delete current states
for( int i=0; i<m_ScreenStack.GetSize(); i++ )
@@ -104,7 +104,7 @@ void ScreenManager::Draw()
void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenManager::Input( %d-%d, %d-%d, %d-%d, %d-%d )",
LOG->Trace( "ScreenManager::Input( %d-%d, %d-%d, %d-%d, %d-%d )",
DeviceI.device, DeviceI.button, GameI.controller, GameI.button, MenuI.player, MenuI.button, StyleI.player, StyleI.col );
// pass input only to topmost state
@@ -158,7 +158,7 @@ void ScreenManager::SystemMessage( CString sMessage )
m_textSystemMessage.BeginTweeningQueued( 1 );
m_textSystemMessage.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
LOG->WriteLine( "WARNING: Didn't find an empty system messages slot." );
LOG->Trace( "WARNING: Didn't find an empty system messages slot." );
}
+3 -2
View File
@@ -104,6 +104,7 @@ const CString CREDIT_LINES[] =
"Segapark - Bournemouth, UK",
"Pier Amusements - Bournemouth, UK",
"Westcliff Amusements - Bournemouth, UK",
"SailorBob",
"Naoki",
"Konami Computer Entertainment Japan",
"",
@@ -121,7 +122,7 @@ const int NUM_CREDIT_LINES = sizeof(CREDIT_LINES) / sizeof(CString);
ScreenMusicScroll::ScreenMusicScroll()
{
LOG->WriteLine( "ScreenMusicScroll::ScreenMusicScroll()" );
LOG->Trace( "ScreenMusicScroll::ScreenMusicScroll()" );
int i;
@@ -218,7 +219,7 @@ void ScreenMusicScroll::DrawPrimitives()
void ScreenMusicScroll::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenMusicScroll::Input()" );
LOG->Trace( "ScreenMusicScroll::Input()" );
if( m_Fade.IsClosing() )
return;
+4 -4
View File
@@ -41,7 +41,7 @@ const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User-6);
ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sTopEdgePath )
{
LOG->WriteLine( "ScreenOptions::ScreenOptions()" );
LOG->Trace( "ScreenOptions::ScreenOptions()" );
m_SoundChangeCol.Load( THEME->GetPathTo(SOUND_OPTION_CHANGE_COL) );
m_SoundChangeRow.Load( THEME->GetPathTo(SOUND_OPTION_CHANGE_ROW) );
@@ -92,7 +92,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sTopEdgePath )
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines )
{
LOG->WriteLine( "ScreenOptions::Set()" );
LOG->Trace( "ScreenOptions::Set()" );
m_InputMode = im;
@@ -108,7 +108,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
ScreenOptions::~ScreenOptions()
{
LOG->WriteLine( "ScreenOptions::~ScreenOptions()" );
LOG->Trace( "ScreenOptions::~ScreenOptions()" );
}
@@ -253,7 +253,7 @@ void ScreenOptions::TweenHighlight( PlayerNumber player_no )
void ScreenOptions::Update( float fDeltaTime )
{
//LOG->WriteLine( "ScreenOptions::Update(%f)", fDeltaTime );
//LOG->Trace( "ScreenOptions::Update(%f)", fDeltaTime );
Screen::Update( fDeltaTime );
}
+1 -1
View File
@@ -28,7 +28,7 @@ const int MAX_OPTIONS_PER_LINE = 20;
struct OptionLineData {
char szTitle[30];
int iNumOptions;
char szOptionsText[MAX_OPTIONS_PER_LINE][30];
char szOptionsText[MAX_OPTIONS_PER_LINE][60];
};
enum InputMode { INPUTMODE_P1_ONLY, INPUTMODE_2PLAYERS, INPUTMODE_BOTH }; // both means both players control the same cursor
+1 -1
View File
@@ -56,7 +56,7 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
)
{
LOG->WriteLine( "ScreenPlayerOptions::ScreenPlayerOptions()" );
LOG->Trace( "ScreenPlayerOptions::ScreenPlayerOptions()" );
Init(
INPUTMODE_2PLAYERS,
-6
View File
@@ -70,12 +70,6 @@ void ScreenSandbox::Input( const DeviceInput& DeviceI, const InputEventType type
break;
case MENU_BUTTON_RIGHT:
break;
case MENU_BUTTON_UP:
// m_BlurTest.StartFocusing();
break;
case MENU_BUTTON_DOWN:
// m_BlurTest.StartBlurring();
break;
case MENU_BUTTON_BACK:
//SCREENMAN->SetNewScreen( new ScreenTitleMenu );
return;
+3 -3
View File
@@ -52,7 +52,7 @@ const ScreenMessage SM_ConfirmChange = ScreenMessage(SM_User+3);
ScreenSelectCourse::ScreenSelectCourse()
{
LOG->WriteLine( "ScreenSelectCourse::ScreenSelectCourse()" );
LOG->Trace( "ScreenSelectCourse::ScreenSelectCourse()" );
m_bMadeChoice = false;
m_bGoToOptions = false;
@@ -97,7 +97,7 @@ ScreenSelectCourse::ScreenSelectCourse()
ScreenSelectCourse::~ScreenSelectCourse()
{
LOG->WriteLine( "ScreenSelectCourse::~ScreenSelectCourse()" );
LOG->Trace( "ScreenSelectCourse::~ScreenSelectCourse()" );
}
@@ -135,7 +135,7 @@ void ScreenSelectCourse::TweenOffScreen()
void ScreenSelectCourse::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenSelectCourse::Input()" );
LOG->Trace( "ScreenSelectCourse::Input()" );
if( m_Menu.IsClosing() )
return; // ignore
+3 -3
View File
@@ -76,7 +76,7 @@ const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4);
ScreenSelectDifficulty::ScreenSelectDifficulty()
{
LOG->WriteLine( "ScreenSelectDifficulty::ScreenSelectDifficulty()" );
LOG->Trace( "ScreenSelectDifficulty::ScreenSelectDifficulty()" );
// Reset the current PlayMode
GAMESTATE->m_PlayMode = PLAY_MODE_INVALID;
@@ -184,14 +184,14 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
ScreenSelectDifficulty::~ScreenSelectDifficulty()
{
LOG->WriteLine( "ScreenSelectDifficulty::~ScreenSelectDifficulty()" );
LOG->Trace( "ScreenSelectDifficulty::~ScreenSelectDifficulty()" );
}
void ScreenSelectDifficulty::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenSelectDifficulty::Input()" );
LOG->Trace( "ScreenSelectDifficulty::Input()" );
if( m_Menu.IsClosing() )
return;
+2 -2
View File
@@ -46,7 +46,7 @@ ScreenSelectGame::ScreenSelectGame() :
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
)
{
LOG->WriteLine( "ScreenSelectGame::ScreenSelectGame()" );
LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" );
// populate g_SelectGameLines
@@ -72,7 +72,7 @@ void ScreenSelectGame::ImportOptions()
void ScreenSelectGame::ExportOptions()
{
LOG->WriteLine("ScreenSelectGame::ExportOptions()");
LOG->Trace("ScreenSelectGame::ExportOptions()");
INPUTMAPPER->SaveMappingsToDisk(); // save mappings before switching the game
PREFSMAN->SaveGamePrefsToDisk();
+3 -3
View File
@@ -49,7 +49,7 @@ const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 3);
ScreenSelectGroup::ScreenSelectGroup()
{
LOG->WriteLine( "ScreenSelectGroup::ScreenSelectGroup()" );
LOG->Trace( "ScreenSelectGroup::ScreenSelectGroup()" );
int i;
@@ -344,14 +344,14 @@ ScreenSelectGroup::ScreenSelectGroup()
ScreenSelectGroup::~ScreenSelectGroup()
{
LOG->WriteLine( "ScreenSelectGroup::~ScreenSelectGroup()" );
LOG->Trace( "ScreenSelectGroup::~ScreenSelectGroup()" );
}
void ScreenSelectGroup::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenSelectGroup::Input()" );
LOG->Trace( "ScreenSelectGroup::Input()" );
if( m_Menu.IsClosing() || m_bChosen )
return;
+8 -8
View File
@@ -47,7 +47,7 @@ const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
ScreenSelectStyle::ScreenSelectStyle()
{
LOG->WriteLine( "ScreenSelectStyle::ScreenSelectStyle()" );
LOG->Trace( "ScreenSelectStyle::ScreenSelectStyle()" );
// Reset the current style and game
@@ -68,7 +68,7 @@ ScreenSelectStyle::ScreenSelectStyle()
Style style = m_aPossibleStyles[i];
m_sprIcon[i].Load( THEME->GetPathTo(GRAPHIC_SELECT_STYLE_ICONS) );
m_sprIcon[i].StopAnimating();
m_sprIcon[i].SetState( style );
m_sprIcon[i].SetState( i );
m_sprIcon[i].SetXY( ICONS_START_X + ICONS_SPACING_X*i, ICON_Y );
this->AddSubActor( &m_sprIcon[i] );
}
@@ -89,10 +89,10 @@ ScreenSelectStyle::ScreenSelectStyle()
{
ThemeElement te;
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0+m_aPossibleStyles[i]);
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_0+i);
m_sprDummyPreview[i].Load( THEME->GetPathTo(te) );
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0+m_aPossibleStyles[i]);
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_0+i);
m_sprDummyInfo[i].Load( THEME->GetPathTo(te) );
}
@@ -126,7 +126,7 @@ ScreenSelectStyle::ScreenSelectStyle()
ScreenSelectStyle::~ScreenSelectStyle()
{
LOG->WriteLine( "ScreenSelectStyle::~ScreenSelectStyle()" );
LOG->Trace( "ScreenSelectStyle::~ScreenSelectStyle()" );
}
void ScreenSelectStyle::DrawPrimitives()
@@ -138,7 +138,7 @@ void ScreenSelectStyle::DrawPrimitives()
void ScreenSelectStyle::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenSelectStyle::Input()" );
LOG->Trace( "ScreenSelectStyle::Input()" );
if( m_Menu.IsClosing() )
return;
@@ -177,7 +177,7 @@ void ScreenSelectStyle::AfterChange()
ThemeElement te;
// Tween Preview
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0+GetSelectedStyle());
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_0+m_iSelection);
m_sprPreview.Load( THEME->GetPathTo(te) );
m_sprPreview.StopTweening();
@@ -199,7 +199,7 @@ void ScreenSelectStyle::AfterChange()
// Tween Info
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0+GetSelectedStyle());
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_0+m_iSelection);
m_sprInfo.Load( THEME->GetPathTo(te) );
m_sprInfo.StopTweening();
m_sprInfo.SetZoomY( 0 );
+2 -2
View File
@@ -25,7 +25,7 @@
OptionLineData g_SongOptionsLines[] = {
{ "Life", 2, {"BAR","BATTERY"} },
{ "Life Type", 2, {"BAR","BATTERY"} },
{ "Bar Drain", 3, {"NORMAL","NO RECOVER","SUDDEN DEATH"} },
{ "Bat.Lives", 10, {"1","2","3","4","5","6","7","8","9","10"} },
{ "Fail", 3, {"ARCADE","END OF SONG","OFF"} },
@@ -53,7 +53,7 @@ ScreenSongOptions::ScreenSongOptions() :
THEME->GetPathTo(GRAPHIC_SONG_OPTIONS_TOP_EDGE)
)
{
LOG->WriteLine( "ScreenSongOptions::ScreenSongOptions()" );
LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" );
Init( INPUTMODE_BOTH,
g_SongOptionsLines,
+3 -3
View File
@@ -67,7 +67,7 @@ const ScreenMessage SM_GoToEz2 = ScreenMessage(SM_User+12);
ScreenTitleMenu::ScreenTitleMenu()
{
LOG->WriteLine( "ScreenTitleMenu::ScreenTitleMenu()" );
LOG->Trace( "ScreenTitleMenu::ScreenTitleMenu()" );
// reset game info
@@ -216,13 +216,13 @@ ScreenTitleMenu::ScreenTitleMenu()
ScreenTitleMenu::~ScreenTitleMenu()
{
LOG->WriteLine( "ScreenTitleMenu::~ScreenTitleMenu()" );
LOG->Trace( "ScreenTitleMenu::~ScreenTitleMenu()" );
}
void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenTitleMenu::Input()" );
LOG->Trace( "ScreenTitleMenu::Input()" );
if( m_Fade.IsClosing() )
return;
+129 -88
View File
@@ -22,7 +22,7 @@
#include "RageException.h"
const int FILE_CACHE_VERSION = 45; // increment this to force a cache reload (useful when the SM file format changes)
const int FILE_CACHE_VERSION = 53; // increment this to force a cache reload (useful when the SM file format changes)
int CompareBPMSegments(const void *arg1, const void *arg2)
@@ -139,7 +139,7 @@ void Song::AddAnimationSegment( AnimationSegment seg )
void Song::GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut, bool &bFreezeOut )
{
// LOG->WriteLine( "GetBeatAndBPSFromElapsedTime( fElapsedTime = %f )", fElapsedTime );
// LOG->Trace( "GetBeatAndBPSFromElapsedTime( fElapsedTime = %f )", fElapsedTime );
// This function is a nightmare. Don't even try to understand it. :-)
fElapsedTime += m_fBeat0OffsetInSeconds;
@@ -271,7 +271,7 @@ CString Song::GetSongFilePath()
bool Song::LoadFromSongDir( CString sDir )
{
LOG->WriteLine( "Song::LoadFromSongDir(%s)", sDir );
LOG->Trace( "Song::LoadFromSongDir(%s)", sDir );
// make sure there is a trailing '\\' at the end of sDir
if( sDir.Right(1) != "\\" )
@@ -298,7 +298,7 @@ bool Song::LoadFromSongDir( CString sDir )
ini.GetValueI( "Cache", "CacheVersion", iCacheVersion );
if( iCacheVersion != FILE_CACHE_VERSION )
{
LOG->WriteLine( "Cache format is out of date. Deleting all cache files." );
LOG->Trace( "Cache format is out of date. Deleting all cache files." );
CStringArray asCacheFileNames;
GetDirListing( "Cache\\*.*", asCacheFileNames );
for( int i=0; i<asCacheFileNames.GetSize(); i++ )
@@ -314,7 +314,7 @@ bool Song::LoadFromSongDir( CString sDir )
goto load_without_cache;
LoadFromSMFile( GetCacheFilePath() );
LOG->WriteLine( "Loading '%s' from cache file '%s'.", m_sSongDir, GetCacheFilePath() );
LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir, GetCacheFilePath() );
return true;
}
@@ -327,6 +327,10 @@ load_without_cache:
GetDirListing( sDir + CString("*.bms"), arrayBMSFileNames );
int iNumBMSFiles = arrayBMSFileNames.GetSize();
CStringArray arrayKSFFileNames;
GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames );
int iNumKSFFiles = arrayKSFFileNames.GetSize();
CStringArray arrayDWIFileNames;
GetDirListing( sDir + CString("*.dwi"), arrayDWIFileNames );
int iNumDWIFiles = arrayDWIFileNames.GetSize();
@@ -346,8 +350,13 @@ load_without_cache:
LoadFromDWIFile( sDir + arrayDWIFileNames[0] );
else if( iNumBMSFiles > 0 )
LoadFromBMSDir( sDir );
else if( iNumKSFFiles > 0 )
LoadFromKSFDir( sDir );
else
throw RageException( "Couldn't find any SM, BMS, or DWI files in '%s'. This is not a valid song directory.", sDir );
{
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'. This is not a valid song directory.", sDir );
return false;
}
TidyUpData();
@@ -360,7 +369,7 @@ load_without_cache:
bool Song::LoadFromBMSDir( CString sDir )
{
LOG->WriteLine( "Song::LoadFromBMSDir(%s)", sDir );
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir );
CStringArray arrayBMSFileNames;
GetDirListing( sDir + CString("*.bms"), arrayBMSFileNames );
@@ -441,7 +450,7 @@ bool Song::LoadFromBMSDir( CString sDir )
BPMSegment newSeg( 0, (float)atof(value_data) );
AddBPMSegment( newSeg );
LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
}
else if( value_name == "#backbmp" )
{
@@ -470,7 +479,7 @@ bool Song::LoadFromBMSDir( CString sDir )
}
const int iNumNotesInThisMeasure = arrayNotes.GetSize();
//LOG->WriteLine( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d",
//LOG->Trace( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d",
// valuename, sNoteData, iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure );
for( int j=0; j<iNumNotesInThisMeasure; j++ )
{
@@ -492,14 +501,14 @@ bool Song::LoadFromBMSDir( CString sDir )
float fBPS;
fBPS = m_BPMSegments[0].m_fBPM/60.0f;
m_fBeat0OffsetInSeconds = fBeatOffset / fBPS;
//LOG->WriteLine( "Found offset to be index %d, beat %f", iStepIndex, NoteRowToBeat(iStepIndex) );
//LOG->Trace( "Found offset to be index %d, beat %f", iStepIndex, NoteRowToBeat(iStepIndex) );
}
break;
case 3: // bpm change
{
BPMSegment newSeg( NoteRowToBeat(iStepIndex), (float)arrayNotes[j] );
AddBPMSegment( newSeg );
LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
}
break;
@@ -564,13 +573,13 @@ bool Song::LoadFromBMSDir( CString sDir )
if( fBPM == -1 ) // we didn't find the line we were looking for
{
LOG->WriteLine( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, sPath );
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, sPath );
}
else
{
BPMSegment newSeg( NoteRowToBeat(iStepIndex), fBPM );
AddBPMSegment( newSeg );
LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM );
}
file.Close();
@@ -642,13 +651,13 @@ bool Song::LoadFromBMSDir( CString sDir )
if( fFreezeSecs == -1 ) // we didn't find the line we were looking for
{
LOG->WriteLine( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, sPath );
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, sPath );
}
else
{
StopSegment newSeg( fFreezeStartBeat, fFreezeSecs );
AddStopSegment( newSeg );
LOG->WriteLine( "Inserting new Freeze at beat %f, secs %f", newSeg.m_fStartBeat, newSeg.m_fStopSeconds );
LOG->Trace( "Inserting new Freeze at beat %f, secs %f", newSeg.m_fStartBeat, newSeg.m_fStopSeconds );
}
file.Close();
@@ -661,7 +670,7 @@ bool Song::LoadFromBMSDir( CString sDir )
}
for( i=0; i<m_BPMSegments.GetSize(); i++ )
LOG->WriteLine( "There is a BPM change at beat %f, BPM %f, index %d",
LOG->Trace( "There is a BPM change at beat %f, BPM %f, index %d",
m_BPMSegments[i].m_fStartBeat, m_BPMSegments[i].m_fBPM, i );
file.Close();
@@ -672,92 +681,50 @@ bool Song::LoadFromBMSDir( CString sDir )
bool Song::LoadFromDWIFile( CString sPath )
{
LOG->WriteLine( "Song::LoadFromDWIFile(%s)", sPath );
LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath );
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
throw RageException( "Error opening DWI file '%s'.", sPath );
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
// read the whole file into a sFileText
CString sFileText;
CString buffer;
while( file.ReadString(buffer) )
sFileText += buffer + "\n";
file.Close();
// strip comments out of sFileText
while( sFileText.Find("//") != -1 )
for( int i=0; i<msd.m_iNumValues; i++ )
{
int iIndexCommentStart = sFileText.Find("//");
int iIndexCommentEnd = sFileText.Find("\n", iIndexCommentStart);
if( iIndexCommentEnd == -1 ) // comment doesn't have an end?
sFileText.Delete( iIndexCommentStart, 2 );
else
sFileText.Delete( iIndexCommentStart, iIndexCommentEnd-iIndexCommentStart );
}
// split sFileText into strings containing each value expression
CStringArray arrayValueStrings;
split( sFileText, ";", arrayValueStrings );
// for each value expression string, parse it into a value name and data
for( int i=0; i < arrayValueStrings.GetSize(); i++ )
{
CString sValueString = arrayValueStrings[i];
// split the value string into tokens
CStringArray arrayValueTokens;
split( sValueString, ":", arrayValueTokens, false );
for( int j=0; j<arrayValueTokens.GetSize(); j++ )
{
arrayValueTokens[j].TrimLeft();
arrayValueTokens[j].TrimRight();
}
if( arrayValueTokens.GetSize() == 0 )
continue;
CString sValueName = arrayValueTokens.GetAt( 0 );
int iNumParams = msd.m_iNumParams[i];
CString* sParams = msd.m_sValuesAndParams[i];
CString sValueName = sParams[0];
// handle the data
if( 0==stricmp(sValueName,"#FILE") )
m_sMusicFile = arrayValueTokens[1];
m_sMusicFile = sParams[1];
else if( 0==stricmp(sValueName,"#TITLE") )
GetMainAndSubTitlesFromFullTitle( arrayValueTokens[1], m_sMainTitle, m_sSubTitle );
GetMainAndSubTitlesFromFullTitle( sParams[1], m_sMainTitle, m_sSubTitle );
else if( 0==stricmp(sValueName,"#ARTIST") )
m_sArtist = arrayValueTokens[1];
m_sArtist = sParams[1];
else if( 0==stricmp(sValueName,"#CDTITLE") )
m_sCDTitleFile = arrayValueTokens[1];
m_sCDTitleFile = sParams[1];
else if( 0==stricmp(sValueName,"#BPM") )
{
BPMSegment new_seg;
new_seg.m_fStartBeat = 0;
new_seg.m_fBPM = (float)atof( arrayValueTokens[1] );
AddBPMSegment( BPMSegment(0, (float)atof(sParams[1])) );
m_BPMSegments.Add( new_seg );
SortBPMSegmentsArray( m_BPMSegments );
}
else if( 0==stricmp(sValueName,"#GAP") )
// the units of GAP is 1/1000 second
m_fBeat0OffsetInSeconds = -atoi( arrayValueTokens[1] ) / 1000.0f;
m_fBeat0OffsetInSeconds = -atoi( sParams[1] ) / 1000.0f;
else if( 0==stricmp(sValueName,"#SAMPLESTART") )
m_fMusicSampleStartSeconds = TimeToSeconds( arrayValueTokens[1] );
m_fMusicSampleStartSeconds = TimeToSeconds( sParams[1] );
else if( 0==stricmp(sValueName,"#SAMPLELENGTH") )
m_fMusicSampleLengthSeconds = TimeToSeconds( arrayValueTokens[1] );
m_fMusicSampleLengthSeconds = TimeToSeconds( sParams[1] );
else if( 0==stricmp(sValueName,"#FREEZE") )
{
CStringArray arrayFreezeExpressions;
split( arrayValueTokens[1], ",", arrayFreezeExpressions );
split( sParams[1], ",", arrayFreezeExpressions );
for( int f=0; f<arrayFreezeExpressions.GetSize(); f++ )
{
@@ -768,14 +735,14 @@ bool Song::LoadFromDWIFile( CString sPath )
float fFreezeSeconds = (float)atof( arrayFreezeValues[1] ) / 1000.0f;
AddStopSegment( StopSegment(fFreezeBeat, fFreezeSeconds) );
LOG->WriteLine( "Adding a freeze segment: beat: %f, seconds = %f", fFreezeBeat, fFreezeSeconds );
LOG->Trace( "Adding a freeze segment: beat: %f, seconds = %f", fFreezeBeat, fFreezeSeconds );
}
}
else if( 0==stricmp(sValueName,"#CHANGEBPM") || 0==stricmp(sValueName,"#BPMCHANGE") )
{
CStringArray arrayBPMChangeExpressions;
split( arrayValueTokens[1], ",", arrayBPMChangeExpressions );
split( sParams[1], ",", arrayBPMChangeExpressions );
for( int b=0; b<arrayBPMChangeExpressions.GetSize(); b++ )
{
@@ -796,11 +763,11 @@ bool Song::LoadFromDWIFile( CString sPath )
{
Notes* pNewNotes = new Notes;
pNewNotes->LoadFromDWITokens(
arrayValueTokens[0],
arrayValueTokens[1],
atoi(arrayValueTokens[2]),
arrayValueTokens[3],
arrayValueTokens.GetSize() == 5 ? arrayValueTokens[4] : ""
sParams[0],
sParams[1],
sParams[2],
sParams[3],
(iNumParams==5) ? sParams[4] : ""
);
m_apNotes.Add( pNewNotes );
}
@@ -815,7 +782,7 @@ bool Song::LoadFromDWIFile( CString sPath )
bool Song::LoadFromSMFile( CString sPath )
{
LOG->WriteLine( "Song::LoadFromSMDir(%s)", sPath );
LOG->Trace( "Song::LoadFromSMDir(%s)", sPath );
m_BPMSegments.RemoveAll();
m_StopSegments.RemoveAll();
@@ -830,6 +797,8 @@ bool Song::LoadFromSMFile( CString sPath )
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
for( i=0; i<msd.m_iNumValues; i++ )
{
@@ -902,7 +871,7 @@ bool Song::LoadFromSMFile( CString sPath )
new_seg.m_fStartBeat = fFreezeBeat;
new_seg.m_fStopSeconds = fFreezeSeconds;
LOG->WriteLine( "Adding a freeze segment: beat: %f, seconds = %f", new_seg.m_fStartBeat, new_seg.m_fStopSeconds );
LOG->Trace( "Adding a freeze segment: beat: %f, seconds = %f", new_seg.m_fStartBeat, new_seg.m_fStopSeconds );
AddStopSegment( new_seg );
}
@@ -965,13 +934,84 @@ bool Song::LoadFromSMFile( CString sPath )
}
else
LOG->WriteLine( "Unexpected value named '%s'", sValueName );
LOG->Trace( "Unexpected value named '%s'", sValueName );
}
return TRUE;
}
bool Song::LoadFromKSFDir( CString sDir )
{
LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir );
CStringArray arrayKSFFileNames;
GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames );
if( arrayKSFFileNames.GetSize() == 0 )
throw RageException( "Couldn't find any KSF files in '%s'", sDir );
// load the Notes from the rest of the KSF files
for( int i=0; i<arrayKSFFileNames.GetSize(); i++ )
{
Notes* pNewNotes = new Notes;
pNewNotes->LoadFromKSFFile( m_sSongDir + arrayKSFFileNames[i] );
m_apNotes.Add( pNewNotes );
}
CString sPath = m_sSongDir + arrayKSFFileNames[0];
// get group name
CStringArray sDirectoryParts;
split( m_sSongDir, "\\", sDirectoryParts, true );
m_sGroupName = sDirectoryParts[1];
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
for( i=0; i<msd.m_iNumValues; i++ )
{
int iNumParams = msd.m_iNumParams[i];
CString* sParams = msd.m_sValuesAndParams[i];
CString sValueName = sParams[0];
// handle the data
if( 0==stricmp(sValueName,"TITLE") )
{
//title is usually in format "artist - songtitle"
CStringArray asBits;
split( sParams[1], " - ", asBits, false );
if( asBits.GetSize() == 2 )
{
m_sArtist = asBits[0];
m_sMainTitle = asBits[1];
}
else
{
m_sMainTitle = asBits[0];
}
}
else if( 0==stricmp(sValueName,"BPM") )
AddBPMSegment( BPMSegment(0, (float)atof(sParams[1])) );
else if( 0==stricmp(sValueName,"STARTTIME") )
m_fBeat0OffsetInSeconds = -(float)atof(sParams[1])/100;
else
LOG->Trace( "Unexpected value named '%s'", sValueName );
}
m_sMusicFile = "song.mp3";
return TRUE;
}
void Song::TidyUpData()
{
m_sMainTitle.TrimRight();
@@ -1148,7 +1188,7 @@ void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo )
void Song::SaveToCacheFile()
{
LOG->WriteLine( "Song::SaveToCacheFile()" );
LOG->Trace( "Song::SaveToCacheFile()" );
//
// First look in the cache for this song (without loading NoteData)
@@ -1176,6 +1216,7 @@ void Song::SaveToSMFile( CString sPath )
CStringArray arrayOldFileNames;
GetDirListing( m_sSongDir + "*.bms", arrayOldFileNames );
GetDirListing( m_sSongDir + "*.dwi", arrayOldFileNames );
GetDirListing( m_sSongDir + "*.ksf", arrayOldFileNames );
for( int i=0; i<arrayOldFileNames.GetSize(); i++ )
{
@@ -1186,7 +1227,7 @@ void Song::SaveToSMFile( CString sPath )
}
LOG->WriteLine( "Song::SaveToSMDir('%s')", sPath );
LOG->Trace( "Song::SaveToSMDir('%s')", sPath );
int i;
+3 -3
View File
@@ -75,7 +75,7 @@ void SongManager::InitSongArrayFromDisk( void(*callback)() )
m_arrayGroupNames.Add( sGroupName );
}
LOG->WriteLine( "Found %d Songs.", m_pSongs.GetSize() );
LOG->Trace( "Found %d Songs.", m_pSongs.GetSize() );
}
void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
@@ -118,7 +118,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
if( arrayGroupBanners.GetSize() > 0 )
{
m_mapGroupToBannerPath[sGroupDirName] = ssprintf("%s\\%s\\%s", sDir, sGroupDirName, arrayGroupBanners[0] );
LOG->WriteLine( ssprintf("Group banner for '%s' is '%s'.", sGroupDirName, m_mapGroupToBannerPath[sGroupDirName]) );
LOG->Trace( ssprintf("Group banner for '%s' is '%s'.", sGroupDirName, m_mapGroupToBannerPath[sGroupDirName]) );
}
// Find all Song folders in this group directory
@@ -226,7 +226,7 @@ void SongManager::ReadStatisticsFromDisk()
IniFile ini;
ini.SetPath( g_sStatisticsFileName );
if( !ini.ReadFile() ) {
LOG->WriteLine( "WARNING: Could not read config file '%s'.", g_sStatisticsFileName );
LOG->Trace( "WARNING: Could not read config file '%s'.", g_sStatisticsFileName );
return; // load nothing
}
+3 -3
View File
@@ -33,7 +33,7 @@ Sprite::Sprite()
Sprite::~Sprite()
{
// LOG->WriteLine( "Sprite Destructor" );
// LOG->Trace( "Sprite Destructor" );
TEXTUREMAN->UnloadTexture( m_sTexturePath );
}
@@ -41,7 +41,7 @@ Sprite::~Sprite()
bool Sprite::LoadFromTexture( CString sTexturePath, bool bForceReload, int iMipMaps, int iAlphaBits, bool bDither, bool bStretch )
{
LOG->WriteLine( ssprintf("Sprite::LoadFromTexture(%s)", sTexturePath) );
LOG->Trace( ssprintf("Sprite::LoadFromTexture(%s)", sTexturePath) );
//Init();
return LoadTexture( sTexturePath, bForceReload, iMipMaps, iAlphaBits, bDither, bStretch );
@@ -57,7 +57,7 @@ bool Sprite::LoadFromTexture( CString sTexturePath, bool bForceReload, int iMipM
// Delay0000=2.0
bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMipMaps, int iAlphaBits, bool bDither, bool bStretch )
{
LOG->WriteLine( ssprintf("Sprite::LoadFromSpriteFile(%s)", sSpritePath) );
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", sSpritePath) );
//Init();
+50 -18
View File
@@ -1,4 +1,4 @@
// Microsoft Visual C++ generated resource script.
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
@@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// TEXTINCLUDE
//
1 TEXTINCLUDE
1 TEXTINCLUDE MOVEABLE PURE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
2 TEXTINCLUDE MOVEABLE PURE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
3 TEXTINCLUDE MOVEABLE PURE
BEGIN
"\r\n"
"\0"
@@ -52,7 +52,7 @@ END
// Accelerator
//
IDR_MAIN_ACCEL ACCELERATORS
IDR_MAIN_ACCEL ACCELERATORS MOVEABLE PURE
BEGIN
VK_F5, IDM_CHANGEDETAIL, VIRTKEY, NOINVERT
"X", IDM_EXIT, VIRTKEY, ALT, NOINVERT
@@ -68,8 +68,9 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON ICON "StepMania.ICO"
IDI_ICON ICON DISCARDABLE "StepMania.ICO"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
@@ -92,14 +93,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "http://www.stepmania.com"
VALUE "FileDescription", "StepMania"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "StepMania"
VALUE "LegalCopyright", "Copyright © 2001-2002"
VALUE "OriginalFilename", "StepMania.exe"
VALUE "ProductName", " StepMania"
VALUE "ProductVersion", "1, 0, 0, 1"
VALUE "CompanyName", "http://www.stepmania.com\0"
VALUE "FileDescription", "StepMania\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "StepMania\0"
VALUE "LegalCopyright", "Copyright © 2001-2002\0"
VALUE "OriginalFilename", "StepMania.exe\0"
VALUE "ProductName", " StepMania\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
@@ -108,14 +109,16 @@ BEGIN
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
BITMAP_ERROR BITMAP "error.bmp"
BITMAP_SPLASH BITMAP "splash.bmp"
BITMAP_ERROR BITMAP MOVEABLE PURE "error.bmp"
BITMAP_LOADING BITMAP DISCARDABLE "loading.bmp"
/////////////////////////////////////////////////////////////////////////////
//
@@ -123,9 +126,9 @@ BITMAP_SPLASH BITMAP "splash.bmp"
//
IDD_ERROR_DIALOG DIALOGEX 0, 0, 332, 234
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
CAPTION "StepMania Error"
FONT 8, "MS Sans Serif", 0, 0, 0x0
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT_ERROR,5,80,320,130,ES_MULTILINE |
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | NOT
@@ -139,6 +142,35 @@ BEGIN
PUSHBUTTON "View Log",IDC_BUTTON_VIEW_LOG,8,215,74,15
END
IDD_LOADING_DIALOG DIALOG DISCARDABLE 0, 0, 312, 78
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
CONTROL 117,IDC_STATIC,"Static",SS_BITMAP,0,0,312,38
CTEXT "line1",IDC_STATIC_MESSAGE1,0,41,310,10,SS_CENTERIMAGE
CTEXT "line2",IDC_STATIC_MESSAGE2,0,54,310,10,SS_CENTERIMAGE
CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_CENTERIMAGE
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_LOADING_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 305
TOPMARGIN, 7
BOTTOMMARGIN, 71
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
+122 -42
View File
@@ -76,14 +76,12 @@
const CString g_sAppName = "StepMania";
const CString g_sAppClassName = "StepMania Class";
HWND g_hWndMain; // Main Window Handle
HINSTANCE g_hInstance; // The Handle to Window Instance
HWND g_hWndMain; // Main Window Handle
HWND g_hWndLoading; // Loading Window Handle
HANDLE g_hMutex; // Used to check if an instance of our app is already
const DWORD g_dwWindowStyle = WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU;
BOOL g_bIsActive = FALSE; // Whether the focus is on our app
const DWORD g_dwWindowStyle = WS_POPUP|WS_CAPTION|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU;
BOOL g_bIsActive = FALSE; // Whether the focus is on our app
//-----------------------------------------------------------------------------
@@ -92,6 +90,7 @@ BOOL g_bIsActive = FALSE; // Whether the focus is on our app
// Main game functions
LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK LoadingWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ); // windows entry point
void MainLoop(); // put everything in here so we can wrap it in a try...catch block
@@ -105,6 +104,10 @@ HRESULT InvalidateObjects(); // invalidate game objects before a display mode
HRESULT RestoreObjects(); // restore game objects after a display mode change
VOID DestroyObjects(); // deallocate game objects when we're done with them
void CreateLoadingWindow();
void PaintLoadingWindow();
void DestroyLoadingWindow();
void ApplyGraphicOptions(); // Set the display mode according to the user's preferences
CString g_sErrorString;
@@ -143,10 +146,15 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
{
_set_se_translator( StructuredExceptionHandler );
g_hInstance = hInstance;
#ifndef _DEBUG
try
{
#endif
CreateLoadingWindow();
//
// Check to see if the app is already running.
//
@@ -243,7 +251,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
if( NULL == g_hWndMain )
exit(1);
//ShowWindow( g_hWndMain, SW_HIDE );
ShowWindow( g_hWndMain, SW_HIDE );
// Load keyboard accelerators
@@ -252,7 +260,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
// run the game
CreateObjects( g_hWndMain ); // Create the game objects
//ShowWindow( g_hWndMain, SW_SHOW );
// Now we're ready to recieve and process Windows messages.
MSG msg;
@@ -277,17 +284,18 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
{
Update();
Render();
if( DISPLAY && DISPLAY->IsWindowed() )
if( !g_bIsActive && DISPLAY && DISPLAY->IsWindowed() )
::Sleep( 0 ); // give some time to other processes
}
} // end while( WM_QUIT != msg.message )
LOG->WriteLine( "Recieved WM_QUIT message. Shutting down..." );
LOG->Trace( "Recieved WM_QUIT message. Shutting down..." );
// clean up after a normal exit
DestroyObjects(); // deallocate our game objects and leave fullscreen
ShowWindow( g_hWndMain, SW_HIDE );
#ifndef _DEBUG
}
catch( RageException e )
@@ -305,8 +313,12 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
if( g_sErrorString != "" )
{
if( LOG )
LOG->WriteLine(
{
LOG->Flush();
LOG->Trace(
"\n"
"//////////////////////////////////////////////////////\n"
"Exception: %s\n"
@@ -317,11 +329,14 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
// throw up a pretty error dialog
DialogBox(
hInstance,
g_hInstance,
MAKEINTRESOURCE(IDD_ERROR_DIALOG),
NULL,
ErrorWndProc
);
}
}
#endif
@@ -334,6 +349,78 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
}
void CreateLoadingWindow()
{
// throw up a pretty error dialog
g_hWndLoading = CreateDialog(
g_hInstance,
MAKEINTRESOURCE(IDD_LOADING_DIALOG),
NULL,
LoadingWndProc
);
}
void PaintLoadingWindow()
{
SendMessage( g_hWndLoading, WM_PAINT, 0, 0 );
}
void DestroyLoadingWindow()
{
EndDialog( g_hWndLoading, 0 );
}
//-----------------------------------------------------------------------------
// Name: LoadingWndProc()
// Desc: Callback for all Windows messages
//-----------------------------------------------------------------------------
BOOL CALLBACK LoadingWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_INITDIALOG:
{
}
break;
case WM_COMMAND:
break;
case WM_PAINT:
{
CStringArray asMessageLines;
if( GAMESTATE )
split( GAMESTATE->m_sLoadingMessage, "\n", asMessageLines, false );
else
asMessageLines.Add( "Initializing hardware" );
SendDlgItemMessage(
hWnd,
IDC_STATIC_MESSAGE1,
WM_SETTEXT,
0,
(LPARAM)(LPCTSTR)asMessageLines[0]
);
SendDlgItemMessage(
hWnd,
IDC_STATIC_MESSAGE2,
WM_SETTEXT,
0,
(LPARAM)(LPCTSTR)(asMessageLines.GetSize()>=2 ? asMessageLines[1] : "")
);
SendDlgItemMessage(
hWnd,
IDC_STATIC_MESSAGE3,
WM_SETTEXT,
0,
(LPARAM)(LPCTSTR)(asMessageLines.GetSize()>=3 ? asMessageLines[2] : "")
);
}
break;
}
return FALSE;
}
//-----------------------------------------------------------------------------
// Name: ErrorWndProc()
// Desc: Callback for all Windows messages
@@ -344,8 +431,6 @@ BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
case WM_INITDIALOG:
{
LOG->Flush();
CString sMessage = g_sErrorString;
sMessage.Replace( "\n", "\r\n" );
@@ -526,17 +611,18 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
}
//-----------------------------------------------------------------------------
// Name: CreateObjects()
// Desc:
//-----------------------------------------------------------------------------
HRESULT CreateObjects( HWND hWnd )
{
/*
//
// Draw a splash bitmap so the user isn't looking at a black Window
//
/* HBITMAP hSplashBitmap = (HBITMAP)LoadImage(
HBITMAP hSplashBitmap = (HBITMAP)LoadImage(
GetModuleHandle( NULL ),
TEXT("BITMAP_SPLASH"),
IMAGE_BITMAP,
@@ -554,10 +640,11 @@ HRESULT CreateObjects( HWND hWnd )
hDCImage, 0, 0,
bmp.bmWidth, bmp.bmHeight, SRCCOPY );
DeleteDC( hDCImage );
ReleaseDC( hWnd, hDCWindow );
// Delete the bitmap
DeleteObject( hSplashBitmap );
ReleaseDC( hWnd, hDCWindow );
*/
@@ -568,7 +655,7 @@ HRESULT CreateObjects( HWND hWnd )
LOG = new RageLog();
#ifdef _DEBUG
LOG->ShowConsole();
LOG->ShowConsole();
#endif
TIMER = new RageTimer;
GAMESTATE = new GameState;
@@ -582,8 +669,13 @@ HRESULT CreateObjects( HWND hWnd )
INPUTFILTER = new InputFilter();
INPUTMAPPER = new InputMapper();
INPUTQUEUE = new InputQueue();
SONGMAN = new SongManager( PaintLoadingWindow ); // this takes a long time to load
DISPLAY = new RageDisplay( hWnd );
DestroyLoadingWindow();
ShowWindow( g_hWndMain, SW_SHOW ); // show the window
// We can't do any texture loading unless the D3D device is created.
// Set the display mode to make sure the D3D device is created.
ApplyGraphicOptions();
@@ -596,17 +688,9 @@ HRESULT CreateObjects( HWND hWnd )
FONT = new FontManager;
SCREENMAN = new ScreenManager;
SCREENMAN->SetNewScreen( new ScreenLoading );
Update();
Render();
::Sleep( 10000 );
SONGMAN = new SongManager( Render ); // this takes a long time to load
BringWindowToTop( hWnd );
SetForegroundWindow( hWnd );
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
//SCREENMAN->SetNewScreen( new ScreenLoading );
//SCREENMAN->SetNewScreen( new ScreenSandbox );
@@ -738,27 +822,23 @@ void Update()
ieArray.SetSize( 0, 20 ); // zero the array
INPUTFILTER->GetInputEvents( ieArray, fDeltaTime );
DeviceInput DeviceI;
InputEventType type;
GameInput GameI;
MenuInput MenuI;
StyleInput StyleI;
for( int i=0; i<ieArray.GetSize(); i++ )
{
DeviceI = (DeviceInput)ieArray[i];
type = ieArray[i].type;
DeviceInput DeviceI = (DeviceInput)ieArray[i];
InputEventType type = ieArray[i].type;
GameInput GameI;
MenuInput MenuI;
StyleInput StyleI;
INPUTMAPPER->DeviceToGame( DeviceI, GameI );
INPUTMAPPER->GameToMenu( GameI, MenuI );
if( !MenuI.IsValid() ) // try again
MenuI = INPUTMAPPER->DeviceToMenu( DeviceI );
if( MenuI.IsValid() && type == IET_FIRST_PRESS )
INPUTQUEUE->HandleInput( MenuI.player, MenuI.button );
INPUTMAPPER->GameToStyle( GameI, StyleI );
if( GameI.IsValid() && type == IET_FIRST_PRESS )
INPUTQUEUE->RememberInput( GameI );
if( GameI.IsValid() )
{
INPUTMAPPER->GameToMenu( GameI, MenuI );
INPUTMAPPER->GameToStyle( GameI, StyleI );
}
SCREENMAN->Input( DeviceI, type, GameI, MenuI, StyleI );
}
+4
View File
@@ -1213,6 +1213,10 @@ SOURCE=.\error.bmp
# End Source File
# Begin Source File
SOURCE=.\loading.bmp
# End Source File
# Begin Source File
SOURCE=.\splash.bmp
# End Source File
# End Target
+3
View File
@@ -1002,6 +1002,9 @@
<File
RelativePath=".\error.bmp">
</File>
<File
RelativePath="loading.bmp">
</File>
<File
RelativePath=".\splash.bmp">
</File>
+27 -1
View File
@@ -29,4 +29,30 @@ void StyleDef::GetTransformedNoteDataForStyle( PlayerNumber p, NoteData* pOrigin
}
pNoteDataOut->LoadTransformed( pOriginal, m_iColsPerPlayer, iNewToOriginalTrack );
}
}
GameInput StyleDef::StyleInputToGameInput( const StyleInput StyleI )
{
GameController c = m_ColumnInfo[StyleI.player][StyleI.col].controller;
GameButton b = m_ColumnInfo[StyleI.player][StyleI.col].button;
return GameInput( c, b );
};
StyleInput StyleDef::GameInputToStyleInput( const GameInput &GameI )
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
{
if( m_ColumnInfo[p][t].controller == GameI.controller &&
m_ColumnInfo[p][t].button == GameI.button )
{
return StyleInput( (PlayerNumber)p, t );
}
}
}
return StyleInput(); // Didn't find a match. Return invalid.
}
+7 -27
View File
@@ -24,6 +24,7 @@
#include "NoteData.h"
#include "StyleInput.h"
#include "GameInput.h"
#include "MenuInput.h"
const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS;
@@ -48,38 +49,17 @@ public:
int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double)
struct ColumnInfo
{
int track; // take note data from this track
GameController number; // use this instrument to hit a note on this track
GameButton button; // use this button to hit a note on this track
float fXOffset; // x position of the column relative to player center
int track; // take note data from this track
GameController controller; // use this instrument to hit a note on this track
GameButton button; // use this button to hit a note on this track
float fXOffset; // x position of the column relative to player center
};
ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
inline GameInput StyleInputToGameInput( const StyleInput StyleI )
{
GameController n = m_ColumnInfo[StyleI.player][StyleI.col].number;
GameButton b = m_ColumnInfo[StyleI.player][StyleI.col].button;
return GameInput( n, b );
};
inline StyleInput StyleDef::GameInputToStyleInput( const GameInput &GameI )
{
for( int p=0; p<NUM_PLAYERS; p++ )
{
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
{
if( m_ColumnInfo[p][t].number == GameI.controller &&
m_ColumnInfo[p][t].button == GameI.button )
{
return StyleInput( (PlayerNumber)p, t );
}
}
}
return StyleInput(); // Didn't find a match. Return blank.
}
GameInput StyleInputToGameInput( const StyleInput StyleI );
StyleInput GameInputToStyleInput( const GameInput &GameI );
void GetTransformedNoteDataForStyle( PlayerNumber p, NoteData* pOriginal, NoteData* pNoteDataOut );
};
+6 -8
View File
@@ -13,15 +13,13 @@
struct StyleInput
{
StyleInput() { player = PLAYER_INVALID; col = -1; };
PlayerNumber player;
int col;
StyleInput() { MakeInvalid(); };
StyleInput( PlayerNumber p, int c ) { player = p; col = c; };
bool operator==( const StyleInput &other ) { return player == other.player && col == other.col; };
PlayerNumber player;
int col;
inline bool IsBlank() const { return player == PLAYER_INVALID; };
inline bool IsValid() const { return !IsBlank(); };
inline void MakeBlank() { player = PLAYER_INVALID; col = -1; };
inline bool IsValid() const { return player != PLAYER_INVALID; };
inline void MakeInvalid() { player = PLAYER_INVALID; col = -1; };
};
+37 -24
View File
@@ -14,7 +14,8 @@
#include "RageLog.h"
#include "PrefsManager.h"
#include "RageException.h"
#include "GameState.h"
#include "GameDef.h"
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
@@ -28,15 +29,13 @@ ThemeManager::ThemeManager()
m_sCurThemeName = BASE_THEME_NAME; // Use te base theme for now. It's up to PrefsManager to change this.
CStringArray arrayThemeNames;
GetThemeNames( arrayThemeNames );
GetAllThemeNames( arrayThemeNames );
#ifdef _DEBUG
for( int i=0; i<arrayThemeNames.GetSize(); i++ )
AssertThemeIsComplete( arrayThemeNames[i] );
#endif
}
void ThemeManager::GetThemeNames( CStringArray& AddTo )
void ThemeManager::GetAllThemeNames( CStringArray& AddTo )
{
GetDirListing( THEMES_DIR+"\\*", AddTo, true );
@@ -46,10 +45,26 @@ void ThemeManager::GetThemeNames( CStringArray& AddTo )
AddTo.RemoveAt(i);
}
void ThemeManager::GetThemeNamesForCurGame( CStringArray& AddTo )
{
GetAllThemeNames( AddTo );
// strip out announcers that don't have the current game name in them
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
sGameName.MakeLower();
for( int i=AddTo.GetSize()-1; i>=0; i-- )
{
CString sLowercaseVer = AddTo[i];
sLowercaseVer.MakeLower();
if( sLowercaseVer.Find(sGameName)==-1 )
AddTo.RemoveAt(i);
}
}
bool ThemeManager::DoesThemeExist( CString sThemeName )
{
CStringArray asThemeNames;
GetThemeNames( asThemeNames );
GetAllThemeNames( asThemeNames );
for( int i=0; i<asThemeNames.GetSize(); i++ )
{
if( 0==stricmp(sThemeName, asThemeNames[i]) )
@@ -67,8 +82,8 @@ void ThemeManager::AssertThemeIsComplete( CString sThemeName )
void ThemeManager::SwitchTheme( CString sThemeName )
{
if( m_sCurThemeName == "" )
m_sCurThemeName = BASE_THEME_NAME;
if( 0==stricmp(BASE_THEME_NAME, sThemeName) )
m_sCurThemeName = ""; // can't select the base theme
else if( !DoesThemeExist(sThemeName) )
m_sCurThemeName = BASE_THEME_NAME;
else
@@ -130,6 +145,8 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName )
case GRAPHIC_GAMEPLAY_ONI_GAMEOVER: sAssetPrefix = "Graphics\\gameplay oni gameover"; break;
case GRAPHIC_LOADING: sAssetPrefix = "Graphics\\loading"; break;
case GRAPHIC_KEEP_ALIVE: sAssetPrefix = "Graphics\\keep alive"; break;
case GRAPHIC_MAP_CONTROLLERS_BACKGROUND: sAssetPrefix = "Graphics\\map controllers background"; break;
case GRAPHIC_MAP_CONTROLLERS_TOP_EDGE: sAssetPrefix = "Graphics\\map controllers top edge"; break;
case GRAPHIC_MENU_BOTTOM_EDGE: sAssetPrefix = "Graphics\\menu bottom edge"; break;
case GRAPHIC_MENU_STYLE_ICONS: sAssetPrefix = "Graphics\\menu style icons"; break;
case GRAPHIC_MUSIC_SCROLL_BACKGROUND: sAssetPrefix = "Graphics\\music scroll background"; break;
@@ -201,22 +218,18 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName )
case GRAPHIC_SELECT_STYLE_EXPLANATION: sAssetPrefix = "Graphics\\select Style explanation"; break;
case GRAPHIC_SELECT_STYLE_TOP_EDGE: sAssetPrefix = "Graphics\\select Style top edge"; break;
case GRAPHIC_SELECT_STYLE_ICONS: sAssetPrefix = "Graphics\\select Style icons"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0: sAssetPrefix = "Graphics\\select style info game 0 style 0"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_1: sAssetPrefix = "Graphics\\select style info game 0 style 1"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style info game 0 style 2"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style info game 0 style 3"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style info game 0 style 4"; break;
// case GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_0: sAssetPrefix = "Graphics\\select style info game 1 style 0"; break;
// case GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_1: sAssetPrefix = "Graphics\\select style info game 1 style 1"; break;
// case GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_2: sAssetPrefix = "Graphics\\select style info game 1 style 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 0 style 0"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 0 style 1"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 0 style 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style preview game 0 style 3"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style preview game 0 style 4"; break;
// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 1 style 0"; break;
// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 1 style 1"; break;
// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 1 style 2"; break;
case GRAPHIC_SELECT_STYLE_INFO_0: sAssetPrefix = "Graphics\\select style info 0"; break;
case GRAPHIC_SELECT_STYLE_INFO_1: sAssetPrefix = "Graphics\\select style info 1"; break;
case GRAPHIC_SELECT_STYLE_INFO_2: sAssetPrefix = "Graphics\\select style info 2"; break;
case GRAPHIC_SELECT_STYLE_INFO_3: sAssetPrefix = "Graphics\\select style info 3"; break;
case GRAPHIC_SELECT_STYLE_INFO_4: sAssetPrefix = "Graphics\\select style info 4"; break;
case GRAPHIC_SELECT_STYLE_INFO_5: sAssetPrefix = "Graphics\\select style info 5"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_0: sAssetPrefix = "Graphics\\select style preview 0"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_1: sAssetPrefix = "Graphics\\select style preview 1"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_2: sAssetPrefix = "Graphics\\select style preview 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_3: sAssetPrefix = "Graphics\\select style preview 3"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_4: sAssetPrefix = "Graphics\\select style preview 4"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_5: sAssetPrefix = "Graphics\\select style preview 5"; break;
case GRAPHIC_SONG_OPTIONS_BACKGROUND: sAssetPrefix = "Graphics\\song options background"; break;
case GRAPHIC_SONG_OPTIONS_TOP_EDGE: sAssetPrefix = "Graphics\\song options top edge"; break;
case GRAPHIC_TITLE_MENU_BACKGROUND: sAssetPrefix = "Graphics\\title menu background"; break;
+17 -17
View File
@@ -54,6 +54,8 @@ enum ThemeElement {
GRAPHIC_GAMEPLAY_ONI_GAMEOVER,
GRAPHIC_LOADING,
GRAPHIC_KEEP_ALIVE,
GRAPHIC_MAP_CONTROLLERS_BACKGROUND,
GRAPHIC_MAP_CONTROLLERS_TOP_EDGE,
GRAPHIC_MENU_BOTTOM_EDGE,
GRAPHIC_MENU_STYLE_ICONS,
GRAPHIC_MUSIC_SORT_ICONS,
@@ -125,22 +127,18 @@ enum ThemeElement {
GRAPHIC_SELECT_STYLE_TOP_EDGE,
GRAPHIC_SELECT_STYLE_EXPLANATION,
GRAPHIC_SELECT_STYLE_ICONS,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_1,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4,
// GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_0,
// GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_1,
// GRAPHIC_SELECT_STYLE_INFO_GAME_CONTROLLER_1_STYLE_2,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4,
// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_0,
// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_1,
// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_CONTROLLER_1_STYLE_2,
GRAPHIC_SELECT_STYLE_INFO_0,
GRAPHIC_SELECT_STYLE_INFO_1,
GRAPHIC_SELECT_STYLE_INFO_2,
GRAPHIC_SELECT_STYLE_INFO_3,
GRAPHIC_SELECT_STYLE_INFO_4,
GRAPHIC_SELECT_STYLE_INFO_5,
GRAPHIC_SELECT_STYLE_PREVIEW_0,
GRAPHIC_SELECT_STYLE_PREVIEW_1,
GRAPHIC_SELECT_STYLE_PREVIEW_2,
GRAPHIC_SELECT_STYLE_PREVIEW_3,
GRAPHIC_SELECT_STYLE_PREVIEW_4,
GRAPHIC_SELECT_STYLE_PREVIEW_5,
GRAPHIC_SONG_OPTIONS_BACKGROUND,
GRAPHIC_SONG_OPTIONS_TOP_EDGE,
GRAPHIC_TITLE_MENU_BACKGROUND,
@@ -201,7 +199,7 @@ class ThemeManager
public:
ThemeManager();
void GetThemeNames( CStringArray& AddTo );
void GetThemeNamesForCurGame( CStringArray& AddTo );
bool DoesThemeExist( CString sThemeName );
void AssertThemeIsComplete( CString sThemeName );
void SwitchTheme( CString sThemeName );
@@ -210,6 +208,8 @@ public:
CString GetPathTo( ThemeElement te ); // looks up the current theme in PREFSMAN
protected:
void GetAllThemeNames( CStringArray& AddTo );
CString GetPathTo( ThemeElement te, CString sThemeName );
static CString GetThemeDirFromName( CString sAnnouncerName );
+1 -1
View File
@@ -21,7 +21,7 @@ const float TIP_SHOW_TIME = 3.5f;
TipDisplay::TipDisplay()
{
LOG->WriteLine( "TipDisplay::TipDisplay()" );
LOG->Trace( "TipDisplay::TipDisplay()" );
m_textTip.Load( THEME->GetPathTo(FONT_NORMAL) );
m_textTip.SetEffectBlinking();
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+8 -3
View File
@@ -1,8 +1,10 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Microsoft Developer Studio generated include file.
// Used by StepMania.RC
//
#define IDD_ERROR_DIALOG 111
#define IDD_LOADING_DIALOG 116
#define BITMAP_LOADING 117
#define BITMAP_ERROR 129
#define IDC_SHOCKWAVEFLASH1 1000
#define IDR_MAIN_ACCEL 1001
@@ -18,15 +20,18 @@
#define IDM_TOGGLESTATISTICS 1006
#define IDI_ICON 1007
#define IDC_CURSOR 1008
#define IDC_STATIC_MESSAGE1 1010
#define IDC_STATIC_MESSAGE2 1011
#define IDC_STATIC_MESSAGE3 1013
#define IDM_EXIT 40003
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 115
#define _APS_NEXT_RESOURCE_VALUE 118
#define _APS_NEXT_COMMAND_VALUE 40009
#define _APS_NEXT_CONTROL_VALUE 1009
#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+2 -1
View File
@@ -52,6 +52,7 @@ public:
bool LoadFromDWIFile( CString sPath );
bool LoadFromBMSDir( CString sDir );
bool LoadFromSMFile( CString sPath );
bool LoadFromKSFDir( CString sDir );
void TidyUpData(); // call after loading to clean up invalid data
@@ -90,7 +91,7 @@ public:
CString m_sCDTitleFile;
CString m_sMovieBackgroundFile;
CString GetMusicPath() {return m_sSongDir+m_sMusicFile; };
CString GetMusicPath() {return m_sMusicFile.Find('.')==0 ? m_sMusicFile : m_sSongDir+m_sMusicFile; };
CString GetBannerPath() {return m_sSongDir+m_sBannerFile; };
CString GetBackgroundPath() {return m_sSongDir+m_sBackgroundFile; };
CString GetCDTitlePath() {return m_sCDTitleFile.Find('.')==0 ? m_sCDTitleFile : m_sSongDir+m_sCDTitleFile; };