diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 148b6bccb4..487ac1bcb9 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -1861,7 +1861,6 @@ 2B17AB7213980FDF001AE57D /* libpng-1.5.1-sm5.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libpng-1.5.1-sm5.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2B17ABC013981521001AE57D /* libglew-sm5.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libglew-sm5.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2B17ABE013981756001AE57D /* libpcre-sm5.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libpcre-sm5.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2B23246213DE001D005FA074 /* sm-ssc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "sm-ssc.app"; path = "/Users/wolfman2000/Repositories/sm-ssc/sm-ssc.app"; sourceTree = ""; }; 2B30D6801315EA7E00044B68 /* MouseDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseDevice.cpp; sourceTree = ""; }; 2B30D6811315EA7E00044B68 /* MouseDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseDevice.h; sourceTree = ""; }; 2B43509313949F37006FA051 /* TimingSegments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimingSegments.h; path = ../src/TimingSegments.h; sourceTree = SOURCE_ROOT; }; @@ -3118,6 +3117,7 @@ AAFF55220549F43A00D02EE9 /* ComboGraph.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = ComboGraph.h; path = ../src/ComboGraph.h; sourceTree = ""; }; AAFF5541054E736D00D02EE9 /* Attack.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; name = Attack.cpp; path = ../src/Attack.cpp; sourceTree = ""; }; AAFF5542054E736D00D02EE9 /* Attack.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = Attack.h; path = ../src/Attack.h; sourceTree = ""; }; + B7055CE913DF263F00732AED /* sm-ssc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "sm-ssc.app"; path = "/Users/wolfman2000/Repositories/sm-ssc/sm-ssc.app"; sourceTree = ""; }; B71A60BE139B41DB00183A27 /* InGameLoadingWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InGameLoadingWindow.cpp; path = ../src/InGameLoadingWindow.cpp; sourceTree = ""; }; B71A60BF139B41DB00183A27 /* InGameLoadingWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InGameLoadingWindow.h; path = ../src/InGameLoadingWindow.h; sourceTree = ""; }; B75CE3B3137963350076A82D /* SongPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SongPosition.h; path = ../src/SongPosition.h; sourceTree = SOURCE_ROOT; }; @@ -5909,7 +5909,7 @@ name = "stepmania-bare"; productInstallPath = "$(HOME)/Applications"; productName = "SDL App"; - productReference = 2B23246213DE001D005FA074 /* sm-ssc.app */; + productReference = B7055CE913DF263F00732AED /* sm-ssc.app */; productType = "com.apple.product-type.application"; }; AA7A2B930AE09B520054C5BA /* lua */ = { diff --git a/src/TimingData.cpp b/src/TimingData.cpp index abd21b01fc..612cf07446 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -996,28 +996,16 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const float TimingData::GetDisplayedBeat( float fBeat ) const { - const vector &scrolls = this->allTimingSegments[SEGMENT_SCROLL]; - vector::const_iterator it = scrolls.begin(), end = scrolls.end(); float fOutBeat = 0; - for( it = it + 1; it != end; it++ ) + unsigned i; + const vector &scrolls = this->allTimingSegments[SEGMENT_SCROLL]; + for( i=0; iGetBeat() <= (*it)->GetBeat()); - } - it = scrolls.begin(); - for( ; it != end; it++ ) - { - if( it+1 == end || fBeat <= (*(it+1))->GetBeat() ) - { - fOutBeat += ( fBeat - (*it)->GetBeat() ) * - static_cast(*it)->GetRatio(); + if( scrolls[i+1]->GetBeat() > fBeat ) break; - } - else - { - fOutBeat += ( (*(it+1))->GetBeat() - (*it)->GetBeat() ) * - static_cast(*it)->GetRatio(); - } + fOutBeat += (scrolls[i+1]->GetBeat() - scrolls[i]->GetBeat()) * static_cast(scrolls[i])->GetRatio(); } + fOutBeat += (fBeat - scrolls[i]->GetBeat()) * static_cast(scrolls[i])->GetRatio(); return fOutBeat; }