diff --git a/stepmania/README-FIRST.TXT b/stepmania/README-FIRST.TXT index 427168f486..f0f8c27f60 100644 --- a/stepmania/README-FIRST.TXT +++ b/stepmania/README-FIRST.TXT @@ -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. - * I’m 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!) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index ebcc812863..d4771019fc 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -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; diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index bae03f7f75..89e8b386dd 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -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 ); diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index e67424fbb1..baae4ba3f0 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -23,7 +23,7 @@ const CString ANNOUNCER_BASE_DIR = "Announcers\\"; AnnouncerManager::AnnouncerManager() { - LOG->WriteLine("AnnouncerManager::AnnouncerManager()"); + LOG->Trace("AnnouncerManager::AnnouncerManager()"); CStringArray arrayAnnouncerNames; GetAnnouncerNames( arrayAnnouncerNames ); diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 507c677e51..6f2fdeef8c 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -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; diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 6c6d9387ba..2c15c85460 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -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(); diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 8afd9da668..6f5b23345d 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -87,7 +87,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray &apSongs ) } else - LOG->WriteLine( "Unexpected value named '%s'", sValueName ); + LOG->Trace( "Unexpected value named '%s'", sValueName ); } } diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 673c8f350f..97ed6b8fee 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -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; iWriteLine( "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) ); } } diff --git a/stepmania/src/GameDef.cpp b/stepmania/src/GameDef.cpp index 190922f7ef..d32673ecbe 100644 --- a/stepmania/src/GameDef.cpp +++ b/stepmania/src/GameDef.cpp @@ -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; iGetCurrentStyleDef()->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 &arrayTweenColors ); CString ElementToGraphicSuffix( const SkinElement gbg ); - - - inline MenuInput GameInputToMenuInput( const GameInput GameI ) - { - PlayerNumber p = (PlayerNumber)GameI.controller; - for( int b=0; b // 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]; diff --git a/stepmania/src/HoldJudgement.cpp b/stepmania/src/HoldJudgement.cpp index eb05d744c7..b9d150566d 100644 --- a/stepmania/src/HoldJudgement.cpp +++ b/stepmania/src/HoldJudgement.cpp @@ -46,7 +46,7 @@ void HoldJudgement::DrawPrimitives() void HoldJudgement::SetHoldJudgement( HoldNoteScore hns ) { - //LOG->WriteLine( "Judgement::SetJudgement()" ); + //LOG->Trace( "Judgement::SetJudgement()" ); switch( hns ) { diff --git a/stepmania/src/IniFile.cpp b/stepmania/src/IniFile.cpp index 187adf9c88..9bece009dc 100644 --- a/stepmania/src/IniFile.cpp +++ b/stepmania/src/IniFile.cpp @@ -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); } diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 1609f176f2..ee696b2bcd 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -84,4 +84,4 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) } } } -} \ No newline at end of file +} diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index a197d78d98..f2f287205c 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -55,3 +55,4 @@ public: extern InputFilter* INPUTFILTER; // global and accessable from anywhere in our program + diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index cf3e111f69..07d804a79c 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -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; iGetCurrentGameDef(); + for( int c=0; cm_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; inames.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; inames.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; im_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= 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--; diff --git a/stepmania/src/InputQueue.h b/stepmania/src/InputQueue.h index 498936f563..27d6c8ec62 100644 --- a/stepmania/src/InputQueue.h +++ b/stepmania/src/InputQueue.h @@ -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 m_aQueue[NUM_PLAYERS]; + CArray m_aQueue[MAX_GAME_CONTROLLERS]; }; diff --git a/stepmania/src/Judgement.cpp b/stepmania/src/Judgement.cpp index aaa79f852e..80681743c1 100644 --- a/stepmania/src/Judgement.cpp +++ b/stepmania/src/Judgement.cpp @@ -48,7 +48,7 @@ void Judgement::DrawPrimitives() void Judgement::SetJudgement( TapNoteScore score ) { - //LOG->WriteLine( "Judgement::SetJudgement()" ); + //LOG->Trace( "Judgement::SetJudgement()" ); switch( score ) { diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 7bf26049b0..71755be881 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -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 ); diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index ab42db7bd3..cd2eb1b451 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -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 ); } } diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index fc59e5db17..ddad02cfe8 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -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 ); diff --git a/stepmania/src/MenuInput.h b/stepmania/src/MenuInput.h index bcab3a861e..ba74cddd9e 100644 --- a/stepmania/src/MenuInput.h +++ b/stepmania/src/MenuInput.h @@ -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; }; }; + diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 6c97516173..a7e54881db 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -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 ) { diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 5e9aecd436..bf73754db2 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -789,7 +789,7 @@ float NoteData::GetChaosRadarValue( float fSongSeconds ) for( int r=0; r= NOTE_12TH ) - iNumChaosNotes++; + iNumChaosNotes++; } float fReturn = iNumChaosNotes / fSongSeconds * 0.5f; diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index f36d46eded..4c2adc66ef 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -135,8 +135,8 @@ float NoteDataWithScoring::GetActualChaosRadarValue( float fSongSeconds ) int iNumChaosNotesCompleted = 0; for( int r=0; r= NOTE_12TH ) - iNumChaosNotesCompleted++; + if( !IsRowEmpty(r) && IsRowComplete(r) && GetNoteType(r) >= NOTE_12TH ) + iNumChaosNotesCompleted++; } float fReturn = iNumChaosNotesCompleted / fSongSeconds * 0.5f; diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index a94c40dbb3..c7374336ff 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -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 ) { diff --git a/stepmania/src/Notes.cpp b/stepmania/src/Notes.cpp index cc3d8b9904..18f765d1fc 100644 --- a/stepmania/src/Notes.cpp +++ b/stepmania/src/Notes.cpp @@ -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; jWriteLine( "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; iWarn( "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; rTrace( "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", diff --git a/stepmania/src/Notes.h b/stepmania/src/Notes.h index bece587b74..8f3a8b8e32 100644 --- a/stepmania/src/Notes.h +++ b/stepmania/src/Notes.h @@ -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, diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 4e629b7ee3..fef6f30066 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -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; tWriteLine( "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(), diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 729cabef32..0dd278660d 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -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; uGetAdapterModeCount(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 ); } diff --git a/stepmania/src/RageInput.cpp b/stepmania/src/RageInput.cpp index 135c82a7d2..3fb8a5f64e 100644 --- a/stepmania/src/RageInput.cpp +++ b/stepmania/src/RageInput.cpp @@ -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; diff --git a/stepmania/src/RageInput.h b/stepmania/src/RageInput.h index 13ace5dc01..d0a86a99bf 100644 --- a/stepmania/src/RageInput.h +++ b/stepmania/src/RageInput.h @@ -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; }; }; diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index f2836a9ac4..ede8f29ae8 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -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() diff --git a/stepmania/src/RageLog.h b/stepmania/src/RageLog.h index ef483396ac..5352b678fe 100644 --- a/stepmania/src/RageLog.h +++ b/stepmania/src/RageLog.h @@ -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(); diff --git a/stepmania/src/RageMovieTexture.cpp b/stepmania/src/RageMovieTexture.cpp index e88e9f58bd..44614d0fe4 100644 --- a/stepmania/src/RageMovieTexture.cpp +++ b/stepmania/src/RageMovieTexture.cpp @@ -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 diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 9e59cf506c..47afc51944 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -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(); diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 14a70a5262..dbc6a9c869 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -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 ); } } } diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 51a75f6afb..41b80b71b3 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -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 diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index edad2d1540..43c68773f7 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -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 { diff --git a/stepmania/src/RandomSample.h b/stepmania/src/RandomSample.h index 1df07b9637..8bc6611ebe 100644 --- a/stepmania/src/RandomSample.h +++ b/stepmania/src/RandomSample.h @@ -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 \ No newline at end of file diff --git a/stepmania/src/ScoreDisplayNormal.cpp b/stepmania/src/ScoreDisplayNormal.cpp index 0136d57eda..1f9c51ad78 100644 --- a/stepmania/src/ScoreDisplayNormal.cpp +++ b/stepmania/src/ScoreDisplayNormal.cpp @@ -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) ); diff --git a/stepmania/src/ScoreDisplayOni.cpp b/stepmania/src/ScoreDisplayOni.cpp index e60d6e9a99..c3df812429 100644 --- a/stepmania/src/ScoreDisplayOni.cpp +++ b/stepmania/src/ScoreDisplayOni.cpp @@ -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) ); diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 111f184025..b6b0cd208b 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -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; diff --git a/stepmania/src/Screen.h b/stepmania/src/Screen.h index 882865ccbf..956ba66d95 100644 --- a/stepmania/src/Screen.h +++ b/stepmania/src/Screen.h @@ -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 ) {}; diff --git a/stepmania/src/ScreenAppearanceOptions.cpp b/stepmania/src/ScreenAppearanceOptions.cpp index dbfa2f53fd..1329d83ca7 100644 --- a/stepmania/src/ScreenAppearanceOptions.cpp +++ b/stepmania/src/ScreenAppearanceOptions.cpp @@ -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; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 479b72f7a1..d28a354139 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -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 ) { diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index b64f48db01..14b13990b1 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -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 ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index a9d29cbef6..fc2850e07c 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -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; diff --git a/stepmania/src/ScreenEz2SelectPlayer.cpp b/stepmania/src/ScreenEz2SelectPlayer.cpp index ab3648843f..2cf27c2864 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.cpp +++ b/stepmania/src/ScreenEz2SelectPlayer.cpp @@ -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; diff --git a/stepmania/src/ScreenEz2SelectStyle.cpp b/stepmania/src/ScreenEz2SelectStyle.cpp index 2701ebbe45..114ab12a1b 100644 --- a/stepmania/src/ScreenEz2SelectStyle.cpp +++ b/stepmania/src/ScreenEz2SelectStyle.cpp @@ -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; iGetPathTo(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; iGetPathTo(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; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 93364affa4..f9371610c7 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -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; pWriteLine( "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; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 66204a8691..ccaa66c59e 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -41,7 +41,7 @@ ScreenManager::ScreenManager() ScreenManager::~ScreenManager() { - LOG->WriteLine( "ScreenManager::~ScreenManager()" ); + LOG->Trace( "ScreenManager::~ScreenManager()" ); // delete current states for( int i=0; iWriteLine( "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." ); } diff --git a/stepmania/src/ScreenMusicScroll.cpp b/stepmania/src/ScreenMusicScroll.cpp index 4d0740318f..7eccb258f5 100644 --- a/stepmania/src/ScreenMusicScroll.cpp +++ b/stepmania/src/ScreenMusicScroll.cpp @@ -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; diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 07ace1c82a..e2762ddcf7 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -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 ); } diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index 18fbb1cc8e..1103ea2725 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -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 diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 39bf65782f..5644445bd4 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -56,7 +56,7 @@ ScreenPlayerOptions::ScreenPlayerOptions() : THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE) ) { - LOG->WriteLine( "ScreenPlayerOptions::ScreenPlayerOptions()" ); + LOG->Trace( "ScreenPlayerOptions::ScreenPlayerOptions()" ); Init( INPUTMODE_2PLAYERS, diff --git a/stepmania/src/ScreenSandbox.cpp b/stepmania/src/ScreenSandbox.cpp index 6ab70cc989..2c121f2703 100644 --- a/stepmania/src/ScreenSandbox.cpp +++ b/stepmania/src/ScreenSandbox.cpp @@ -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; diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index d0747ee342..346eb4b703 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -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 diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index ca5a204e3b..cf7a122c92 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -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; diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index a8139e5c5e..0bf1c71c6a 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -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(); diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index b49ec6766b..d8a59b0c68 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -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; diff --git a/stepmania/src/ScreenSelectStyle.cpp b/stepmania/src/ScreenSelectStyle.cpp index 1b16e95660..f64f01304f 100644 --- a/stepmania/src/ScreenSelectStyle.cpp +++ b/stepmania/src/ScreenSelectStyle.cpp @@ -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 ); diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index 16503b4836..1af7147942 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -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, diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 908e8d3c57..f901344320 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -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; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 734b9042a1..0302599b56 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -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; iWriteLine( "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; jWriteLine( "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; iWriteLine( "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; iWriteLine( "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; bLoadFromDWITokens( - 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; iWriteLine( "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; iLoadFromKSFFile( 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; iTrace( "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& 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; iWriteLine( "Song::SaveToSMDir('%s')", sPath ); + LOG->Trace( "Song::SaveToSMDir('%s')", sPath ); int i; diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 7bf59993dc..fb0e40df80 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -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 } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 393b71b9e7..0b8755a8ca 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -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(); diff --git a/stepmania/src/StepMania.RC b/stepmania/src/StepMania.RC index d8fa16d2ec..28ce783d0e 100644 --- a/stepmania/src/StepMania.RC +++ b/stepmania/src/StepMania.RC @@ -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 ///////////////////////////////////////////////////////////////////////////// diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index d5e63028e9..5da9692780 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -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; iDeviceToGame( 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 ); } diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index da2db7d5d6..a753051efa 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -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 diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 8f6d857e17..cf774f03c0 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -1002,6 +1002,9 @@ + + diff --git a/stepmania/src/StyleDef.cpp b/stepmania/src/StyleDef.cpp index 32392a0292..3361598a38 100644 --- a/stepmania/src/StyleDef.cpp +++ b/stepmania/src/StyleDef.cpp @@ -29,4 +29,30 @@ void StyleDef::GetTransformedNoteDataForStyle( PlayerNumber p, NoteData* pOrigin } pNoteDataOut->LoadTransformed( pOriginal, m_iColsPerPlayer, iNewToOriginalTrack ); -} \ No newline at end of file +} + + +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; pGetCurrentGameDef()->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; iWriteLine( "TipDisplay::TipDisplay()" ); + LOG->Trace( "TipDisplay::TipDisplay()" ); m_textTip.Load( THEME->GetPathTo(FONT_NORMAL) ); m_textTip.SetEffectBlinking(); diff --git a/stepmania/src/loading.bmp b/stepmania/src/loading.bmp new file mode 100644 index 0000000000..20d8a7e4e5 Binary files /dev/null and b/stepmania/src/loading.bmp differ diff --git a/stepmania/src/resource.h b/stepmania/src/resource.h index 44643f00c1..bcd8575a30 100644 --- a/stepmania/src/resource.h +++ b/stepmania/src/resource.h @@ -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 diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 1a93c133ef..18073592b5 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -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; };