diff --git a/CMake/CMakeMacros.cmake b/CMake/CMakeMacros.cmake
index 71ce9c32b4..5049e4fbc7 100644
--- a/CMake/CMakeMacros.cmake
+++ b/CMake/CMakeMacros.cmake
@@ -1,3 +1,10 @@
+# Borrowed from http://stackoverflow.com/a/3323227/445373
+function(sm_list_replace container index newvalue)
+ list(INSERT ${container} ${index} ${newvalue})
+ math(EXPR __INDEX "${index} + 1")
+ list(REMOVE_AT ${container} ${__INDEX})
+endfunction()
+
function(sm_append_simple_target_property target property str)
get_target_property(current_property ${target} ${property})
if (current_property)
diff --git a/CMake/SMDefs.cmake b/CMake/SMDefs.cmake
index def252478a..86523c6ecd 100644
--- a/CMake/SMDefs.cmake
+++ b/CMake/SMDefs.cmake
@@ -1,7 +1,7 @@
# Set up version numbers according to the new scheme.
set(SM_VERSION_MAJOR 5)
set(SM_VERSION_MINOR 0)
-set(SM_VERSION_PATCH 8)
+set(SM_VERSION_PATCH 9)
set(SM_VERSION_TRADITIONAL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}")
execute_process(COMMAND git rev-parse --short HEAD
diff --git a/Docs/Changelog_language.txt b/Docs/Changelog_language.txt
index c10b9942ba..a6eddeda8d 100644
--- a/Docs/Changelog_language.txt
+++ b/Docs/Changelog_language.txt
@@ -16,6 +16,10 @@ Example:
This means that three strings were added to the "ScreenDebugOverlay" section,
"Mute actions", "Mute actions on", and "Mute actions off".
+2015/06/14
+----------
+* [ScreenTitleMenu] Hardest Timing
+
2015/06/06
----------
* [ScreenInitialScreenIsInvalid] InvalidScreenExplanation
diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt
index 4e22dff4dc..967abc4c6a 100644
--- a/Docs/Changelog_sm5.txt
+++ b/Docs/Changelog_sm5.txt
@@ -4,6 +4,14 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
________________________________________________________________________________
+2015/06/10
+----------
+* [global] get_music_file_length lua function added. [kyzentun]
+ multiapproach lua function now takes an optional 4th argument to multiply
+ the speeds by. [kyzentun]
+* [NoteDisplay] 1px seam in hold cap rendering fixed. [A.C/waiei]
+* [RageSound] get_length lua function added. [kyzentun]
+
2015/06/06
----------
* [ScreenInitialScreenIsInvalid] Error screen for themes that set an invalid
diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml
index 426391f963..d0cab7118c 100644
--- a/Docs/Luadoc/Lua.xml
+++ b/Docs/Luadoc/Lua.xml
@@ -221,6 +221,7 @@
+
@@ -1393,6 +1394,7 @@
+
diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml
index 6cc77d8986..2142ce3cb5 100644
--- a/Docs/Luadoc/LuaDocumentation.xml
+++ b/Docs/Luadoc/LuaDocumentation.xml
@@ -208,6 +208,10 @@ save yourself some time, copy this for undocumented things:
Returns the current Life Difficulty.
+
+ Returns the length of the music file found at path.
+ If you are loading the sound into an ActorSound, ActorSound:get to get its RageSound then use RageSound's get_length function instead to avoid loading the file twice.
+
Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown")
@@ -402,9 +406,10 @@ save yourself some time, copy this for undocumented things:
Returns Month m as a string.
-
+
Similar to approach, but operates on tables of values instead of single values. This will modify the contents of currents in place, as well as returning currents.
currents, goals, and speeds must all be the same size and contain only numbers.
+ multiplier is optional. The speeds in the speeds table will be multiplied by multiplier. This makes it more convenient to use multiapproach in a per-frame update: pass in the frame delta and the speeds will be scaled to the time that passed.
Note: When you see the error "approach: speed 1 is negative." it means that a speed value passed was negative. The 1 tells you which entry in the table was invalid.
@@ -4112,6 +4117,9 @@ save yourself some time, copy this for undocumented things:
See for loading a sound.
+
+ Returns the length of the sound loaded into this RageSound. Returns -1 if no sound is loaded.
+
Actually sets the value of sProperty to fVal. The supported properties depend on how the associated was loaded.
diff --git a/StepmaniaCore.cmake b/StepmaniaCore.cmake
index 688acebf85..66f2399f4b 100644
--- a/StepmaniaCore.cmake
+++ b/StepmaniaCore.cmake
@@ -56,23 +56,23 @@ if(WIN32)
set(HAS_MP3 TRUE)
set(SYSTEM_PCRE_FOUND FALSE)
find_package(DirectX REQUIRED)
-
+
# FFMPEG...it can be evil.
find_library(LIB_SWSCALE NAMES "swscale"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH
)
get_filename_component(LIB_SWSCALE ${LIB_SWSCALE} NAME)
-
+
find_library(LIB_AVCODEC NAMES "avcodec"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH
)
get_filename_component(LIB_AVCODEC ${LIB_AVCODEC} NAME)
-
+
find_library(LIB_AVFORMAT NAMES "avformat"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH
)
get_filename_component(LIB_AVFORMAT ${LIB_AVFORMAT} NAME)
-
+
find_library(LIB_AVUTIL NAMES "avutil"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH
)
@@ -87,7 +87,7 @@ elseif(MACOSX)
set(CMAKE_OSX_ARCHITECTURES "i386")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
set(CMAKE_OSX_DEPLOYMENT_TARGET_FULL "10.6.8")
-
+
find_library(MAC_FRAME_ACCELERATE Accelerate ${CMAKE_SYSTEM_FRAMEWORK_PATH})
find_library(MAC_FRAME_APPKIT AppKit ${CMAKE_SYSTEM_FRAMEWORK_PATH})
find_library(MAC_FRAME_AUDIOTOOLBOX AudioToolbox ${CMAKE_SYSTEM_FRAMEWORK_PATH})
@@ -101,7 +101,7 @@ elseif(MACOSX)
find_library(MAC_FRAME_IOKIT IOKit ${CMAKE_SYSTEM_FRAMEWORK_PATH})
find_library(MAC_FRAME_OPENGL OpenGL ${CMAKE_SYSTEM_FRAMEWORK_PATH})
find_library(MAC_FRAME_QUICKTIME QuickTime ${CMAKE_SYSTEM_FRAMEWORK_PATH})
-
+
mark_as_advanced(
MAC_FRAME_ACCELERATE
MAC_FRAME_APPKIT
@@ -158,6 +158,11 @@ elseif(LINUX)
message(FATAL_ERROR "zlib support required.")
endif()
+ find_package("JPEG")
+ if(NOT(${JPEG_FOUND}))
+ message(FATAL_ERROR "jpeg support required.")
+ endif()
+
find_library(DL_LIBRARY dl)
if(${LIBDL_FOUND})
set(HAS_LIBDL TRUE)
diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini
index 3bd711c735..9f68ba1320 100644
--- a/Themes/_fallback/Languages/en.ini
+++ b/Themes/_fallback/Languages/en.ini
@@ -2032,6 +2032,8 @@ Play Online=Network Play
Edit/Share=Edit/Share
Exit=Exit
Game Start=Game Start
+# The "Hardest Timing" text is displayed when the Timing Difficulty is at the hardest setting.
+Hardest Timing=Justice
Jukebox=Jukebox
Report Bug=Report A Bug!
Chat on IRC=Chat on IRC!
diff --git a/Themes/_fallback/Languages/ja.ini b/Themes/_fallback/Languages/ja.ini
index 01d41aab1d..c0d175fe81 100644
--- a/Themes/_fallback/Languages/ja.ini
+++ b/Themes/_fallback/Languages/ja.ini
@@ -957,6 +957,7 @@ SuddenOffset=Sudden Offset
SuperShuffle=Cement Mixer
SoftShuffle=Soft Shuffle
Swap Sides=右側と左側の入れ替え
+Swap Up/Down=上と下の入れ替え
Sync Machine=Sync Machine
Sync Song=Sync Song
Sync Tempo=Sync Tempo
@@ -1529,6 +1530,10 @@ HeaderText=
HeaderSubText=
HelpText=
+[ScreenInitialScreenIsInvalid]
+// 済 -hanubeki
+InvalidScreenExplanation=現在のテーマに設定された初期画面が有効なものではありません。\nその画面は現在のテーマや_fallbackテーマのどこにも定義されていません。\n現在のテーマにおけるエラーであり、テーマの作者に報告すべきものです。\nScroll Lock (オペレーターキー) からサービスメニューを開き、別のテーマに変更することができます。
+
[ScreenAppearanceOptions]
// 済
HeaderText=Appearance Options
@@ -2183,6 +2188,8 @@ Play Online=Network Play
Edit/Share=Edit/Share
Exit=Exit
Game Start=Game Start
+# Timing Difficultyを最も厳しくした場合に"Hardest Timing"のテキストが表示されます。
+Hardest Timing=Justice
Jukebox=Jukebox
Report Bug=バグ報告
Chat on IRC=IRC
diff --git a/Themes/_fallback/Scripts/02 Branches.lua b/Themes/_fallback/Scripts/02 Branches.lua
index e15372fd8c..7690019e22 100644
--- a/Themes/_fallback/Scripts/02 Branches.lua
+++ b/Themes/_fallback/Scripts/02 Branches.lua
@@ -160,14 +160,12 @@ Branch = {
end,
PlayerOptions = function()
local pm = GAMESTATE:GetPlayMode()
- local restricted = { "PlayMode_Oni", "PlayMode_Rave",
+ local restricted = { PlayMode_Oni= true, PlayMode_Rave= true,
--"PlayMode_Battle" -- ??
}
local optionsScreen = "ScreenPlayerOptions"
- for i=1,#restricted do
- if restricted[i] == pm then
- optionsScreen = "ScreenPlayerOptionsRestricted"
- end
+ if restricted[pm] then
+ optionsScreen = "ScreenPlayerOptionsRestricted"
end
if SCREENMAN:GetTopScreen():GetGoToOptions() then
return optionsScreen
diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini
index 1ad1d97401..7082cf83fc 100644
--- a/Themes/_fallback/metrics.ini
+++ b/Themes/_fallback/metrics.ini
@@ -1686,7 +1686,7 @@ Fallback="ScreenWithMenuElements"
#
DoSwitchAnyways=false
WrapCursor=false
-AllowRepeatingInput=false
+AllowRepeatingInput=true
PreSwitchPageSeconds=0
PostSwitchPageSeconds=0
ScrollerSecondsPerItem=0
@@ -2340,7 +2340,7 @@ MoreExitSelectedP2Command=
MoreExitUnselectedP1Command=
MoreExitUnselectedP2Command=
#
-AllowRepeatingChangeValueInput=false
+AllowRepeatingChangeValueInput=true
WrapValueInRow=true
[ScreenOptionsMaster]
diff --git a/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua
index c426ee610c..6e83094523 100644
--- a/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua
+++ b/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua
@@ -1,17 +1,21 @@
+local label_text= false
+
return Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=GetLifeDifficulty();
AltText="";
InitCommand=cmd(horizalign,left;zoom,0.675);
- OnCommand=cmd(shadowlength,1);
- BeginCommand=function(self)
- self:settextf( Screen.String("LifeDifficulty"), "" );
- end
+ OnCommand= function(self)
+ label_text= self
+ self:shadowlength(1):settextf(Screen.String("LifeDifficulty"), "");
+ end,
};
LoadFont("Common Normal") .. {
Text=GetLifeDifficulty();
AltText="";
- InitCommand=cmd(x,136;zoom,0.675;halign,0);
- OnCommand=cmd(shadowlength,1;skewx,-0.125);
+ InitCommand=cmd(zoom,0.675;halign,0);
+ OnCommand= function(self)
+ self:shadowlength(1):skewx(-0.125):x(label_text:GetZoomedWidth()+8)
+ end,
};
-};
\ No newline at end of file
+};
diff --git a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua
index c419c97a14..a7cf24ffc6 100644
--- a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua
+++ b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua
@@ -1,25 +1,26 @@
+local label_text= false
return Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=GetTimingDifficulty();
AltText="";
InitCommand=cmd(horizalign,left;zoom,0.675);
- OnCommand=cmd(shadowlength,1);
- BeginCommand=function(self)
- self:settextf( Screen.String("TimingDifficulty"), "" );
- end
+ OnCommand= function(self)
+ label_text= self
+ self:shadowlength(1):settextf(Screen.String("TimingDifficulty"), "");
+ end,
};
LoadFont("Common Normal") .. {
Text=GetTimingDifficulty();
AltText="";
InitCommand=cmd(x,136;zoom,0.675;halign,0);
OnCommand=function(self)
- (cmd(shadowlength,1;skewx,-0.125))(self);
+ self:shadowlength(1):skewx(-0.125):x(label_text:GetZoomedWidth()+8)
if GetTimingDifficulty() == 9 then
- self:settext("Justice");
+ self:settext(Screen.String("Hardest Timing"));
(cmd(zoom,0.5;diffuse,ColorLightTone( Color("Orange")) ))(self);
else
self:settext( GetTimingDifficulty() );
end
end;
};
-};
\ No newline at end of file
+};
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index 3570229ad7..46b483ab48 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -11,9 +11,7 @@ if (APPLE OR MSVC)
endif()
include(CMakeProject-png.cmake)
-if (NOT MSVC)
+if (APPLE)
include(CMakeProject-jpeg.cmake)
- if (APPLE)
- include(CMakeProject-mad.cmake)
- endif()
+ include(CMakeProject-mad.cmake)
endif()
diff --git a/src/ActorUtil.cpp b/src/ActorUtil.cpp
index 5e6132f906..d4435b7615 100644
--- a/src/ActorUtil.cpp
+++ b/src/ActorUtil.cpp
@@ -642,21 +642,31 @@ namespace
lua_pushboolean( L, IsRegistered(SArg(1)) );
return 1;
}
+ static void name_error(Actor* p, lua_State* L)
+ {
+ if(p->GetName() == "")
+ {
+ luaL_error(L, "LoadAllCommands requires the actor to have a name.");
+ }
+ }
static int LoadAllCommands( lua_State *L )
{
Actor *p = Luna::check( L, 1 );
+ name_error(p, L);
ActorUtil::LoadAllCommands( p, SArg(2) );
return 0;
}
static int LoadAllCommandsFromName( lua_State *L )
{
Actor *p = Luna::check( L, 1 );
+ name_error(p, L);
ActorUtil::LoadAllCommandsFromName( *p, SArg(2), SArg(3) );
return 0;
}
static int LoadAllCommandsAndSetXY( lua_State *L )
{
Actor *p = Luna::check( L, 1 );
+ name_error(p, L);
ActorUtil::LoadAllCommandsAndSetXY( p, SArg(2) );
return 0;
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 577279d837..e882b43e58 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -493,6 +493,7 @@ elseif(APPLE)
)
else() # Unix / Linux
# TODO: Remember to find and locate the zip archive files.
+ sm_list_replace(SMDATA_LINK_LIB 8 "${JPEG_LIBRARY}")
if (HAS_FFMPEG)
if(WITH_SYSTEM_FFMPEG)
list(APPEND SMDATA_LINK_LIB
@@ -596,14 +597,17 @@ if(NOT APPLE)
list(APPEND SM_INCLUDE_DIRS
"${SM_EXTERN_DIR}/glew-1.5.8/include"
"${SM_EXTERN_DIR}/jsoncpp/include"
- "${SM_EXTERN_DIR}/libjpeg"
"${SM_EXTERN_DIR}/zlib"
)
if(MSVC)
list(APPEND SM_INCLUDE_DIRS
"${SM_EXTERN_DIR}/ffmpeg/include"
+ "${SM_EXTERN_DIR}/libjpeg"
)
else()
+ list(APPEND SM_INCLUDE_DIRS
+ "${JPEG_INCLUDE_DIR}"
+ )
if (HAS_FFMPEG)
if (WITH_SYSTEM_FFMPEG)
list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}")
diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp
index c74b13bfe3..2b8bd94d9c 100644
--- a/src/LuaManager.cpp
+++ b/src/LuaManager.cpp
@@ -771,7 +771,7 @@ bool LuaHelpers::RunScriptFile( const RString &sFile )
{
LUA->Release( L );
sError = ssprintf( "Lua runtime error: %s", sError.c_str() );
- Dialog::OK( sError, "LUA_ERROR" );
+ LuaHelpers::ReportScriptError(sError);
return false;
}
LUA->Release( L );
diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp
index 947b7d110f..f024a11de6 100644
--- a/src/NoteDisplay.cpp
+++ b/src/NoteDisplay.cpp
@@ -800,8 +800,10 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr,
if (!part_args.anchor_to_top)
{
float offset = unzoomed_frame_height - (y_end_pos - y_start_pos);
- // Om[g{̂̒unzoomed_frame_height0̂ƂɁAadd_to_tex_coord01ɂOK
- // ܂Aoffset0unzoomed_frame_heightɂƗzʂ̕\ɂȂ -A.C
+ // ロングノート本体の長さがunzoomed_frame_height→0のときに、add_to_tex_coordを0→1にすればOK
+ // つまり、offsetを0→unzoomed_frame_heightにすると理想通りの表示になる -A.C
+ // Shift texture coord to fit hold length If hold length is less than
+ // bottomcap frame size. (translated by hanubeki)
if (offset>0){
add_to_tex_coord = SCALE(offset, 0.0f, unzoomed_frame_height, 0.0f, 1.0f);
}
@@ -809,9 +811,6 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr,
add_to_tex_coord = 0.0f;
}
}
- // ͖قYɂȂĂ悤Ɍ
- // I seem to be better this does not exist has led to clean. -A.C
- // add_to_tex_coord= SCALE(1.0f, 0.0f, power_of_two(unzoomed_frame_height), 0.0f, 1.0f);
}
DISPLAY->ClearAllTextures();
diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp
index 8d14c32e9d..45275328ab 100644
--- a/src/PrefsManager.cpp
+++ b/src/PrefsManager.cpp
@@ -159,51 +159,51 @@ void ValidateSongsPerPlay( int &val )
}
PrefsManager::PrefsManager() :
- m_sCurrentGame ( "CurrentGame", "" ),
+ m_sCurrentGame ( "CurrentGame", "" ),
- m_sAnnouncer ( "Announcer", "" ),
- m_sTheme ( "Theme", SpecialFiles::BASE_THEME_NAME ),
- m_sDefaultModifiers ( "DefaultModifiers", "" ),
+ m_sAnnouncer ( "Announcer", "" ),
+ m_sTheme ( "Theme", SpecialFiles::BASE_THEME_NAME ),
+ m_sDefaultModifiers ( "DefaultModifiers", "" ),
- m_bWindowed ( "Windowed", true ),
- m_iDisplayWidth ( "DisplayWidth", 854 ),
- m_iDisplayHeight ( "DisplayHeight", 480 ),
- m_fDisplayAspectRatio ( "DisplayAspectRatio", 16/9.f, ValidateDisplayAspectRatio ),
- m_iDisplayColorDepth ( "DisplayColorDepth", 32 ),
- m_iTextureColorDepth ( "TextureColorDepth", 32 ),
- m_iMovieColorDepth ( "MovieColorDepth", 32 ),
- m_bStretchBackgrounds ( "StretchBackgrounds", false ),
- m_BGFitMode("BackgroundFitMode", BFM_CoverPreserve),
+ m_bWindowed ( "Windowed", true ),
+ m_iDisplayWidth ( "DisplayWidth", 854 ),
+ m_iDisplayHeight ( "DisplayHeight", 480 ),
+ m_fDisplayAspectRatio ( "DisplayAspectRatio", 16/9.f, ValidateDisplayAspectRatio ),
+ m_iDisplayColorDepth ( "DisplayColorDepth", 32 ),
+ m_iTextureColorDepth ( "TextureColorDepth", 32 ),
+ m_iMovieColorDepth ( "MovieColorDepth", 32 ),
+ m_bStretchBackgrounds ( "StretchBackgrounds", false ),
+ m_BGFitMode ( "BackgroundFitMode", BFM_CoverPreserve),
m_HighResolutionTextures ( "HighResolutionTextures", HighResolutionTextures_Auto ),
- m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ),
- m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ),
- m_bAllowMultitexture ( "AllowMultitexture", true ),
- m_bShowStats ( "ShowStats", TRUE_IF_DEBUG),
- m_bShowBanners ( "ShowBanners", true ),
- m_bShowMouseCursor ( "ShowMouseCursor", true ),
+ m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ),
+ m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ),
+ m_bAllowMultitexture ( "AllowMultitexture", true ),
+ m_bShowStats ( "ShowStats", TRUE_IF_DEBUG),
+ m_bShowBanners ( "ShowBanners", true ),
+ m_bShowMouseCursor ( "ShowMouseCursor", true ),
- m_bHiddenSongs ( "HiddenSongs", false ),
- m_bVsync ( "Vsync", true ),
- m_FastNoteRendering("FastNoteRendering", false),
- m_bInterlaced ( "Interlaced", false ),
- m_bPAL ( "PAL", false ),
- m_bDelayedTextureDelete ( "DelayedTextureDelete", false ),
- m_bDelayedModelDelete ( "DelayedModelDelete", false ),
- m_BannerCache ( "BannerCache", BNCACHE_LOW_RES_PRELOAD ),
+ m_bHiddenSongs ( "HiddenSongs", false ),
+ m_bVsync ( "Vsync", true ),
+ m_FastNoteRendering ( "FastNoteRendering", false),
+ m_bInterlaced ( "Interlaced", false ),
+ m_bPAL ( "PAL", false ),
+ m_bDelayedTextureDelete ( "DelayedTextureDelete", false ),
+ m_bDelayedModelDelete ( "DelayedModelDelete", false ),
+ m_BannerCache ( "BannerCache", BNCACHE_LOW_RES_PRELOAD ),
//m_BackgroundCache ( "BackgroundCache", BGCACHE_LOW_RES_PRELOAD ),
- m_bFastLoad ( "FastLoad", true ),
+ m_bFastLoad ( "FastLoad", true ),
m_bFastLoadAdditionalSongs ( "FastLoadAdditionalSongs", true ),
- m_NeverCacheList("NeverCacheList", ""),
+ m_NeverCacheList ( "NeverCacheList", ""),
m_bOnlyDedicatedMenuButtons ( "OnlyDedicatedMenuButtons", false ),
- m_bMenuTimer ( "MenuTimer", false ),
+ m_bMenuTimer ( "MenuTimer", false ),
- m_fLifeDifficultyScale ( "LifeDifficultyScale", 1.0f ),
+ m_fLifeDifficultyScale ( "LifeDifficultyScale", 1.0f ),
m_iRegenComboAfterMiss ( "RegenComboAfterMiss", 5 ),
m_bMercifulDrain ( "MercifulDrain", false ), // negative life deltas are scaled by the players life percentage
- m_HarshHotLifePenalty("HarshHotLifePenalty", true),
+ m_HarshHotLifePenalty ( "HarshHotLifePenalty", true ),
m_bMinimum1FullSongInCourses ( "Minimum1FullSongInCourses", false ), // FEoS for 1st song, FailImmediate thereafter
m_bFailOffInBeginner ( "FailOffInBeginner", false ),
m_bFailOffForFirstStageEasy ( "FailOffForFirstStageEasy", false ),
@@ -214,7 +214,7 @@ PrefsManager::PrefsManager() :
m_bShowCaution ( "ShowCaution", true ),
m_bShowNativeLanguage ( "ShowNativeLanguage", true ),
m_iArcadeOptionsNavigation ( "ArcadeOptionsNavigation", 0 ),
- m_ThreeKeyNavigation("ThreeKeyNavigation", false),
+ m_ThreeKeyNavigation ( "ThreeKeyNavigation", false ),
m_MusicWheelUsesSections ( "MusicWheelUsesSections", MusicWheelUsesSections_ALWAYS ),
m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 15 ),
m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ),
@@ -223,17 +223,18 @@ PrefsManager::PrefsManager() :
m_iSongsPerPlay ( "SongsPerPlay", 3, ValidateSongsPerPlay ),
m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ),
m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ),
- m_AllowMultipleToasties("AllowMultipleToasties", true),
- m_MinTNSToHideNotes("MinTNSToHideNotes", TNS_W3),
+ m_AllowMultipleToasties ("AllowMultipleToasties", true ),
+ m_MinTNSToHideNotes ("MinTNSToHideNotes", TNS_W3 ),
m_ShowSongOptions ( "ShowSongOptions", Maybe_NO ),
m_bDancePointsForOni ( "DancePointsForOni", true ),
m_bPercentageScoring ( "PercentageScoring", false ),
+ // Wow, these preference names are *seriously* long -Colby
m_fMinPercentageForMachineSongHighScore ( "MinPercentageForMachineSongHighScore", 0.0001f ), // This is for home, who cares how bad you do?
- m_fMinPercentageForMachineCourseHighScore ( "MinPercentageForMachineCourseHighScore", 0.0001f ), // don't save course scores with 0 percentage
+ m_fMinPercentageForMachineCourseHighScore ( "MinPercentageForMachineCourseHighScore", 0.0001f ), // don't save course scores with 0 percentage
m_bDisqualification ( "Disqualification", false ),
m_bAutogenSteps ( "AutogenSteps", false ),
m_bAutogenGroupCourses ( "AutogenGroupCourses", true ),
- m_bOnlyPreferredDifficulties ( "OnlyPreferredDifficulties", false ),
+ m_bOnlyPreferredDifficulties ( "OnlyPreferredDifficulties", false ),
m_bBreakComboToGetItem ( "BreakComboToGetItem", false ),
m_bLockCourseDifficulties ( "LockCourseDifficulties", true ),
m_ShowDancingCharacters ( "ShowDancingCharacters", SDC_Random ),
@@ -261,8 +262,8 @@ PrefsManager::PrefsManager() :
m_fDebounceCoinInputTime ( "DebounceCoinInputTime", 0 ),
m_fPadStickSeconds ( "PadStickSeconds", 0 ),
- m_EditRecordModeLeadIn("EditRecordModeLeadIn", 1.0f),
- m_EditClearPromptThreshold("EditClearPromptThreshold", 50),
+ m_EditRecordModeLeadIn ("EditRecordModeLeadIn", 1.0f ),
+ m_EditClearPromptThreshold ("EditClearPromptThreshold", 50),
m_bForceMipMaps ( "ForceMipMaps", false ),
m_bTrilinearFiltering ( "TrilinearFiltering", false ),
m_bAnisotropicFiltering ( "AnisotropicFiltering", false ),
@@ -290,10 +291,10 @@ PrefsManager::PrefsManager() :
m_bMonkeyInput ( "MonkeyInput", false ),
m_sMachineName ( "MachineName", "" ),
m_sCoursesToShowRanking ( "CoursesToShowRanking", "" ),
- m_MuteActions("MuteActions", false),
- m_bAllowSongDeletion("AllowSongDeletion", false),
+ m_MuteActions ( "MuteActions", false ),
+ m_bAllowSongDeletion ( "AllowSongDeletion", false ),
- m_bQuirksMode ( "QuirksMode", false ),
+ m_bQuirksMode ( "QuirksMode", false ),
/* Debug: */
m_bLogToDisk ( "LogToDisk", true ),
diff --git a/src/RageSound.cpp b/src/RageSound.cpp
index 771f850e30..81fafdcfe4 100644
--- a/src/RageSound.cpp
+++ b/src/RageSound.cpp
@@ -645,6 +645,19 @@ void RageSound::SetStopModeFromString( const RString &sStopMode )
class LunaRageSound: public Luna
{
public:
+ static int get_length(T* p, lua_State* L)
+ {
+ RageSoundReader* reader= p->GetSoundReader();
+ if(reader == NULL)
+ {
+ lua_pushnumber(L, -1.0f);
+ }
+ else
+ {
+ lua_pushnumber(L, reader->GetLength() / 1000.0f);
+ }
+ return 1;
+ }
static int pitch( T* p, lua_State *L )
{
RageSoundParams params( p->GetParams() );
@@ -703,6 +716,7 @@ public:
LunaRageSound()
{
+ ADD_METHOD(get_length);
ADD_METHOD( pitch );
ADD_METHOD( speed );
ADD_METHOD( volume );
diff --git a/src/RageSurface_Save_PNG.cpp b/src/RageSurface_Save_PNG.cpp
index 3504625577..f60ae44d65 100644
--- a/src/RageSurface_Save_PNG.cpp
+++ b/src/RageSurface_Save_PNG.cpp
@@ -106,7 +106,7 @@ static bool RageSurface_Save_PNG( RageFile &f, char szErrorbuf[1024], RageSurfac
png_set_write_fn( pPng, &f, RageFile_png_write, RageFile_png_flush );
png_set_compression_level( pPng, 1 );
- png_set_IHDR( pPng, pInfo, pImg->w, pImg->h, 8, bAlpha? PNG_COLOR_TYPE_RGBA:PNG_COLOR_TYPE_RGB,
+ png_set_IHDR( pPng, pInfo, pImg->w, pImg->h, 8, PNG_COLOR_TYPE_RGB,
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE );
png_write_info( pPng, pInfo );
diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp
index be8bfb3718..55586ef849 100644
--- a/src/RageTexture.cpp
+++ b/src/RageTexture.cpp
@@ -76,7 +76,7 @@ void RageTexture::GetFrameDimensionsFromFileName( RString sPath, int* piFramesWi
const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
{
- return &m_TextureCoordRects[iFrameNo];
+ return &m_TextureCoordRects[iFrameNo % GetNumFrames()];
}
// lua start
diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp
index 9f5dbc57f1..6efc61883b 100644
--- a/src/RageUtil.cpp
+++ b/src/RageUtil.cpp
@@ -3,6 +3,7 @@
#include "RageMath.h"
#include "RageLog.h"
#include "RageFile.h"
+#include "RageSoundReader_FileReader.h"
#include "Foreach.h"
#include "LocalizedString.h"
#include "LuaBinding.h"
@@ -2431,8 +2432,8 @@ int LuaFunc_commify(lua_State* L)
}
LUAFUNC_REGISTER_COMMON(commify);
-void luafunc_approach_internal(lua_State* L, int valind, int goalind, int speedind);
-void luafunc_approach_internal(lua_State* L, int valind, int goalind, int speedind, int process_index)
+void luafunc_approach_internal(lua_State* L, int valind, int goalind, int speedind, const float mult);
+void luafunc_approach_internal(lua_State* L, int valind, int goalind, int speedind, const float mult, int process_index)
{
#define TONUMBER_NICE(dest, num_name, index) \
if(!lua_isnumber(L, index)) \
@@ -2451,7 +2452,7 @@ void luafunc_approach_internal(lua_State* L, int valind, int goalind, int speedi
{
luaL_error(L, "approach: speed %d is negative.", process_index);
}
- fapproach(val, goal, speed);
+ fapproach(val, goal, speed*mult);
lua_pushnumber(L, val);
}
@@ -2460,7 +2461,7 @@ int LuaFunc_approach(lua_State* L)
{
// Args: current, goal, speed
// Returns: new_current
- luafunc_approach_internal(L, 1, 2, 3, 1);
+ luafunc_approach_internal(L, 1, 2, 3, 1.0f, 1);
return 1;
}
LUAFUNC_REGISTER_COMMON(approach);
@@ -2468,16 +2469,24 @@ LUAFUNC_REGISTER_COMMON(approach);
int LuaFunc_multiapproach(lua_State* L);
int LuaFunc_multiapproach(lua_State* L)
{
- // Args: {currents}, {goals}, {speeds}
+ // Args: {currents}, {goals}, {speeds}, speed_multiplier
+ // speed_multiplier is optional, and is intended to be the delta time for
+ // the frame, so that this can be used every frame and have the current
+ // approach the goal at a framerate independent speed.
// Returns: {currents}
// Modifies the values in {currents} in place.
- if(lua_gettop(L) != 3)
+ if(lua_gettop(L) < 3)
{
luaL_error(L, "multiapproach: A table of current values, a table of goal values, and a table of speeds must be passed.");
}
size_t currents_len= lua_objlen(L, 1);
size_t goals_len= lua_objlen(L, 2);
size_t speeds_len= lua_objlen(L, 3);
+ float mult= 1.0f;
+ if(lua_isnumber(L, 4))
+ {
+ mult= lua_tonumber(L, 4);
+ }
if(currents_len != goals_len || currents_len != speeds_len)
{
luaL_error(L, "multiapproach: There must be the same number of current values, goal values, and speeds.");
@@ -2491,7 +2500,7 @@ int LuaFunc_multiapproach(lua_State* L)
lua_rawgeti(L, 1, i);
lua_rawgeti(L, 2, i);
lua_rawgeti(L, 3, i);
- luafunc_approach_internal(L, -3, -2, -1, i);
+ luafunc_approach_internal(L, -3, -2, -1, mult, i);
lua_rawseti(L, 1, i);
lua_pop(L, 3);
}
@@ -2500,6 +2509,23 @@ int LuaFunc_multiapproach(lua_State* L)
}
LUAFUNC_REGISTER_COMMON(multiapproach);
+int LuaFunc_get_music_file_length(lua_State* L);
+int LuaFunc_get_music_file_length(lua_State* L)
+{
+ // Args: file_path
+ // Returns: The length of the music in seconds.
+ RString path= SArg(1);
+ RString error;
+ RageSoundReader* sample= RageSoundReader_FileReader::OpenFile(path, error);
+ if(sample == NULL)
+ {
+ luaL_error(L, "The music file '%s' does not exist.", path.c_str());
+ }
+ lua_pushnumber(L, sample->GetLength() / 1000.0f);
+ return 1;
+}
+LUAFUNC_REGISTER_COMMON(get_music_file_length);
+
/*
* Copyright (c) 2001-2005 Chris Danford, Glenn Maynard
* All rights reserved.