From ed109a6006008fd37959f8b330e8d7cc70108a67 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Wed, 10 Jun 2015 08:46:39 -0600 Subject: [PATCH 01/14] Added hanubeki's translation of waiei's comment. --- src/NoteDisplay.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 947b7d110f..72c8cfbb88 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -802,6 +802,8 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, float offset = unzoomed_frame_height - (y_end_pos - y_start_pos); // ロングノート本体の長さが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; } } - // これは無いほうが綺麗につながっているように見える - // 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(); From 5f50a8ea260f9a9114ac0a11a651f0385586465a Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Wed, 10 Jun 2015 14:41:28 -0600 Subject: [PATCH 02/14] Added get_music_file_length and RageSound:get_length lua functions. Updated changelog. --- Docs/Changelog_sm5.txt | 8 +++++++ Docs/Luadoc/Lua.xml | 2 ++ Docs/Luadoc/LuaDocumentation.xml | 10 +++++++- src/RageSound.cpp | 14 +++++++++++ src/RageUtil.cpp | 40 ++++++++++++++++++++++++++------ 5 files changed, 66 insertions(+), 8 deletions(-) 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/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/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. From 3bd182b523fc266b6617ad412c4a0f36a8746426 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 10 Jun 2015 18:09:27 -0400 Subject: [PATCH 03/14] Potential holy war, but use UTF-8 always. --- src/NoteDisplay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 72c8cfbb88..f024a11de6 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -800,8 +800,8 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, if (!part_args.anchor_to_top) { float offset = unzoomed_frame_height - (y_end_pos - y_start_pos); - // ロングノート本体の長さがunzoomed_frame_height→0のときに、add_to_tex_coordを0→1にすればOK - // つまり、offsetを0→unzoomed_frame_heightにすると理想通りの表示になる -A.C + // 繝ュ繝ウ繧ー繝弱シ繝域悽菴薙ョ髟キ縺輔′unzoomed_frame_height竊0縺ョ縺ィ縺阪↓縲‖dd_to_tex_coord繧0竊1縺ォ縺吶l縺ーOK + // 縺、縺セ繧翫{ffset繧0竊置nzoomed_frame_height縺ォ縺吶k縺ィ逅諠ウ騾壹j縺ョ陦ィ遉コ縺ォ縺ェ繧 -A.C // Shift texture coord to fit hold length If hold length is less than // bottomcap frame size. (translated by hanubeki) if (offset>0){ From 829e861192408428df100705cb8b4281ec8d3ad9 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Thu, 11 Jun 2015 19:36:25 -0600 Subject: [PATCH 04/14] ActorUtil lua functions now check whether the actor has a name, which is required. --- src/ActorUtil.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } From c78950aaeb62828dbd353e2d033b50691c568d48 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Sun, 14 Jun 2015 08:55:42 -0600 Subject: [PATCH 05/14] Changed timing and life difficulty text to position value after label. Changed all AllowRepeatingInput metrics in _fallback to true. --- Docs/Changelog_language.txt | 4 ++++ Themes/_fallback/Languages/en.ini | 2 ++ Themes/_fallback/Scripts/02 Branches.lua | 8 +++----- Themes/_fallback/metrics.ini | 4 ++-- .../ScreenTitleMenu LifeDifficulty.lua | 18 +++++++++++------- .../ScreenTitleMenu TimingDifficulty.lua | 14 +++++++------- 6 files changed, 29 insertions(+), 21 deletions(-) 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/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/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..8dca88d4d1 100644 --- a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua @@ -3,23 +3,23 @@ return Def.ActorFrame { 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 +}; From 220e4c13b66d95206030ebf93fadaf62aa55fb5c Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Sun, 14 Jun 2015 08:59:24 -0600 Subject: [PATCH 06/14] Forgot to make this a local. --- Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua index 8dca88d4d1..a7cf24ffc6 100644 --- a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua @@ -1,3 +1,4 @@ +local label_text= false return Def.ActorFrame { LoadFont("Common Normal") .. { Text=GetTimingDifficulty(); From c561caec5fba05a738db7569038ce6ee0629f749 Mon Sep 17 00:00:00 2001 From: hanubeki Date: Tue, 16 Jun 2015 16:57:25 +0900 Subject: [PATCH 07/14] Update Japanese translation: [ScreenInitialScreenIsInvalid] InvalidScreenExplanation [ScreenTitleMenu] Hardest Timing --- Themes/_fallback/Languages/ja.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Themes/_fallback/Languages/ja.ini b/Themes/_fallback/Languages/ja.ini index 01d41aab1d..5dd881418d 100644 --- a/Themes/_fallback/Languages/ja.ini +++ b/Themes/_fallback/Languages/ja.ini @@ -1529,6 +1529,10 @@ HeaderText= HeaderSubText= HelpText= +[ScreenInitialScreenIsInvalid] +// 貂 -hanubeki +InvalidScreenExplanation=迴セ蝨ィ縺ョ繝繝シ繝槭↓險ュ螳壹&繧後◆蛻晄悄逕サ髱「縺梧怏蜉ケ縺ェ繧ゅョ縺ァ縺ッ縺ゅj縺セ縺帙s縲\n縺昴ョ逕サ髱「縺ッ迴セ蝨ィ縺ョ繝繝シ繝槭d_fallback繝繝シ繝槭ョ縺ゥ縺薙↓繧ょョ夂セゥ縺輔l縺ヲ縺縺セ縺帙s縲\n迴セ蝨ィ縺ョ繝繝シ繝槭↓縺翫¢繧九お繝ゥ繝シ縺ァ縺ゅj縲√ユ繝シ繝槭ョ菴懆縺ォ蝣ア蜻翫☆縺ケ縺阪b縺ョ縺ァ縺吶\nScroll Lock (繧ェ繝壹Ξ繝シ繧ソ繝シ繧ュ繝シ) 縺九i繧オ繝シ繝薙せ繝。繝九Η繝シ繧帝幕縺阪∝挨縺ョ繝繝シ繝槭↓螟画峩縺吶k縺薙→縺後〒縺阪∪縺吶 + [ScreenAppearanceOptions] // 貂 HeaderText=Appearance Options @@ -2183,6 +2187,8 @@ Play Online=Network Play Edit/Share=Edit/Share Exit=Exit Game Start=Game Start +# Timing Difficulty繧呈怙繧ょ宍縺励¥縺励◆蝣エ蜷医↓"Hardest Timing"縺ョ繝繧ュ繧ケ繝医′陦ィ遉コ縺輔l縺セ縺吶 +Hardest Timing=Justice Jukebox=Jukebox Report Bug=繝舌げ蝣ア蜻 Chat on IRC=IRC From 51add5730ea5044d458d15ba7d7b74e2caf1a414 Mon Sep 17 00:00:00 2001 From: hanubeki Date: Tue, 16 Jun 2015 17:36:36 +0900 Subject: [PATCH 08/14] Add missing string to /Themes/_fallback/Languages/ja.ini: [OptionNames] Swap Up/Down --- Themes/_fallback/Languages/ja.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/Themes/_fallback/Languages/ja.ini b/Themes/_fallback/Languages/ja.ini index 5dd881418d..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 From 4078010ebd10f7b734e4d7f7e4f3eebe5fefc4f3 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Tue, 16 Jun 2015 16:51:06 -0600 Subject: [PATCH 09/14] Change RunScriptFile to report errors through the error reporting system instead of just dialogs so that errors show when reloading scripts in game. --- src/LuaManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); From 42468ccccc2e8e490d6f9a68cfa4134fab19d1ba Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Thu, 18 Jun 2015 11:10:37 -0700 Subject: [PATCH 10/14] What *is* alignment, anyways? (realigned a bunch of preferences) --- src/PrefsManager.cpp | 85 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 42 deletions(-) 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 ), From e91a858ddd347447d54414e9e2091c2b77090c37 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Thu, 18 Jun 2015 23:30:24 -0600 Subject: [PATCH 11/14] Make RageTexture::GetTextureCoordRect wrap instead of seg fault when given an out of range frame. --- src/RageTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From eb87ca453054f1d03ae8250dc4bac7fd84f1ccd0 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Fri, 19 Jun 2015 13:58:55 -0600 Subject: [PATCH 12/14] Screenshot crash fix from Yaniel: apparently libpng expects you to tell it what it will end up with instead of what you are giving it --- src/RageSurface_Save_PNG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); From 7440f116b6311b24458cb77af1597b652b717abc Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Fri, 19 Jun 2015 16:21:29 -0600 Subject: [PATCH 13/14] Update version number to 5.0.9. --- CMake/SMDefs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 42ad044817d4178358dbefeef26c8d9041187af5 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Fri, 19 Jun 2015 20:53:13 -0400 Subject: [PATCH 14/14] Linux broke somehow. Restore it with system jpeg. --- CMake/CMakeMacros.cmake | 7 +++++++ StepmaniaCore.cmake | 17 +++++++++++------ extern/CMakeLists.txt | 6 ++---- src/CMakeLists.txt | 6 +++++- 4 files changed, 25 insertions(+), 11 deletions(-) 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/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/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/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}")