diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 4e2237edd8..874e230a6e 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,36 @@ ________________________________________________________________________________ StepMania 5.0 Preview 2 | 20110??? -------------------------------------------------------------------------------- +2011/06/13 +---------- +* [InputHandler_DirectInput] Fixed MouseWheel input not resetting. [AJ] +* [ScreenTextEntry] Make it so only the keyboard's Enter key can finish the + screen. Should fix issues with buttons whose secondary function is MenuStart. [AJ] +* [InputMapper] Modify default mappings. Use the Hyphen key instead of the + Numlock key for Player 2's GAME_BUTTON_BACK. This should address some + issues with Player 2 being unable to back out if they use a laptop. + [Wolfman2000] +* [NoteDisplay] Add two new metrics. + * DrawRollHeadForTapsOnSameRow: bool, similar to DrawHoldHeadForTapsOnSameRow + * TapHoldRollOnRowMeansHold: bool, true means hold and false means roll + * No noteskins should require updating, as these were placed in common/common + for ease of use. [Wolfman2000] +* [LifeMeterBattery] Added ChangeLives(int) Lua binding. [AJ] +* [LifeMeterBattery] Added DangerThreshold metric. [AJ] +* [LifeMeterBattery] Added some important metrics. [AJ] + * MinScoreToKeepLife='TapNoteScore_*' - any score below this = loss of life. + * SubtractLives=1 - how many lives are lost when going below MinScoreToKeepLife. + * MinesSubtractLives=1 - how many lives are lost when hitting a mine. + * HeldAddLives=0 - how many lives are gained when a hold is completed. + * LetGoSubtractLives=1 - how many lives are lost on a dropped hold. + +2011/06/12 +---------- +* [ScreenNetSelectMusic] Add PlayerOptionsScreen metric. [AJ] +* [ScreenEdit] Restore the old PageUp/PageDown behavior, added Control + + PageUp/PageDown to use recent time signature behavior. Laptop users, that + includes you guys too: semicolon and apostrophe are still good. [Wolfman2000] + 2011/06/11 ---------- * [ScreenEdit] Allow setting the Music Preview via the Alter Menu. Just select diff --git a/NoteSkins/common/common/metrics.ini b/NoteSkins/common/common/metrics.ini index 619f75b3f6..6c9f3f4e31 100644 --- a/NoteSkins/common/common/metrics.ini +++ b/NoteSkins/common/common/metrics.ini @@ -1,5 +1,7 @@ [NoteDisplay] DrawHoldHeadForTapsOnSameRow=1 +DrawRollHeadForTapsOnSameRow=1 +TapHoldRollOnRowMeansHold=1 AnimationIsBeatBased=1 TapNoteAnimationLength=1 TapMineAnimationLength=1 diff --git a/NoteSkins/pump/default/UpLeft Receptor.lua b/NoteSkins/pump/default/UpLeft Receptor.lua index 6ebcd0b547..86a2238fa1 100644 --- a/NoteSkins/pump/default/UpLeft Receptor.lua +++ b/NoteSkins/pump/default/UpLeft Receptor.lua @@ -1,5 +1,5 @@ - local function Beat(self) + -- too many locals local this = self:GetChildren() local player = GAMESTATE:GetMasterPlayerNumber() local playerstate = GAMESTATE:GetPlayerState( player ) diff --git a/Themes/_fallback/Other/ScreenGameplaySyncMachine music.ssc b/Themes/_fallback/Other/ScreenGameplaySyncMachine music.ssc index 6c0c76d05e..5721dff9bf 100644 --- a/Themes/_fallback/Other/ScreenGameplaySyncMachine music.ssc +++ b/Themes/_fallback/Other/ScreenGameplaySyncMachine music.ssc @@ -10,7 +10,7 @@ #BACKGROUND:; #LYRICSPATH:; #CDTITLE:; -#MUSIC:ScreenGameplaySyncMachine music.ogg; +#MUSIC:_sync music.ogg; #OFFSET:-0.012; #SAMPLESTART:0.000; #SAMPLELENGTH:12.000; diff --git a/Themes/_fallback/Other/ScreenGameplaySyncMachine music.ogg b/Themes/_fallback/Other/_sync music.ogg similarity index 100% rename from Themes/_fallback/Other/ScreenGameplaySyncMachine music.ogg rename to Themes/_fallback/Other/_sync music.ogg diff --git a/Themes/_fallback/Scripts/01 alias.lua b/Themes/_fallback/Scripts/01 alias.lua index e0e3841f07..05935425bf 100644 --- a/Themes/_fallback/Scripts/01 alias.lua +++ b/Themes/_fallback/Scripts/01 alias.lua @@ -20,12 +20,4 @@ local _screen = { h = SCREEN_HEIGHT, cx = SCREEN_CENTER_X, cy = SCREEN_CENTER_Y -} - -if Screen.String then - ScreenString = Screen.String -end - -if Screen.Metric then - ScreenMetric = Screen.Metric -end \ No newline at end of file +} \ No newline at end of file diff --git a/Themes/_fallback/Scripts/01 compat.lua b/Themes/_fallback/Scripts/01 compat.lua index 36b5327aa2..4103cc9dbc 100644 --- a/Themes/_fallback/Scripts/01 compat.lua +++ b/Themes/_fallback/Scripts/01 compat.lua @@ -56,15 +56,6 @@ function ActorScroller:setfastcatchup(bFastCatchup) self:SetFastCatchup(bFastCatchup) end --- renaming various StepMania functions to sm-ssc ones: -if ScreenString then - ScreenString = Screen.String -end - -if ScreenMetric then - ScreenMetric = Screen.Metric -end - --[[ GameState ]] --Aliases for old GAMESTATE timing functions. --These have been converted to SongPosition, but most themes still use these old functions. diff --git a/Themes/_fallback/Scripts/02 Actor.lua b/Themes/_fallback/Scripts/02 Actor.lua index cfded1e6a4..d00281bf65 100644 --- a/Themes/_fallback/Scripts/02 Actor.lua +++ b/Themes/_fallback/Scripts/02 Actor.lua @@ -114,17 +114,32 @@ function Actor:FullScreen() end --[[ Typical background sizes: -320x240 - DDR 1st-Extreme, most NVLM_ZK songs -640x480 - most simfiles in distribution today are this big. -768x480 - 16:10 aspect ratio backgrounds -854x480 - pump it up pro +320x240 - [4:3] +640x480 - [4:3] (most simfiles in distribution today use this res.) +768x480 - [16:10] +854x480 - [16:9] ]] --- "Most backgrounds are 640x480. Some are 768x480. Stretch the 4:3 ones." function Actor:scale_or_crop_background() - if (self:GetWidth() * 3) / 4 == self:GetHeight() then + local gw = self:GetWidth() + local gh = self:GetHeight() + + local graphicAspect = gw/gh + local displayAspect = DISPLAY:GetDisplayWidth()/DISPLAY:GetDisplayHeight() + + if graphicAspect == displayAspect then + -- bga matches the current aspect, we can stretch it. self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ); else + -- temp self:scaletocover( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ); + --[[ + -- bga doesn't match the aspect. + if displayAspect > graphicAspect then + -- the graphic is smaller than the display aspect ratio + else + -- the graphic is bigger than the display aspect ratio; crop me + end + --]] end end diff --git a/Themes/_fallback/Scripts/02 Other.lua b/Themes/_fallback/Scripts/02 Other.lua index ea544d1dd4..91f81f06e1 100644 --- a/Themes/_fallback/Scripts/02 Other.lua +++ b/Themes/_fallback/Scripts/02 Other.lua @@ -102,11 +102,13 @@ Screen.Metric = function ( sName ) local sClass = Var "LoadingScreen" return THEME:GetMetric( sClass, sName ) end +ScreenMetric = Screen.Metric Screen.String = function ( sName ) local sClass = Var "LoadingScreen"; return THEME:GetString( sClass, sName ) end +ScreenString = Screen.String function TextBannerAfterSet(self,param) local Title=self:GetChild("Title"); diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index e504462b0e..e14fd53744 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -606,7 +606,19 @@ OverY=0 [LifeMeterBattery] # The bar that shows up in Oni mode. +# any score below this one will cause you to lose a life. +MinScoreToKeepLife='TapNoteScore_W3' +# how many lives you'll lose upon doing so. +SubtractLives=1 +# how many lives you'll lose hitting a mine +MinesSubtractLives=1 +# how many lives a successful hold will net you. +HeldAddLives=0 +# how many lives an unsuccessful hold will cost you. +LetGoSubtractLives=1 +# How many lives trigger the "Danger" state. +DangerThreshold=1 # How long it flashes when you lose a life. BatteryBlinkTime=1.2 # Where the batteries are @@ -614,11 +626,16 @@ BatteryP1X=-92 BatteryP1Y=2 BatteryP2X=92 BatteryP2Y=2 -# Where your live count is +# Where your life count is +NumLivesFormat="x%d" NumLivesP1X=-92 NumLivesP1Y=0 +NumLivesP1GainLifeCommand= +NumLivesP1LoseLifeCommand=zoom,1.5;linear,0.15;zoom,1 NumLivesP2X=92 NumLivesP2Y=0 +NumLivesP2GainLifeCommand= +NumLivesP2LoseLifeCommand=zoom,1.5;linear,0.15;zoom,1 [LifeMeterBattery Percent] # The percentage on the bar. I wouldn't even bother changing this, because I @@ -1527,7 +1544,7 @@ AllowRepeatingInput=false PreSwitchPageSeconds=0 PostSwitchPageSeconds=0 ScrollerSecondsPerItem=0 -ScrollerNumItemsToDraw=1024 +ScrollerNumItemsToDraw=16 ScrollerTransform=function(self,offset,itemIndex,numItems) end ScrollerSubdivisions=1 OverrideSleepAfterTweenOffSeconds=false @@ -1817,6 +1834,7 @@ ChoiceDouble="name,Double;style,double;text,Double;screen,"..Branch.AfterSelectP ChoiceSolo="name,Solo;style,solo;text,Solo;screen,"..Branch.AfterSelectPlayMode() ChoiceVersus="name,Versus;style,versus;text,Versus;screen,"..Branch.AfterSelectPlayMode() ChoiceCouple="name,Couple;style,couple;text,Couple;screen,"..Branch.AfterSelectPlayMode() +ChoiceRoutine="name,Routine;style,routine;text,Routine;screen,"..Branch.AfterSelectPlayMode() ChoiceHalfDouble="name,HalfDouble;style,halfdouble;text,HalfDouble;screen,"..Branch.AfterSelectPlayMode() Choice5Keys="name,5Keys;style,single5;text,5Keys;screen,"..Branch.AfterSelectPlayMode() Choice7Keys="name,7Keys;style,single7;text,7Keys;screen,"..Branch.AfterSelectPlayMode() @@ -3951,6 +3969,7 @@ PrevScreen="ScreenNetRoom" NextScreen="ScreenStageInformation" NoSongsScreen=Branch.TitleMenu() RoomSelectScreen="ScreenNetRoom" +PlayerOptionsScreen="ScreenPlayerOptions" Codes="CodeDetectorOnline" ShowStyleIcon=false diff --git a/Themes/default/Graphics/_SelectIcon Routine.png b/Themes/default/Graphics/_SelectIcon Routine.png new file mode 100644 index 0000000000..2732321931 Binary files /dev/null and b/Themes/default/Graphics/_SelectIcon Routine.png differ diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 85ecd68ca8..12844adf17 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -705,7 +705,7 @@ IconChoiceDoubleX=SCREEN_CENTER_X-160 IconChoiceDoubleY=SCREEN_CENTER_Y IconChoiceDoubleOnCommand=zoom,0;bounceend,0.35;zoom,1 IconChoiceDoubleOffCommand=linear,0.1175;zoomx,0 -# +#### IconChoiceSoloX=SCREEN_CENTER_X-160 IconChoiceSoloY=SCREEN_CENTER_Y+96 IconChoiceSoloOnCommand=zoom,0;bounceend,0.35;zoom,1 @@ -715,17 +715,22 @@ IconChoiceHalfDoubleX=SCREEN_CENTER_X-160 IconChoiceHalfDoubleY=SCREEN_CENTER_Y+96 IconChoiceHalfDoubleOnCommand=zoom,0;bounceend,0.35;zoom,1 IconChoiceHalfDoubleOffCommand=linear,0.1175;zoomx,0 -# +#### IconChoiceVersusX=SCREEN_CENTER_X+160 -IconChoiceVersusY=SCREEN_CENTER_Y-48 +IconChoiceVersusY=string.find(THEME:GetMetric("ScreenSelectStyle","ChoiceNames"),"Routine") and SCREEN_CENTER_Y-96 or SCREEN_CENTER_Y-48 IconChoiceVersusOnCommand=zoom,0;bounceend,0.35;zoom,1 IconChoiceVersusOffCommand=linear,0.1175;zoomx,0 # IconChoiceCoupleX=SCREEN_CENTER_X+160 -IconChoiceCoupleY=SCREEN_CENTER_Y+48 +IconChoiceCoupleY=string.find(THEME:GetMetric("ScreenSelectStyle","ChoiceNames"),"Routine") and SCREEN_CENTER_Y or SCREEN_CENTER_Y+48 IconChoiceCoupleOnCommand=zoom,0;bounceend,0.35;zoom,1 IconChoiceCoupleOffCommand=linear,0.1175;zoomx,0 # +IconChoiceRoutineX=SCREEN_CENTER_X+160 +IconChoiceRoutineY=SCREEN_CENTER_Y+96 +IconChoiceRoutineOnCommand=zoom,0;bounceend,0.35;zoom,1 +IconChoiceRoutineOffCommand=linear,0.1175;zoomx,0 +# IconChoicekb7X=SCREEN_CENTER_X IconChoicekb7Y=SCREEN_CENTER_Y IconChoicekb7OnCommand=zoom,0;bounceend,0.35;zoom,1 diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 7aed8f48e3..30f38baac6 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7889,6 +7889,7 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch"; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../src", "$(SRCROOT)/../src/ffmpeg/include", @@ -7911,7 +7912,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-finline-limit=300", "-fconstant-cfstrings", - "-fsingle-precision-constant", "-fno-exceptions", "-falign-loops=16", ); @@ -7946,7 +7946,7 @@ GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_STRICT_ALIASING = YES; GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -8523,7 +8523,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_STRICT_ALIASING = YES; GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -8576,6 +8576,7 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch"; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../src", "$(SRCROOT)/../src/ffmpeg/include", @@ -8598,7 +8599,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-finline-limit=300", "-fconstant-cfstrings", - "-fsingle-precision-constant", "-fno-exceptions", "-falign-loops=16", ); @@ -8815,6 +8815,7 @@ GCC_ENABLE_SSE3_EXTENSIONS = NO; GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../src", "$(SRCROOT)/../src/ffmpeg/include", @@ -8837,7 +8838,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-finline-limit=300", "-fconstant-cfstrings", - "-fsingle-precision-constant", "-fno-exceptions", "-falign-loops=16", ); @@ -8870,7 +8870,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_STRICT_ALIASING = YES; GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -8944,6 +8944,7 @@ GCC_ENABLE_OBJC_EXCEPTIONS = NO; GCC_PREFIX_HEADER = "$(SRCROOT)/../src/archutils/Darwin/StepMania.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../src", "$(SRCROOT)/../src/ffmpeg/include", @@ -8966,7 +8967,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-finline-limit=300", "-fconstant-cfstrings", - "-fsingle-precision-constant", "-fno-exceptions", "-falign-loops=16", ); @@ -9000,7 +9000,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_STRICT_ALIASING = YES; GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; diff --git a/configure.ac b/configure.ac index 7917055408..dbf0199dca 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(sm-ssc, experimental, [http://ssc.ajworld.net/sm-ssc/], StepMania) +AC_INIT(StepMania 5, experimental, [http://ssc.ajworld.net/sm-ssc/], StepMania) AC_CONFIG_SRCDIR([src/StepMania.cpp]) AC_CONFIG_AUX_DIR(autoconf) AC_CANONICAL_TARGET diff --git a/src/Actor.cpp b/src/Actor.cpp index 3191d98d56..d7e8f3f4b2 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -105,9 +105,9 @@ void Actor::InitState() #endif m_fSecsIntoEffect = 0; m_fEffectDelta = 0; - m_fEffectRampUp = 0.5; + m_fEffectRampUp = 0.5f; m_fEffectHoldAtHalf = 0; - m_fEffectRampDown = 0.5; + m_fEffectRampDown = 0.5f; m_fEffectHoldAtZero = 0; m_fEffectOffset = 0; m_EffectClock = CLOCK_TIMER; @@ -118,7 +118,7 @@ void Actor::InitState() m_bVisible = true; m_fShadowLengthX = 0; m_fShadowLengthY = 0; - m_ShadowColor = RageColor(0,0,0,0.5); + m_ShadowColor = RageColor(0,0,0,0.5f); m_bIsAnimating = true; m_fHibernateSecondsLeft = 0; m_iDrawOrder = 0; diff --git a/src/AdjustSync.cpp b/src/AdjustSync.cpp index bee582b4bf..bc0425293d 100644 --- a/src/AdjustSync.cpp +++ b/src/AdjustSync.cpp @@ -256,7 +256,7 @@ void AdjustSync::AutosyncTempo() // keep only a fraction of the data, such as the 80% with the lowest // error. However, throwing away the ones with high error should // be enough in most cases. - float fFilteredError = 0.0; + float fFilteredError = 0; s_iStepsFiltered = s_vAutosyncTempoData.size(); FilterHighErrorPoints( s_vAutosyncTempoData, fSlope, fIntercept, ERROR_TOO_HIGH ); s_iStepsFiltered -= s_vAutosyncTempoData.size(); diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index fb8da38fb5..5b6dd64b08 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -60,6 +60,8 @@ static ThemeMetric MINI_PERCENT_BASE( "ArrowEffects", "MiniPercentBase" ) static ThemeMetric MINI_PERCENT_GATE( "ArrowEffects", "MiniPercentGate" ); static ThemeMetric DIZZY_HOLD_HEADS( "ArrowEffects", "DizzyHoldHeads" ); +float ArrowGetPercentVisible( const PlayerState* pPlayerState, float fYPosWithoutReverse ); + static float GetNoteFieldHeight( const PlayerState* pPlayerState ) { return SCREEN_HEIGHT + fabsf(pPlayerState->m_PlayerOptions.GetCurrent().m_fPerspectiveTilt)*200; @@ -236,7 +238,10 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float if( bShowEffects ) fBeatsUntilStep = pCurSteps->m_Timing.GetDisplayedBeat(fNoteBeat) - pCurSteps->m_Timing.GetDisplayedBeat(fSongBeat); float fYOffsetBeatSpacing = fBeatsUntilStep; - float fSpeedMultiplier = bShowEffects ? pCurSteps->m_Timing.GetDisplayedSpeedPercent( position.m_fSongBeatVisible, position.m_fMusicSecondsVisible ) : 1.0; + float fSpeedMultiplier = bShowEffects ? + pCurSteps->m_Timing.GetDisplayedSpeedPercent( + position.m_fSongBeatVisible, + position.m_fMusicSecondsVisible ) : 1.0f; fYOffset += fSpeedMultiplier * fYOffsetBeatSpacing * (1-pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing); } diff --git a/src/AttackDisplay.h b/src/AttackDisplay.h index 1a411ea55a..5e4dccf3d3 100644 --- a/src/AttackDisplay.h +++ b/src/AttackDisplay.h @@ -6,6 +6,8 @@ #include "GameConstantsAndTypes.h" // for TapNoteScore #include "RageTexturePreloader.h" +RString GetAttackPieceName( const RString &sAttack ); + class PlayerState; /** @brief A graphical display for attacks. */ class AttackDisplay : public ActorFrame diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 9bc73247ba..e6361729cf 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -242,7 +242,7 @@ void BeginnerHelper::DrawPrimitives() DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, - RageColor(0.5,0.5,0.5,1), + RageColor(0.5f,0.5f,0.5f,1), RageColor(1,1,1,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); @@ -271,7 +271,7 @@ void BeginnerHelper::DrawPrimitives() DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, - RageColor(0.5,0.5,0.5,1), + RageColor(0.5f,0.5f,0.5f,1), RageColor(1,1,1,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); diff --git a/src/Character.cpp b/src/Character.cpp index 209d3c7fa3..bb7d0e0797 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -5,6 +5,8 @@ #include "RageTextureID.h" #include "ActorUtil.h" +RString GetRandomFileInDir( RString sDir ); + Character::Character(): m_sCharDir(""), m_sCharacterID(""), m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), m_bUsableInRave(false), m_iPreloadRefcount(0) {} diff --git a/src/CourseUtil.h b/src/CourseUtil.h index e338c9c3e7..6be86abe77 100644 --- a/src/CourseUtil.h +++ b/src/CourseUtil.h @@ -11,6 +11,10 @@ class XNode; class CourseEntry; class Song; +bool CompareCoursePointersBySortValueAscending( const Course *pSong1, const Course *pSong2 ); +bool CompareCoursePointersBySortValueDescending( const Course *pSong1, const Course *pSong2 ); +bool CompareCoursePointersByTitle( const Course *pCourse1, const Course *pCourse2 ); + /** @brief Utility functions that deal with Courses. */ namespace CourseUtil { diff --git a/src/DancingCharacters.cpp b/src/DancingCharacters.cpp index 8b5be828c3..08088290eb 100644 --- a/src/DancingCharacters.cpp +++ b/src/DancingCharacters.cpp @@ -11,6 +11,8 @@ #include "PrefsManager.h" #include "Model.h" +int Neg1OrPos1(); + #define DC_X( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterXP%d",choice+1)) #define DC_Y( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterYP%d",choice+1)) @@ -344,7 +346,7 @@ void DancingCharacters::DrawPrimitives() ambient, diffuse, specular, - RageVector3(-3, -7.5, +9) ); + RageVector3(-3, -7.5f, +9) ); if( PREFSMAN->m_bCelShadeModels ) { diff --git a/src/DateTime.h b/src/DateTime.h index 58f2cbe6ff..2d77da95bd 100644 --- a/src/DateTime.h +++ b/src/DateTime.h @@ -4,6 +4,8 @@ #include "EnumHelper.h" #include +int StringToDayInYear( RString sDayInYear ); + /** @brief The number of days we check for previously. */ const int NUM_LAST_DAYS = 7; /** @brief The number of weeks we check for previously. */ diff --git a/src/EnumHelper.h b/src/EnumHelper.h index 57e81d16c4..3f9c60c295 100644 --- a/src/EnumHelper.h +++ b/src/EnumHelper.h @@ -57,6 +57,7 @@ namespace Enum const RString &EnumToString( int iVal, int iMax, const char **szNameArray, auto_ptr *pNameCache ); // XToString helper #define XToString(X) \ + const RString& X##ToString(X x); \ COMPILE_ASSERT( NUM_##X == ARRAYLEN(X##Names) ); \ const RString& X##ToString( X x ) \ { \ @@ -66,6 +67,7 @@ const RString &EnumToString( int iVal, int iMax, const char **szNameArray, auto_ namespace StringConversion { template<> RString ToString( const X &value ) { return X##ToString(value); } } #define XToLocalizedString(X) \ + const RString &X##ToLocalizedString(X x); \ const RString &X##ToLocalizedString( X x ) \ { \ static auto_ptr g_##X##Name[NUM_##X]; \ @@ -80,6 +82,7 @@ const RString &EnumToString( int iVal, int iMax, const char **szNameArray, auto_ } #define StringToX(X) \ + X StringTo##X(const RString&); \ X StringTo##X( const RString& s ) \ { \ for( unsigned i = 0; i < ARRAYLEN(X##Names); ++i ) \ diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index e1cbb161e4..f2279c6f5f 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -11,6 +11,7 @@ #include "PlayerNumber.h" #include +RString StepsTypeToString( StepsType st ); static vector GenerateRankingToFillInMarker() { diff --git a/src/GameSoundManager.h b/src/GameSoundManager.h index 6ce38ca39e..1187924a37 100644 --- a/src/GameSoundManager.h +++ b/src/GameSoundManager.h @@ -6,6 +6,9 @@ class TimingData; class RageSound; struct lua_State; + +int MusicThread_start( void *p ); + /** @brief High-level sound utilities. */ class GameSoundManager { diff --git a/src/GameState.h b/src/GameState.h index 0b2463f3c7..51abbac141 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -32,6 +32,8 @@ class Style; class TimingData; class Trail; +SortOrder GetDefaultSort(); + /** @brief Holds game data that is not saved between sessions. */ class GameState { diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 90e65ae879..1b0a71e77c 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -64,7 +64,7 @@ static const AutoMappings g_DefaultKeyMappings = AutoMappings( AutoMappingEntry( 0, KEY_KP_C2, GAME_BUTTON_MENUDOWN, true ), AutoMappingEntry( 0, KEY_KP_ENTER, GAME_BUTTON_START, true ), AutoMappingEntry( 0, KEY_KP_C0, GAME_BUTTON_SELECT, true ), - AutoMappingEntry( 0, KEY_NUMLOCK, GAME_BUTTON_BACK, true ), + AutoMappingEntry( 0, KEY_HYPHEN, GAME_BUTTON_BACK, true ), // laptop keyboards. AutoMappingEntry( 0, KEY_F1, GAME_BUTTON_COIN, false ), AutoMappingEntry( 0, KEY_SCRLLOCK, GAME_BUTTON_OPERATOR, false ) ); diff --git a/src/Inventory.cpp b/src/Inventory.cpp index 3b7eb88b32..d3f563c30a 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -11,6 +11,7 @@ #include "ThemeMetric.h" #include "PlayerState.h" +void ReloadItems(); #define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes") #define ITEM_DURATION_SECONDS THEME->GetMetricF("Inventory","ItemDurationSeconds") diff --git a/src/JsonUtil.cpp b/src/JsonUtil.cpp index be736ea4b5..755036e770 100644 --- a/src/JsonUtil.cpp +++ b/src/JsonUtil.cpp @@ -14,8 +14,7 @@ bool JsonUtil::LoadFromString(Json::Value &root, RString sData, RString &sErrorO if (!parsingSuccessful) { RString err = reader.getFormatedErrorMessages(); - sErrorOut = ssprintf("JSON: LoadFromFileShowErrors failed: %s", err.c_str()); - LOG->Warn(sErrorOut); + LOG->Warn("JSON: LoadFromFileShowErrors failed: %s", err.c_str()); return false; } return true; diff --git a/src/LifeMeterBar.cpp b/src/LifeMeterBar.cpp index 8256732b89..bbc101058a 100644 --- a/src/LifeMeterBar.cpp +++ b/src/LifeMeterBar.cpp @@ -172,7 +172,7 @@ void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) switch( score ) { case HNS_Held: fDeltaLife = +0; break; - case HNS_LetGo: fDeltaLife = -1.0; break; + case HNS_LetGo: fDeltaLife = -1.0f; break; default: ASSERT(0); } diff --git a/src/LifeMeterBattery.cpp b/src/LifeMeterBattery.cpp index 009d920e50..20f42ff4e7 100644 --- a/src/LifeMeterBattery.cpp +++ b/src/LifeMeterBattery.cpp @@ -26,6 +26,14 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats * const RString sType = "LifeMeterBattery"; PlayerNumber pn = pPlayerState->m_PlayerNumber; + MIN_SCORE_TO_KEEP_LIFE.Load(sType, "MinScoreToKeepLife"); + DANGER_THRESHOLD.Load(sType, "DangerThreshold"); + SUBTRACT_LIVES.Load(sType, "SubtractLives"); + MINES_SUBTRACT_LIVES.Load(sType, "MinesSubtractLives"); + HELD_ADD_LIVES.Load(sType, "HeldAddLives"); + LET_GO_SUBTRACT_LIVES.Load(sType, "LetGoSubtractLives"); + + LIVES_FORMAT.Load(sType, "NumLivesFormat"); BATTERY_BLINK_TIME.Load(sType, "BatteryBlinkTime"); // 1.2f by default bool bPlayerEnabled = GAMESTATE->IsPlayerEnabled( pPlayerState ); @@ -101,42 +109,54 @@ void LifeMeterBattery::OnSongEnded() Refresh(); } +void LifeMeterBattery::SubtractLives( int iLives ) +{ + if( iLives <= 0 ) + return; + + m_iTrailingLivesLeft = m_iLivesLeft; + m_iLivesLeft -= iLives; + m_soundLoseLife.Play(); + m_textNumLives.PlayCommand("LoseLife"); + + Refresh(); + m_fBatteryBlinkTime = BATTERY_BLINK_TIME; +} + +void LifeMeterBattery::AddLives( int iLives ) +{ + if( iLives <= 0 ) + return; + + m_iTrailingLivesLeft = m_iLivesLeft; + m_iLivesLeft += iLives; + m_soundGainLife.Play(); + m_textNumLives.PlayCommand("GainLife"); + + Refresh(); + m_fBatteryBlinkTime = 0; +} + +void LifeMeterBattery::ChangeLives(int iLifeDiff) +{ + if( iLifeDiff < 0 ) + SubtractLives( abs(iLifeDiff) ); + else if( iLifeDiff > 0 ) + AddLives(iLifeDiff); +} + void LifeMeterBattery::ChangeLife( TapNoteScore score ) { if( m_iLivesLeft == 0 ) return; - // todo: let the themer decide how this is handled. -aj - switch( score ) + // this probably doesn't handle hold checkpoints. -aj + if( score == TNS_HitMine && MINES_SUBTRACT_LIVES > 0 ) + SubtractLives(MINES_SUBTRACT_LIVES); + else { - case TNS_W1: - case TNS_W2: - case TNS_W3: - break; - case TNS_W4: - case TNS_W5: - case TNS_Miss: - case TNS_HitMine: - m_iTrailingLivesLeft = m_iLivesLeft; - m_iLivesLeft--; - m_soundLoseLife.Play(); - - m_textNumLives.PlayCommand("LoseLife"); - /* - m_textNumLives.SetZoom( 1.5f ); - m_textNumLives.BeginTweening( 0.15f ); - m_textNumLives.SetZoom( 1.0f ); - */ - - Refresh(); - m_fBatteryBlinkTime = BATTERY_BLINK_TIME; - break; - default: - break; - /* - // xxx: this doesn't handle hold checkpoints. - ASSERT(0); - */ + if( score < MIN_SCORE_TO_KEEP_LIFE && SUBTRACT_LIVES > 0 ) + SubtractLives(SUBTRACT_LIVES); } Message msg( "LifeChanged" ); @@ -148,16 +168,13 @@ void LifeMeterBattery::ChangeLife( TapNoteScore score ) void LifeMeterBattery::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) { - switch( score ) - { - case HNS_Held: - break; - case HNS_LetGo: - ChangeLife( TNS_Miss ); // LetGo is the same as a miss - break; - default: - ASSERT(0); - } + if( m_iLivesLeft == 0 ) + return; + + if( score == HNS_Held && HELD_ADD_LIVES > 0 ) + AddLives(HELD_ADD_LIVES); + if( score == HNS_LetGo && LET_GO_SUBTRACT_LIVES > 0 ) + SubtractLives(LET_GO_SUBTRACT_LIVES); } void LifeMeterBattery::HandleTapScoreNone() @@ -171,12 +188,12 @@ void LifeMeterBattery::ChangeLife( float fDeltaLifePercent ) bool LifeMeterBattery::IsInDanger() const { - return false; + return m_iLivesLeft < DANGER_THRESHOLD; } bool LifeMeterBattery::IsHot() const { - return false; + return m_iLivesLeft == GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives; } bool LifeMeterBattery::IsFailing() const @@ -208,7 +225,8 @@ void LifeMeterBattery::Refresh() } else { - m_textNumLives.SetText( ssprintf("x%d", m_iLivesLeft-1) ); + //m_textNumLives.SetText( ssprintf("x%d", m_iLivesLeft-1) ); + m_textNumLives.SetText( ssprintf(LIVES_FORMAT.GetValue(), m_iLivesLeft-1) ); m_sprBattery.SetState( 3 ); } } @@ -244,13 +262,14 @@ class LunaLifeMeterBattery: public Luna { public: static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; } - // is this right? wtf -q2x static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber( L, GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives ); return 1; } + static int ChangeLives( T* p, lua_State *L ) { p->ChangeLives(IArg(1)); return 0; } LunaLifeMeterBattery() { ADD_METHOD( GetLivesLeft ); ADD_METHOD( GetTotalLives ); + ADD_METHOD( ChangeLives ); } }; diff --git a/src/LifeMeterBattery.h b/src/LifeMeterBattery.h index d7b4a90a1d..648811a9fc 100644 --- a/src/LifeMeterBattery.h +++ b/src/LifeMeterBattery.h @@ -32,18 +32,28 @@ public: void Refresh(); int GetLivesLeft() { return m_iLivesLeft; } + void ChangeLives(int iLifeDiff); // Lua virtual void PushSelf( lua_State *L ); private: + void SubtractLives( int iLives ); + void AddLives( int iLives ); + int m_iLivesLeft; // dead when 0 int m_iTrailingLivesLeft; // lags m_iLivesLeft float m_fBatteryBlinkTime; // if > 0 battery is blinking - // theme metrics added for sm-ssc ThemeMetric BATTERY_BLINK_TIME; + ThemeMetric MIN_SCORE_TO_KEEP_LIFE; + ThemeMetric DANGER_THRESHOLD; + ThemeMetric SUBTRACT_LIVES; + ThemeMetric MINES_SUBTRACT_LIVES; + ThemeMetric HELD_ADD_LIVES; + ThemeMetric LET_GO_SUBTRACT_LIVES; + ThemeMetric LIVES_FORMAT; AutoActor m_sprFrame; Sprite m_sprBattery; diff --git a/src/LuaManager.h b/src/LuaManager.h index 5bcf0233eb..084532800a 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -220,9 +220,11 @@ inline bool MyLua_checkintboolean( lua_State *L, int iArg ) #define FArg(n) ((float) luaL_checknumber(L,(n))) #define LuaFunction( func, expr ) \ +int LuaFunc_##func( lua_State *L ); \ int LuaFunc_##func( lua_State *L ) { \ LuaHelpers::Push( L, expr ); return 1; \ } \ +void LuaFunc_Register_##func( lua_State *L ); \ void LuaFunc_Register_##func( lua_State *L ) { lua_register( L, #func, LuaFunc_##func ); } \ REGISTER_WITH_LUA_FUNCTION( LuaFunc_Register_##func ); diff --git a/src/MenuTimer.h b/src/MenuTimer.h index 1756bf715d..cd3a211c54 100644 --- a/src/MenuTimer.h +++ b/src/MenuTimer.h @@ -9,6 +9,8 @@ #include "ThemeMetric.h" #include "AutoActor.h" +RString WARNING_COMMAND_NAME( size_t i ); + class MenuTimer : public ActorFrame { public: diff --git a/src/ModIconRow.cpp b/src/ModIconRow.cpp index b2e3c68fd1..d77bed655b 100644 --- a/src/ModIconRow.cpp +++ b/src/ModIconRow.cpp @@ -10,6 +10,8 @@ #include "LuaManager.h" #include "Foreach.h" +int OptionToPreferredColumn( RString sOptionText ); + REGISTER_ACTOR_CLASS( ModIconRow ); ModIconRow::ModIconRow() diff --git a/src/NetworkSyncManager.cpp b/src/NetworkSyncManager.cpp index b49720a46a..66a4a1b4de 100644 --- a/src/NetworkSyncManager.cpp +++ b/src/NetworkSyncManager.cpp @@ -237,7 +237,7 @@ void NetworkSyncManager::ReportScore(int playerID, int step, int score, int comb if( !useSMserver ) //Make sure that we are using the network return; - LOG->Trace( ssprintf("Player ID %i combo = %i", playerID, combo) ); + LOG->Trace( "Player ID %i combo = %i", playerID, combo ); m_packet.ClearPacket(); m_packet.Write1( NSCGSU ); diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index 7ecbbe46ac..68151e4cae 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -778,13 +778,6 @@ void NoteDataUtil::LoadTransformedLightsFromTwo( const NoteData &marquee, const NoteDataUtil::RemoveMines( out ); } -struct RadarStats { - int taps; - int jumps; - int hands; - int quads; -}; - RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out ) { out.taps = 0; diff --git a/src/NoteDataUtil.h b/src/NoteDataUtil.h index f92043c9ff..167d2955f7 100644 --- a/src/NoteDataUtil.h +++ b/src/NoteDataUtil.h @@ -10,6 +10,24 @@ class NoteData; class Song; struct AttackArray; +/** @brief A limited selection of the RadarValues. */ +struct RadarStats +{ + /** @brief The number of tap notes in the song. */ + int taps; + /** @brief The number of jumps in the song. */ + int jumps; + /** @brief The number of 3 panel hits in the song. */ + int hands; + /** @brief The number of 4 panel hits in the song. */ + int quads; +}; + +void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap ); +int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ); +void LightTransformHelper( const NoteData &in, NoteData &out, const vector &aiTracks ); +RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out ); + /** * @brief Utility functions that deal with NoteData. * diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index a5c530bd73..9695fd09e9 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -46,6 +46,8 @@ static const NoteType MAX_DISPLAY_NOTE_TYPE = (NoteType)7; struct NoteMetricCache_t { bool m_bDrawHoldHeadForTapsOnSameRow; + bool m_bDrawRollHeadForTapsOnSameRow; + bool m_bTapHoldRollOnRowMeansHold; float m_fAnimationLength[NUM_NotePart]; bool m_bAnimationIsVivid[NUM_NotePart]; RageVector2 m_fAdditionTextureCoordOffset[NUM_NotePart]; @@ -69,6 +71,8 @@ struct NoteMetricCache_t void NoteMetricCache_t::Load( const RString &sButton ) { m_bDrawHoldHeadForTapsOnSameRow = NOTESKIN->GetMetricB(sButton,"DrawHoldHeadForTapsOnSameRow"); + m_bDrawRollHeadForTapsOnSameRow = NOTESKIN->GetMetricB(sButton,"DrawRollHeadForTapsOnSameRow"); + m_bTapHoldRollOnRowMeansHold = NOTESKIN->GetMetricB(sButton,"TapHoldRollOnRowMeansHold"); FOREACH_NotePart( p ) { const RString &s = NotePartToString(p); @@ -271,6 +275,11 @@ bool NoteDisplay::DrawHoldHeadForTapsOnSameRow() const return cache->m_bDrawHoldHeadForTapsOnSameRow; } +bool NoteDisplay::DrawRollHeadForTapsOnSameRow() const +{ + return cache->m_bDrawRollHeadForTapsOnSameRow; +} + void NoteDisplay::Update( float fDeltaTime ) { /* This function is static: it's called once per game loop, not once per @@ -718,7 +727,13 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in } } -void NoteDisplay::DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) +void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat, + bool bOnSameRowAsHoldStart, bool bOnSameRowAsRollStart, + bool bIsAddition, float fPercentFadeToFail, + float fReverseOffsetPixels, + float fDrawDistanceAfterTargetsPixels, + float fDrawDistanceBeforeTargetsPixels, + float fFadeInPercentOfDrawFar) { Actor* pActor = NULL; NotePart part = NotePart_Tap; @@ -738,10 +753,40 @@ void NoteDisplay::DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSam pActor = GetTapActor( m_TapFake, NotePart_Fake, fBeat ); part = NotePart_Fake; } + // TODO: Simplify all of the below. + else if (bOnSameRowAsHoldStart && bOnSameRowAsRollStart) + { + if (cache->m_bDrawHoldHeadForTapsOnSameRow && cache->m_bDrawRollHeadForTapsOnSameRow) + { + if (cache->m_bTapHoldRollOnRowMeansHold) // another new metric? + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); + } + else + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + } + else if (cache->m_bDrawHoldHeadForTapsOnSameRow) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); + } + else if (cache->m_bDrawRollHeadForTapsOnSameRow) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + } + else if( bOnSameRowAsHoldStart && cache->m_bDrawHoldHeadForTapsOnSameRow ) { pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); } + + else if( bOnSameRowAsRollStart && cache->m_bDrawRollHeadForTapsOnSameRow ) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + else { pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat ); diff --git a/src/NoteDisplay.h b/src/NoteDisplay.h index 8f79041e17..a7e45f3f62 100644 --- a/src/NoteDisplay.h +++ b/src/NoteDisplay.h @@ -80,13 +80,33 @@ public: static void Update( float fDeltaTime ); - void DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, - float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ); + /** + * @brief Draw the TapNote onto the NoteField. + * @param tn the TapNote in question. + * @param iCol the column. + * @param float fBeat the beat to draw them on. + * @param bOnSameRowAsHoldStart a flag to see if a hold is on the same beat. + * @param bOnSameRowAsRollStart a flag to see if a roll is on the same beat. + * @param bIsAddition a flag to see if this note was added via mods. + * @param fPercentFadeToFail at what point do the notes fade on failure? + * @param fReverseOffsetPixels How are the notes adjusted on Reverse? + * @param fDrawDistanceAfterTargetsPixels how much to draw after the receptors. + * @param fDrawDistanceBeforeTargetsPixels how much ot draw before the receptors. + * @param fFadeInPercentOfDrawFar when to start fading in. */ + void DrawTap(const TapNote& tn, int iCol, float fBeat, + bool bOnSameRowAsHoldStart, bool bOnSameRowAsRollBeat, + bool bIsAddition, float fPercentFadeToFail, + float fReverseOffsetPixels, + float fDrawDistanceAfterTargetsPixels, + float fDrawDistanceBeforeTargetsPixels, + float fFadeInPercentOfDrawFar ); void DrawHold( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, const HoldNoteResult &Result, bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fDrawDistanceBeforeTargetsPixels2, float fFadeInPercentOfDrawFar ); bool DrawHoldHeadForTapsOnSameRow() const; + + bool DrawRollHeadForTapsOnSameRow() const; private: void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLength, bool bVivid ); diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 84dc4aae63..70faf81a5f 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -20,6 +20,9 @@ #include "Course.h" #include "NoteData.h" +float FindFirstDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceAfterTargetsPixels ); +float FindLastDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceBeforeTargetsPixels ); + static ThemeMetric SHOW_BOARD( "NoteField", "ShowBoard" ); static ThemeMetric SHOW_BEAT_BARS( "NoteField", "ShowBeatBars" ); static ThemeMetric FADE_BEFORE_TARGETS_PERCENT( "NoteField", "FadeBeforeTargetsPercent" ); @@ -1257,13 +1260,31 @@ void NoteField::DrawPrimitives() { for( int c2=0; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, q).type == TapNote::hold_head) + const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); + if(tmp.type == TapNote::hold_head && + tmp.subType == TapNote::hold_head_hold) { bHoldNoteBeginsOnThisBeat = true; break; } } } + + // do the same for a roll. + bool bRollNoteBeginsOnThisBeat = false; + if (m_pCurDisplay->display[c].DrawRollHeadForTapsOnSameRow() ) + { + for( int c2=0; c2GetNumTracks(); c2++ ) + { + const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); + if(tmp.type == TapNote::hold_head && + tmp.subType == TapNote::hold_head_roll) + { + bRollNoteBeginsOnThisBeat = true; + break; + } + } + } bool bIsInSelectionRange = false; if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) @@ -1273,7 +1294,8 @@ void NoteField::DrawPrimitives() bool bIsHopoPossible = (tn.bHopoPossible); bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; - displayCols->display[c].DrawTap( tn, c, NoteRowToVisibleBeat(m_pPlayerState, q), bHoldNoteBeginsOnThisBeat, + displayCols->display[c].DrawTap(tn, c, NoteRowToVisibleBeat(m_pPlayerState, q), + bHoldNoteBeginsOnThisBeat, bRollNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT ); diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index d56062e0df..562629346f 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -200,7 +200,7 @@ bool NoteSkinManager::DoesNoteSkinExist( const RString &sSkinName ) vector asSkinNames; GetAllNoteSkinNamesForGame( GAMESTATE->m_pCurGame, asSkinNames ); for( unsigned i=0; i +Difficulty DwiCompatibleStringToDifficulty( const RString& sDC ); + static std::map g_mapDanceNoteToNoteDataColumn; /** @brief The different types of core DWI arrows and pads. */ diff --git a/src/NotesLoaderJson.cpp b/src/NotesLoaderJson.cpp index e0f79204d8..9d422d5177 100644 --- a/src/NotesLoaderJson.cpp +++ b/src/NotesLoaderJson.cpp @@ -10,6 +10,8 @@ #include "Steps.h" #include "GameManager.h" +void Deserialize(BPMSegment &seg, const Json::Value &root); + void NotesLoaderJson::GetApplicableFiles( const RString &sPath, vector &out ) { GetDirListing( sPath + RString("*.json"), out ); diff --git a/src/NotesWriterDWI.cpp b/src/NotesWriterDWI.cpp index 3d0641c0e8..4c451d836a 100644 --- a/src/NotesWriterDWI.cpp +++ b/src/NotesWriterDWI.cpp @@ -11,6 +11,8 @@ #include "Song.h" #include "Steps.h" +RString OptimizeDWIString( RString holds, RString taps ); + /** * @brief Optimize an individual pair of characters whenever possible. * @param c1 the first character. diff --git a/src/NotesWriterJson.cpp b/src/NotesWriterJson.cpp index a758444e30..e5ad6338d9 100644 --- a/src/NotesWriterJson.cpp +++ b/src/NotesWriterJson.cpp @@ -9,7 +9,7 @@ #include "NoteData.h" #include "GameManager.h" -void Serialize(const BPMSegment &seg, Json::Value &root) +static void Serialize(const BPMSegment &seg, Json::Value &root) { root["Beat"] = seg.GetBeat(); root["BPM"] = seg.GetBPM(); diff --git a/src/Player.cpp b/src/Player.cpp index 7195d3ab48..0fc3e02522 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -42,6 +42,9 @@ #include "LocalizedString.h" #include "AdjustSync.h" +RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ); +void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ); + /** * @brief Helper class to ensure that each row is only judged once without taking too much memory. */ @@ -1323,14 +1326,9 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) { - if( tn.subType == TapNote::hold_head_roll ) - { - m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0, min(1.0, fLifeFraction * 2.0))); - } - else - { - m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0, min(1.0, fLifeFraction * 10.0 - 8.5))); - } + float factor = (tn.subType == TapNote::hold_head_roll ? 2 : 10.0f - 8.5f); + factor *= fLifeFraction; + m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor))); } } @@ -2870,7 +2868,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) /* Update hold checkpoints * * TODO: Move this to a separate function. */ - if( HOLD_CHECKPOINTS ) + if( HOLD_CHECKPOINTS && m_pPlayerState->m_PlayerController != PC_AUTOPLAY ) { int iCheckpointFrequencyRows = ROWS_PER_BEAT/2; if( CHECKPOINTS_USE_TICKCOUNTS ) diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 965acfd223..51d89090d3 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -12,6 +12,9 @@ #include "CommonMetrics.h" #include +void NextFloat( float fValues[], int size ); +void NextBool( bool bValues[], int size ); + ThemeMetric RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" ); ThemeMetric RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" ); ThemeMetric RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" ); diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 2d1f564bb3..589da26533 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -5,6 +5,9 @@ class IniFile; +void ValidateDisplayAspectRatio( float &val ); +void ValidateSongsPerPlay( int &val ); + /** @brief How many songs can be played during a normal game max? * * This assumes no extra stages, no event mode, no course modes. */ diff --git a/src/RageDisplay.h b/src/RageDisplay.h index 9cad4f74c4..ca881c85f5 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -112,7 +112,7 @@ public: bpp(0), rate(0), vsync(false), interlaced(false), bSmoothLines(false), bTrilinearFiltering(false), bAnisotropicFiltering(false), sWindowTitle(RString()), - sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0) {} + sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0f) {} bool windowed; int width; diff --git a/src/RageDisplay_Legacy.cpp b/src/RageDisplay_Legacy.cpp index b2ea632c5d..4247510dc7 100644 --- a/src/RageDisplay_Legacy.cpp +++ b/src/RageDisplay_Legacy.cpp @@ -31,6 +31,13 @@ using namespace RageDisplay_Legacy_Helpers; #define glFlush() #endif +RString GetInfoLog( GLhandleARB h ); +GLhandleARB CompileShader( GLenum ShaderType, RString sFile, vector asDefines ); +GLhandleARB LoadShader( GLenum ShaderType, RString sFile, vector asDefines ); +void InitShaders(); +void SetupExtensions(); +void SetPixelMapForSurface( int glImageFormat, int glTexFormat, const RageSurfacePalette *palette ); + // // Globals // @@ -2561,7 +2568,7 @@ RString RageDisplay_Legacy::GetTextureDiagnostics(unsigned iTexture) const void RageDisplay_Legacy::SetAlphaTest(bool b) { // Previously this was 0.01, rather than 0x01. - glAlphaFunc(GL_GREATER, 0.00390625 /* 1/256 */); + glAlphaFunc(GL_GREATER, 0.00390625f /* 1/256 */); if (b) glEnable(GL_ALPHA_TEST); else diff --git a/src/RageFileManager.h b/src/RageFileManager.h index 59767b7aa4..12c6ca1fe0 100644 --- a/src/RageFileManager.h +++ b/src/RageFileManager.h @@ -10,6 +10,10 @@ namespace RageFileManagerUtil class RageFileDriver; class RageFileBasic; struct lua_State; + +bool ilt( const RString &a, const RString &b ); +bool ieq( const RString &a, const RString &b ); + /** @brief File utilities and high-level manager for RageFile objects. */ class RageFileManager { diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 048b20e508..cb7829c09f 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -26,7 +26,6 @@ enum tagtype { TAGTYPE_ID3V2_FOOTER }; -typedef unsigned long id3_length_t; static const int ID3_TAG_FLAG_FOOTERPRESENT = 0x10; static tagtype tagtype( const unsigned char *data, id3_length_t length ) diff --git a/src/RageSoundReader_MP3.h b/src/RageSoundReader_MP3.h index cc8862808a..815e8e7c27 100644 --- a/src/RageSoundReader_MP3.h +++ b/src/RageSoundReader_MP3.h @@ -8,6 +8,11 @@ struct madlib_t; +typedef unsigned long id3_length_t; + +signed long id3_tag_query( const unsigned char *data, id3_length_t length ); +void fill_frame_index_cache( madlib_t *mad ); + class RageSoundReader_MP3: public RageSoundReader_FileReader { public: diff --git a/src/RageSoundReader_Pan.cpp b/src/RageSoundReader_Pan.cpp index ee592c2fff..3b8d505154 100644 --- a/src/RageSoundReader_Pan.cpp +++ b/src/RageSoundReader_Pan.cpp @@ -5,7 +5,7 @@ RageSoundReader_Pan::RageSoundReader_Pan( RageSoundReader *pSource ): RageSoundReader_Filter( pSource ) { - m_fPan = 0.0; + m_fPan = 0; } diff --git a/src/RageSoundReader_WAV.h b/src/RageSoundReader_WAV.h index 20dcdeeaa2..53cf48d18d 100644 --- a/src/RageSoundReader_WAV.h +++ b/src/RageSoundReader_WAV.h @@ -7,6 +7,9 @@ #include "RageFile.h" struct WavReader; + +RString ReadString( RageFileBasic &f, int iSize, RString &sError ); + class RageSoundReader_WAV: public RageSoundReader_FileReader { public: diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 4f068df600..cee069e043 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -16,6 +16,10 @@ #include #include +bool HexToBinary(const RString&, RString&); +void utf8_sanitize(RString &); +void UnicodeUpperLower(wchar_t *, size_t, const unsigned char *); + RandomGen g_RandomNumberGenerator; MersenneTwister::MersenneTwister( int iSeed ) : m_iNext(0) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 98fbd51007..9e41da67c4 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -41,7 +41,7 @@ static Preference g_iDefaultRecordLength( "DefaultRecordLength", 4 ); static Preference g_bEditorShowBGChangesPlay( "EditorShowBGChangesPlay", true ); -// Defines specific to ScreenEdit +/** @brief How long must the button be held to generate a hold in record mode? */ const float RECORD_HOLD_SECONDS = 0.3f; #define PLAYER_X (SCREEN_CENTER_X) @@ -128,6 +128,17 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_UP_PAGE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_SEMICOLON); m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_PAGE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_PGDN); m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_PAGE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_SQUOTE); + + m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_UP_TS][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); + m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_UP_TS][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_UP_TS][0] = DeviceInput(DEVICE_KEYBOARD, KEY_PGUP); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_UP_TS][1] = DeviceInput(DEVICE_KEYBOARD, KEY_SEMICOLON); + + m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_DOWN_TS][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); + m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_DOWN_TS][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_TS][0] = DeviceInput(DEVICE_KEYBOARD, KEY_PGDN); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_DOWN_TS][1] = DeviceInput(DEVICE_KEYBOARD, KEY_SQUOTE); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_HOME][0] = DeviceInput(DEVICE_KEYBOARD, KEY_HOME); m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_END][0] = DeviceInput(DEVICE_KEYBOARD, KEY_END); m_EditMappingsDeviceInput.button[EDIT_BUTTON_SCROLL_NEXT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_PERIOD); @@ -1490,8 +1501,10 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) break; case EDIT_BUTTON_SCROLL_UP_LINE: case EDIT_BUTTON_SCROLL_UP_PAGE: + case EDIT_BUTTON_SCROLL_UP_TS: case EDIT_BUTTON_SCROLL_DOWN_LINE: case EDIT_BUTTON_SCROLL_DOWN_PAGE: + case EDIT_BUTTON_SCROLL_DOWN_TS: { float fBeatsToMove=0.f; switch( EditB ) @@ -1505,10 +1518,16 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) break; case EDIT_BUTTON_SCROLL_UP_PAGE: case EDIT_BUTTON_SCROLL_DOWN_PAGE: - fBeatsToMove = beatsPerMeasure; + fBeatsToMove = 4; if( EditB == EDIT_BUTTON_SCROLL_UP_PAGE ) fBeatsToMove *= -1; break; + case EDIT_BUTTON_SCROLL_UP_TS: + case EDIT_BUTTON_SCROLL_DOWN_TS: + fBeatsToMove = beatsPerMeasure; + if( EditB == EDIT_BUTTON_SCROLL_UP_TS ) + fBeatsToMove *= -1; + break; } if( m_PlayerStateEdit.m_PlayerOptions.GetSong().m_fScrolls[PlayerOptions::SCROLL_REVERSE] > 0.5 ) diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 2b3119a10a..2e5a020c3b 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -62,8 +62,10 @@ enum EditButton EDIT_BUTTON_SCROLL_UP_LINE, EDIT_BUTTON_SCROLL_UP_PAGE, + EDIT_BUTTON_SCROLL_UP_TS, EDIT_BUTTON_SCROLL_DOWN_LINE, EDIT_BUTTON_SCROLL_DOWN_PAGE, + EDIT_BUTTON_SCROLL_DOWN_TS, EDIT_BUTTON_SCROLL_NEXT_MEASURE, EDIT_BUTTON_SCROLL_PREV_MEASURE, EDIT_BUTTON_SCROLL_HOME, diff --git a/src/ScreenHighScores.cpp b/src/ScreenHighScores.cpp index 1f5034b134..97ea53f980 100644 --- a/src/ScreenHighScores.cpp +++ b/src/ScreenHighScores.cpp @@ -6,6 +6,9 @@ #include "RageLog.h" #include "UnlockManager.h" +RString COLUMN_DIFFICULTY_NAME( size_t i ); +RString COLUMN_STEPS_TYPE_NAME( size_t i ); + static const char *HighScoresTypeNames[] = { "AllSteps", "NonstopCourses", diff --git a/src/ScreenInstallOverlay.cpp b/src/ScreenInstallOverlay.cpp index 25561e7d8d..6882c1be0c 100644 --- a/src/ScreenInstallOverlay.cpp +++ b/src/ScreenInstallOverlay.cpp @@ -41,6 +41,9 @@ struct PlayAfterLaunchInfo } }; +void InstallSmzipOsArg( const RString &sOsZipFile, PlayAfterLaunchInfo &out ); +PlayAfterLaunchInfo DoInstalls( CommandLineActions::CommandLineArgs args ); + static void Parse( const RString &sDir, PlayAfterLaunchInfo &out ) { vector vsDirParts; diff --git a/src/ScreenMiniMenu.cpp b/src/ScreenMiniMenu.cpp index 0d68986a97..83be2dd4f0 100644 --- a/src/ScreenMiniMenu.cpp +++ b/src/ScreenMiniMenu.cpp @@ -10,6 +10,9 @@ #include "OptionRowHandler.h" #include "PrefsManager.h" +void PrepareToLoadScreen( const RString &sScreenName ); +void FinishedLoadingScreen(); + AutoScreenMessage( SM_GoToOK ); AutoScreenMessage( SM_GoToCancel ); diff --git a/src/ScreenNetSelectMusic.cpp b/src/ScreenNetSelectMusic.cpp index c9e4aa3ea8..3397ae997b 100644 --- a/src/ScreenNetSelectMusic.cpp +++ b/src/ScreenNetSelectMusic.cpp @@ -46,6 +46,7 @@ void ScreenNetSelectMusic::Init() SAMPLE_MUSIC_PREVIEW_MODE.Load( m_sName, "SampleMusicPreviewMode" ); MUSIC_WHEEL_TYPE.Load( m_sName, "MusicWheelType" ); + PLAYER_OPTIONS_SCREEN.Load( m_sName, "PlayerOptionsScreen" ); FOREACH_EnabledPlayer (p) { @@ -331,7 +332,7 @@ void ScreenNetSelectMusic::MenuUp( const InputEventPlus &input ) { NSMAN->ReportNSSOnOff(3); GAMESTATE->m_EditMode = EditMode_Full; - SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromPlayerOptions ); + SCREENMAN->AddNewScreenToTop( PLAYER_OPTIONS_SCREEN, SM_BackFromPlayerOptions ); } void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input ) diff --git a/src/ScreenNetSelectMusic.h b/src/ScreenNetSelectMusic.h index 2a0ff5fe1f..ecb89a079f 100644 --- a/src/ScreenNetSelectMusic.h +++ b/src/ScreenNetSelectMusic.h @@ -44,6 +44,7 @@ protected: RString m_sRandomMusicPath; ThemeMetric MUSIC_WHEEL_TYPE; + ThemeMetric PLAYER_OPTIONS_SCREEN; private: MusicWheel m_MusicWheel; diff --git a/src/ScreenReloadSongs.cpp b/src/ScreenReloadSongs.cpp index 7cd7360355..837a407e1a 100644 --- a/src/ScreenReloadSongs.cpp +++ b/src/ScreenReloadSongs.cpp @@ -40,14 +40,10 @@ ScreenReloadSongs::~ScreenReloadSongs() delete loadWin; } -int ScreenReloadSongs::loadingThreadProc(void *thisAsVoidPtr) { - - ScreenReloadSongs *self=(ScreenReloadSongs *)thisAsVoidPtr; - +int ScreenReloadSongs::loadingThreadProc(void *thisAsVoidPtr) +{ SONGMAN->Reload( false ); - SCREENMAN->PostMessageToTopScreen( SM_GoToNextScreen, 0 ); - return 0; } diff --git a/src/ScreenTestFonts.cpp b/src/ScreenTestFonts.cpp index 8d163e22ec..708a2d711a 100644 --- a/src/ScreenTestFonts.cpp +++ b/src/ScreenTestFonts.cpp @@ -49,7 +49,7 @@ void ScreenTestFonts::Init() font.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y+100 ); font.LoadFromFont( THEME->GetPathF("Common", "normal") ); - font.SetZoom(.5); + font.SetZoom(.5f); this->AddChild(&font); txt.SetName( "Text" ); diff --git a/src/ScreenTestSound.cpp b/src/ScreenTestSound.cpp index b27f93a87f..813f5cf6fa 100644 --- a/src/ScreenTestSound.cpp +++ b/src/ScreenTestSound.cpp @@ -17,7 +17,7 @@ void ScreenTestSound::Init() HEEEEEEEEELP.SetXY(450, 400); HEEEEEEEEELP.LoadFromFont( THEME->GetPathF("Common","normal") ); - HEEEEEEEEELP.SetZoom(.5); + HEEEEEEEEELP.SetZoom(.5f); HEEEEEEEEELP.SetText( "p Play\n" "s Stop\n" @@ -29,7 +29,7 @@ void ScreenTestSound::Init() { this->AddChild(&s[i].txt); s[i].txt.LoadFromFont( THEME->GetPathF("Common","normal") ); - s[i].txt.SetZoom(.5); + s[i].txt.SetZoom(.5f); } s[0].txt.SetXY(150, 100); diff --git a/src/ScreenTextEntry.cpp b/src/ScreenTextEntry.cpp index 994e0fc7a8..ee5fa14164 100644 --- a/src/ScreenTextEntry.cpp +++ b/src/ScreenTextEntry.cpp @@ -258,7 +258,8 @@ void ScreenTextEntry::BackspaceInAnswer() void ScreenTextEntry::MenuStart( const InputEventPlus &input ) { - if( input.type==IET_FIRST_PRESS ) + // HACK: Only allow the screen to end on the Enter key.-aj + if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_ENTER) && input.type==IET_FIRST_PRESS ) End( false ); } diff --git a/src/ScreenUnlockStatus.cpp b/src/ScreenUnlockStatus.cpp index e06c7dfa95..502e5d76bf 100644 --- a/src/ScreenUnlockStatus.cpp +++ b/src/ScreenUnlockStatus.cpp @@ -127,7 +127,7 @@ void ScreenUnlockStatus::Init() break; default: text->SetText( "" ); - text->SetDiffuse( RageColor(0.5,0,0,1) ); + text->SetDiffuse( RageColor(0.5f,0,0,1) ); break; } diff --git a/src/Song.h b/src/Song.h index 600694a640..98ff89ece2 100644 --- a/src/Song.h +++ b/src/Song.h @@ -16,6 +16,9 @@ class StepsID; struct lua_State; struct BackgroundChange; +void FixupPath( RString &path, const RString &sSongPath ); +RString GetSongAssetPath( RString sPath, const RString &sSongPath ); + /** @brief The version of the .ssc file format. */ const static float STEPFILE_VERSION_NUMBER = 0.7f; diff --git a/src/SongManager.h b/src/SongManager.h index 4df49feae7..54eaaa0cec 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -18,6 +18,10 @@ struct lua_State; #include "RageTexturePreloader.h" #include "RageUtil.h" +RString SONG_GROUP_COLOR_NAME( size_t i ); +RString COURSE_GROUP_COLOR_NAME( size_t i ); +bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2); + /** @brief The max number of edit steps a profile can have. */ const int MAX_EDIT_STEPS_PER_PROFILE = 200; /** @brief The max number of edit courses a profile can have. */ diff --git a/src/SongUtil.h b/src/SongUtil.h index 5432d455e3..4ecbcb8687 100644 --- a/src/SongUtil.h +++ b/src/SongUtil.h @@ -13,6 +13,8 @@ class Steps; class Profile; class XNode; +void AppendOctal( int n, int digits, RString &out ); + /** @brief The criteria for dealing with songs. */ class SongCriteria { diff --git a/src/Sprite.h b/src/Sprite.h index 7247171f70..3a941ec28c 100644 --- a/src/Sprite.h +++ b/src/Sprite.h @@ -4,6 +4,8 @@ #include "Actor.h" #include "RageTextureID.h" +void TexCoordArrayFromRect( float fImageCoords[8], const RectF &rect ); + class RageTexture; /** @brief A bitmap Actor that animates and moves around. */ class Sprite: public Actor diff --git a/src/StepMania.cpp b/src/StepMania.cpp index e72f6f621d..a3d4af5c6f 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -72,6 +72,10 @@ #include #endif +void ShutdownGame(); +bool HandleGlobalInputs( const InputEventPlus &input ); +void HandleInputEvents(float fDeltaTime); + static Preference g_bAllowMultipleInstances( "AllowMultipleInstances", false ); void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut ) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index f65c00122e..660b5e50c0 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -821,10 +821,10 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float int iLastRow = 0; float fLastTime = -m_fBeat0OffsetInSeconds; - float fBPS = GetBPMAtRow(0) / 60.0; + float fBPS = GetBPMAtRow(0) / 60.0f; float bIsWarping = false; - float fWarpDestination = 0.0; + float fWarpDestination = 0; for( ;; ) { @@ -923,10 +923,10 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const int iLastRow = 0; float fLastTime = -m_fBeat0OffsetInSeconds; - float fBPS = GetBPMAtRow(0) / 60.0; + float fBPS = GetBPMAtRow(0) / 60.0f; float bIsWarping = false; - float fWarpDestination = 0.0; + float fWarpDestination = 0; for( ;; ) { @@ -1004,7 +1004,7 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const float TimingData::GetDisplayedBeat( float fBeat ) const { vector::const_iterator it = m_ScrollSegments.begin(), end = m_ScrollSegments.end(); - float fOutBeat = 0.0; + float fOutBeat = 0; for( ; it != end; it++ ) { if( it+1 == end || fBeat <= (it+1)->GetBeat() ) @@ -1508,7 +1508,7 @@ float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds if( ( index == 0 && m_SpeedSegments[0].GetLength() > 0.0 ) && fCurTime < fStartTime ) { - return 1.0; + return 1.0f; } else if( fEndTime >= fCurTime && ( index > 0 || m_SpeedSegments[0].GetLength() > 0.0 ) ) { diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index 9817a88d0d..42d8387441 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -384,6 +384,10 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) if( hr == DIERR_INPUTLOST || hr == DIERR_NOTACQUIRED ) return; + // reset mousewheel + ButtonPressed( DeviceInput(device.dev, MOUSE_WHEELUP, 0, tm) ); + ButtonPressed( DeviceInput(device.dev, MOUSE_WHEELDOWN, 0, tm) ); + for( unsigned i = 0; i < device.Inputs.size(); ++i ) { const input_t &in = device.Inputs[i]; @@ -476,6 +480,12 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm return; } + // reset mousewheel + DeviceInput diUp = DeviceInput(device.dev, MOUSE_WHEELUP, 0.0f, tm); + ButtonPressed( diUp ); + DeviceInput diDown = DeviceInput(device.dev, MOUSE_WHEELDOWN, 0.0f, tm); + ButtonPressed( diDown ); + for( int i = 0; i < (int) numevents; ++i ) { for(unsigned j = 0; j < device.Inputs.size(); ++j) @@ -522,6 +532,7 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm GetCursorPos(&cursorPos); // convert screen coordinates to client ScreenToClient(GraphicsWindow::GetHwnd(), &cursorPos); + switch(in.ofs) { case DIMOFS_X: diff --git a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp index 445654b7f1..edc722fcb0 100644 --- a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp @@ -62,7 +62,7 @@ extern "C" void SetProgress( int progress, int totalWork ) extern "C" void SetIndeterminate( bool indeterminate ) { - // TODO: Implement this! + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progressBar)); gtk_main_iteration_do(FALSE); } diff --git a/src/arch/MovieTexture/MovieTexture.h b/src/arch/MovieTexture/MovieTexture.h index a97ea7e89f..b36b15fcae 100644 --- a/src/arch/MovieTexture/MovieTexture.h +++ b/src/arch/MovieTexture/MovieTexture.h @@ -5,6 +5,8 @@ #include "arch/RageDriver.h" #include +void ForceToAscii( RString &str ); + class RageMovieTexture : public RageTexture { public: diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index ed70a0acbf..ba00dbacb0 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -28,6 +28,10 @@ namespace avcodec #endif }; +int URLRageFile_open( avcodec::URLContext *h, const char *filename, int flags ); +int URLRageFile_read( avcodec::URLContext *h, unsigned char *buf, int size ); +int URLRageFile_close( avcodec::URLContext *h ); + /* #if defined(_MSC_VER) #pragma comment(lib, "ffmpeg/lib/avcodec.lib") diff --git a/src/archutils/Unix/CrashHandlerChild.cpp b/src/archutils/Unix/CrashHandlerChild.cpp index 4255470779..518ad0c7f6 100644 --- a/src/archutils/Unix/CrashHandlerChild.cpp +++ b/src/archutils/Unix/CrashHandlerChild.cpp @@ -28,6 +28,8 @@ extern const char *const version_date; extern const char *const version_time; #endif +bool child_read( int fd, void *p, int size ); + const char *g_pCrashHandlerArgv0 = NULL;