Merge branch 'master' into fix_hold/0609

This commit is contained in:
A.C
2015-09-09 22:53:47 +09:00
23 changed files with 189 additions and 91 deletions
+7
View File
@@ -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) function(sm_append_simple_target_property target property str)
get_target_property(current_property ${target} ${property}) get_target_property(current_property ${target} ${property})
if (current_property) if (current_property)
+1 -1
View File
@@ -1,7 +1,7 @@
# Set up version numbers according to the new scheme. # Set up version numbers according to the new scheme.
set(SM_VERSION_MAJOR 5) set(SM_VERSION_MAJOR 5)
set(SM_VERSION_MINOR 0) 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}") set(SM_VERSION_TRADITIONAL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}")
execute_process(COMMAND git rev-parse --short HEAD execute_process(COMMAND git rev-parse --short HEAD
+4
View File
@@ -16,6 +16,10 @@ Example:
This means that three strings were added to the "ScreenDebugOverlay" section, This means that three strings were added to the "ScreenDebugOverlay" section,
"Mute actions", "Mute actions on", and "Mute actions off". "Mute actions", "Mute actions on", and "Mute actions off".
2015/06/14
----------
* [ScreenTitleMenu] Hardest Timing
2015/06/06 2015/06/06
---------- ----------
* [ScreenInitialScreenIsInvalid] InvalidScreenExplanation * [ScreenInitialScreenIsInvalid] InvalidScreenExplanation
+8
View File
@@ -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. 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 2015/06/06
---------- ----------
* [ScreenInitialScreenIsInvalid] Error screen for themes that set an invalid * [ScreenInitialScreenIsInvalid] Error screen for themes that set an invalid
+2
View File
@@ -221,6 +221,7 @@
<Function name='getenv'/> <Function name='getenv'/>
<Function name='getfenv'/> <Function name='getfenv'/>
<Function name='getmetatable'/> <Function name='getmetatable'/>
<Function name='get_music_file_length'/>
<Function name='ipairs'/> <Function name='ipairs'/>
<Function name='ivalues'/> <Function name='ivalues'/>
<Function name='join'/> <Function name='join'/>
@@ -1393,6 +1394,7 @@
<Function name='GetDescriptions'/> <Function name='GetDescriptions'/>
</Class> </Class>
<Class name='RageSound'> <Class name='RageSound'>
<Function name='get_length'/>
<Function name='SetParam'/> <Function name='SetParam'/>
<Function name='SetProperty'/> <Function name='SetProperty'/>
<Function name='pitch'/> <Function name='pitch'/>
+9 -1
View File
@@ -208,6 +208,10 @@ save yourself some time, copy this for undocumented things:
<Function name='GetLifeDifficulty' return='int' arguments=''> <Function name='GetLifeDifficulty' return='int' arguments=''>
Returns the current Life Difficulty. Returns the current Life Difficulty.
</Function> </Function>
<Function name='get_music_file_length' return='float' arguments='string path'>
Returns the length of the music file found at path.<br />
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.
</Function>
<Function name='GetOSName' return='string' arguments=''> <Function name='GetOSName' return='string' arguments=''>
Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown") Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown")
</Function> </Function>
@@ -402,9 +406,10 @@ save yourself some time, copy this for undocumented things:
<Function name='MonthToString' return='string' arguments='Month m'> <Function name='MonthToString' return='string' arguments='Month m'>
Returns Month <code>m</code> as a string. Returns Month <code>m</code> as a string.
</Function> </Function>
<Function name='multiapproach' return='table' arguments='table currents, table goals, table speeds'> <Function name='multiapproach' return='table' arguments='table currents, table goals, table speeds, float multiplier'>
Similar to approach, but operates on tables of values instead of single values. This will modify the contents of <code>currents</code> in place, as well as returning <code>currents</code>.<br /> Similar to approach, but operates on tables of values instead of single values. This will modify the contents of <code>currents</code> in place, as well as returning <code>currents</code>.<br />
<code>currents</code>, <code>goals</code>, and <code>speeds</code> must all be the same size and contain only numbers.<br /> <code>currents</code>, <code>goals</code>, and <code>speeds</code> must all be the same size and contain only numbers.<br />
<code>multiplier</code> is optional. The speeds in the speeds table will be multiplied by <code>multiplier</code>. 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.<br />
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. 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.
</Function> </Function>
<Function name='next' return='void' arguments='table t, int index'> <Function name='next' return='void' arguments='table t, int index'>
@@ -4112,6 +4117,9 @@ save yourself some time, copy this for undocumented things:
<Description> <Description>
See <Link class='ActorSound' /> for loading a sound. See <Link class='ActorSound' /> for loading a sound.
</Description> </Description>
<Function name='get_length' return='float' arguments=''>
Returns the length of the sound loaded into this RageSound. Returns -1 if no sound is loaded.
</Function>
<Function name='SetParam' return='void' arguments='string sProperty, float fVal'> <Function name='SetParam' return='void' arguments='string sProperty, float fVal'>
Actually sets the value of <code>sProperty</code> to <code>fVal</code>. The supported properties depend on how the associated <Link class='ActorSound' /> was loaded. Actually sets the value of <code>sProperty</code> to <code>fVal</code>. The supported properties depend on how the associated <Link class='ActorSound' /> was loaded.
</Function> </Function>
+5
View File
@@ -158,6 +158,11 @@ elseif(LINUX)
message(FATAL_ERROR "zlib support required.") message(FATAL_ERROR "zlib support required.")
endif() endif()
find_package("JPEG")
if(NOT(${JPEG_FOUND}))
message(FATAL_ERROR "jpeg support required.")
endif()
find_library(DL_LIBRARY dl) find_library(DL_LIBRARY dl)
if(${LIBDL_FOUND}) if(${LIBDL_FOUND})
set(HAS_LIBDL TRUE) set(HAS_LIBDL TRUE)
+2
View File
@@ -2032,6 +2032,8 @@ Play Online=Network Play
Edit/Share=Edit/Share Edit/Share=Edit/Share
Exit=Exit Exit=Exit
Game Start=Game Start Game Start=Game Start
# The "Hardest Timing" text is displayed when the Timing Difficulty is at the hardest setting.
Hardest Timing=Justice
Jukebox=Jukebox Jukebox=Jukebox
Report Bug=Report A Bug! Report Bug=Report A Bug!
Chat on IRC=Chat on IRC! Chat on IRC=Chat on IRC!
+7
View File
@@ -957,6 +957,7 @@ SuddenOffset=Sudden Offset
SuperShuffle=Cement Mixer SuperShuffle=Cement Mixer
SoftShuffle=Soft Shuffle SoftShuffle=Soft Shuffle
Swap Sides=右側と左側の入れ替え Swap Sides=右側と左側の入れ替え
Swap Up/Down=上と下の入れ替え
Sync Machine=Sync Machine Sync Machine=Sync Machine
Sync Song=Sync Song Sync Song=Sync Song
Sync Tempo=Sync Tempo Sync Tempo=Sync Tempo
@@ -1529,6 +1530,10 @@ HeaderText=
HeaderSubText= HeaderSubText=
HelpText= HelpText=
[ScreenInitialScreenIsInvalid]
// 済 -hanubeki
InvalidScreenExplanation=現在のテーマに設定された初期画面が有効なものではありません。\nその画面は現在のテーマや_fallbackテーマのどこにも定義されていません。\n現在のテーマにおけるエラーであり、テーマの作者に報告すべきものです。\nScroll Lock (オペレーターキー) からサービスメニューを開き、別のテーマに変更することができます。
[ScreenAppearanceOptions] [ScreenAppearanceOptions]
// 済 // 済
HeaderText=Appearance Options HeaderText=Appearance Options
@@ -2183,6 +2188,8 @@ Play Online=Network Play
Edit/Share=Edit/Share Edit/Share=Edit/Share
Exit=Exit Exit=Exit
Game Start=Game Start Game Start=Game Start
# Timing Difficultyを最も厳しくした場合に"Hardest Timing"のテキストが表示されます。
Hardest Timing=Justice
Jukebox=Jukebox Jukebox=Jukebox
Report Bug=バグ報告 Report Bug=バグ報告
Chat on IRC=IRC Chat on IRC=IRC
+3 -5
View File
@@ -160,14 +160,12 @@ Branch = {
end, end,
PlayerOptions = function() PlayerOptions = function()
local pm = GAMESTATE:GetPlayMode() local pm = GAMESTATE:GetPlayMode()
local restricted = { "PlayMode_Oni", "PlayMode_Rave", local restricted = { PlayMode_Oni= true, PlayMode_Rave= true,
--"PlayMode_Battle" -- ?? --"PlayMode_Battle" -- ??
} }
local optionsScreen = "ScreenPlayerOptions" local optionsScreen = "ScreenPlayerOptions"
for i=1,#restricted do if restricted[pm] then
if restricted[i] == pm then optionsScreen = "ScreenPlayerOptionsRestricted"
optionsScreen = "ScreenPlayerOptionsRestricted"
end
end end
if SCREENMAN:GetTopScreen():GetGoToOptions() then if SCREENMAN:GetTopScreen():GetGoToOptions() then
return optionsScreen return optionsScreen
+2 -2
View File
@@ -1686,7 +1686,7 @@ Fallback="ScreenWithMenuElements"
# #
DoSwitchAnyways=false DoSwitchAnyways=false
WrapCursor=false WrapCursor=false
AllowRepeatingInput=false AllowRepeatingInput=true
PreSwitchPageSeconds=0 PreSwitchPageSeconds=0
PostSwitchPageSeconds=0 PostSwitchPageSeconds=0
ScrollerSecondsPerItem=0 ScrollerSecondsPerItem=0
@@ -2340,7 +2340,7 @@ MoreExitSelectedP2Command=
MoreExitUnselectedP1Command= MoreExitUnselectedP1Command=
MoreExitUnselectedP2Command= MoreExitUnselectedP2Command=
# #
AllowRepeatingChangeValueInput=false AllowRepeatingChangeValueInput=true
WrapValueInRow=true WrapValueInRow=true
[ScreenOptionsMaster] [ScreenOptionsMaster]
@@ -1,17 +1,21 @@
local label_text= false
return Def.ActorFrame { return Def.ActorFrame {
LoadFont("Common Normal") .. { LoadFont("Common Normal") .. {
Text=GetLifeDifficulty(); Text=GetLifeDifficulty();
AltText=""; AltText="";
InitCommand=cmd(horizalign,left;zoom,0.675); InitCommand=cmd(horizalign,left;zoom,0.675);
OnCommand=cmd(shadowlength,1); OnCommand= function(self)
BeginCommand=function(self) label_text= self
self:settextf( Screen.String("LifeDifficulty"), "" ); self:shadowlength(1):settextf(Screen.String("LifeDifficulty"), "");
end end,
}; };
LoadFont("Common Normal") .. { LoadFont("Common Normal") .. {
Text=GetLifeDifficulty(); Text=GetLifeDifficulty();
AltText=""; AltText="";
InitCommand=cmd(x,136;zoom,0.675;halign,0); InitCommand=cmd(zoom,0.675;halign,0);
OnCommand=cmd(shadowlength,1;skewx,-0.125); OnCommand= function(self)
self:shadowlength(1):skewx(-0.125):x(label_text:GetZoomedWidth()+8)
end,
}; };
}; };
@@ -1,21 +1,22 @@
local label_text= false
return Def.ActorFrame { return Def.ActorFrame {
LoadFont("Common Normal") .. { LoadFont("Common Normal") .. {
Text=GetTimingDifficulty(); Text=GetTimingDifficulty();
AltText=""; AltText="";
InitCommand=cmd(horizalign,left;zoom,0.675); InitCommand=cmd(horizalign,left;zoom,0.675);
OnCommand=cmd(shadowlength,1); OnCommand= function(self)
BeginCommand=function(self) label_text= self
self:settextf( Screen.String("TimingDifficulty"), "" ); self:shadowlength(1):settextf(Screen.String("TimingDifficulty"), "");
end end,
}; };
LoadFont("Common Normal") .. { LoadFont("Common Normal") .. {
Text=GetTimingDifficulty(); Text=GetTimingDifficulty();
AltText=""; AltText="";
InitCommand=cmd(x,136;zoom,0.675;halign,0); InitCommand=cmd(x,136;zoom,0.675;halign,0);
OnCommand=function(self) 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 if GetTimingDifficulty() == 9 then
self:settext("Justice"); self:settext(Screen.String("Hardest Timing"));
(cmd(zoom,0.5;diffuse,ColorLightTone( Color("Orange")) ))(self); (cmd(zoom,0.5;diffuse,ColorLightTone( Color("Orange")) ))(self);
else else
self:settext( GetTimingDifficulty() ); self:settext( GetTimingDifficulty() );
+2 -4
View File
@@ -11,9 +11,7 @@ if (APPLE OR MSVC)
endif() endif()
include(CMakeProject-png.cmake) include(CMakeProject-png.cmake)
if (NOT MSVC) if (APPLE)
include(CMakeProject-jpeg.cmake) include(CMakeProject-jpeg.cmake)
if (APPLE) include(CMakeProject-mad.cmake)
include(CMakeProject-mad.cmake)
endif()
endif() endif()
+10
View File
@@ -642,21 +642,31 @@ namespace
lua_pushboolean( L, IsRegistered(SArg(1)) ); lua_pushboolean( L, IsRegistered(SArg(1)) );
return 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 ) static int LoadAllCommands( lua_State *L )
{ {
Actor *p = Luna<Actor>::check( L, 1 ); Actor *p = Luna<Actor>::check( L, 1 );
name_error(p, L);
ActorUtil::LoadAllCommands( p, SArg(2) ); ActorUtil::LoadAllCommands( p, SArg(2) );
return 0; return 0;
} }
static int LoadAllCommandsFromName( lua_State *L ) static int LoadAllCommandsFromName( lua_State *L )
{ {
Actor *p = Luna<Actor>::check( L, 1 ); Actor *p = Luna<Actor>::check( L, 1 );
name_error(p, L);
ActorUtil::LoadAllCommandsFromName( *p, SArg(2), SArg(3) ); ActorUtil::LoadAllCommandsFromName( *p, SArg(2), SArg(3) );
return 0; return 0;
} }
static int LoadAllCommandsAndSetXY( lua_State *L ) static int LoadAllCommandsAndSetXY( lua_State *L )
{ {
Actor *p = Luna<Actor>::check( L, 1 ); Actor *p = Luna<Actor>::check( L, 1 );
name_error(p, L);
ActorUtil::LoadAllCommandsAndSetXY( p, SArg(2) ); ActorUtil::LoadAllCommandsAndSetXY( p, SArg(2) );
return 0; return 0;
} }
+5 -1
View File
@@ -493,6 +493,7 @@ elseif(APPLE)
) )
else() # Unix / Linux else() # Unix / Linux
# TODO: Remember to find and locate the zip archive files. # TODO: Remember to find and locate the zip archive files.
sm_list_replace(SMDATA_LINK_LIB 8 "${JPEG_LIBRARY}")
if (HAS_FFMPEG) if (HAS_FFMPEG)
if(WITH_SYSTEM_FFMPEG) if(WITH_SYSTEM_FFMPEG)
list(APPEND SMDATA_LINK_LIB list(APPEND SMDATA_LINK_LIB
@@ -596,14 +597,17 @@ if(NOT APPLE)
list(APPEND SM_INCLUDE_DIRS list(APPEND SM_INCLUDE_DIRS
"${SM_EXTERN_DIR}/glew-1.5.8/include" "${SM_EXTERN_DIR}/glew-1.5.8/include"
"${SM_EXTERN_DIR}/jsoncpp/include" "${SM_EXTERN_DIR}/jsoncpp/include"
"${SM_EXTERN_DIR}/libjpeg"
"${SM_EXTERN_DIR}/zlib" "${SM_EXTERN_DIR}/zlib"
) )
if(MSVC) if(MSVC)
list(APPEND SM_INCLUDE_DIRS list(APPEND SM_INCLUDE_DIRS
"${SM_EXTERN_DIR}/ffmpeg/include" "${SM_EXTERN_DIR}/ffmpeg/include"
"${SM_EXTERN_DIR}/libjpeg"
) )
else() else()
list(APPEND SM_INCLUDE_DIRS
"${JPEG_INCLUDE_DIR}"
)
if (HAS_FFMPEG) if (HAS_FFMPEG)
if (WITH_SYSTEM_FFMPEG) if (WITH_SYSTEM_FFMPEG)
list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}") list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}")
+1 -1
View File
@@ -771,7 +771,7 @@ bool LuaHelpers::RunScriptFile( const RString &sFile )
{ {
LUA->Release( L ); LUA->Release( L );
sError = ssprintf( "Lua runtime error: %s", sError.c_str() ); sError = ssprintf( "Lua runtime error: %s", sError.c_str() );
Dialog::OK( sError, "LUA_ERROR" ); LuaHelpers::ReportScriptError(sError);
return false; return false;
} }
LUA->Release( L ); LUA->Release( L );
+4 -5
View File
@@ -800,8 +800,10 @@ void NoteDisplay::DrawHoldPart(vector<Sprite*> &vpSpr,
if (!part_args.anchor_to_top) if (!part_args.anchor_to_top)
{ {
float offset = unzoomed_frame_height - (y_end_pos - y_start_pos); float offset = unzoomed_frame_height - (y_end_pos - y_start_pos);
// ロングノート本体の長さがunzoomed_frame_height→0のときに、add_to_tex_coordを0→1にすればOK // ロングノート本体の長さがunzoomed_frame_height→0のときに、add_to_tex_coordを0→1にすればOK
// つまり、offsetを0→unzoomed_frame_heightにすると理想通りの表示になる -A.C // つまり、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){ if (offset>0){
add_to_tex_coord = SCALE(offset, 0.0f, unzoomed_frame_height, 0.0f, 1.0f); add_to_tex_coord = SCALE(offset, 0.0f, unzoomed_frame_height, 0.0f, 1.0f);
} }
@@ -809,9 +811,6 @@ void NoteDisplay::DrawHoldPart(vector<Sprite*> &vpSpr,
add_to_tex_coord = 0.0f; 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(); DISPLAY->ClearAllTextures();
+43 -42
View File
@@ -159,51 +159,51 @@ void ValidateSongsPerPlay( int &val )
} }
PrefsManager::PrefsManager() : PrefsManager::PrefsManager() :
m_sCurrentGame ( "CurrentGame", "" ), m_sCurrentGame ( "CurrentGame", "" ),
m_sAnnouncer ( "Announcer", "" ), m_sAnnouncer ( "Announcer", "" ),
m_sTheme ( "Theme", SpecialFiles::BASE_THEME_NAME ), m_sTheme ( "Theme", SpecialFiles::BASE_THEME_NAME ),
m_sDefaultModifiers ( "DefaultModifiers", "" ), m_sDefaultModifiers ( "DefaultModifiers", "" ),
m_bWindowed ( "Windowed", true ), m_bWindowed ( "Windowed", true ),
m_iDisplayWidth ( "DisplayWidth", 854 ), m_iDisplayWidth ( "DisplayWidth", 854 ),
m_iDisplayHeight ( "DisplayHeight", 480 ), m_iDisplayHeight ( "DisplayHeight", 480 ),
m_fDisplayAspectRatio ( "DisplayAspectRatio", 16/9.f, ValidateDisplayAspectRatio ), m_fDisplayAspectRatio ( "DisplayAspectRatio", 16/9.f, ValidateDisplayAspectRatio ),
m_iDisplayColorDepth ( "DisplayColorDepth", 32 ), m_iDisplayColorDepth ( "DisplayColorDepth", 32 ),
m_iTextureColorDepth ( "TextureColorDepth", 32 ), m_iTextureColorDepth ( "TextureColorDepth", 32 ),
m_iMovieColorDepth ( "MovieColorDepth", 32 ), m_iMovieColorDepth ( "MovieColorDepth", 32 ),
m_bStretchBackgrounds ( "StretchBackgrounds", false ), m_bStretchBackgrounds ( "StretchBackgrounds", false ),
m_BGFitMode("BackgroundFitMode", BFM_CoverPreserve), m_BGFitMode ( "BackgroundFitMode", BFM_CoverPreserve),
m_HighResolutionTextures ( "HighResolutionTextures", HighResolutionTextures_Auto ), m_HighResolutionTextures ( "HighResolutionTextures", HighResolutionTextures_Auto ),
m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ), m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ),
m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ), m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ),
m_bAllowMultitexture ( "AllowMultitexture", true ), m_bAllowMultitexture ( "AllowMultitexture", true ),
m_bShowStats ( "ShowStats", TRUE_IF_DEBUG), m_bShowStats ( "ShowStats", TRUE_IF_DEBUG),
m_bShowBanners ( "ShowBanners", true ), m_bShowBanners ( "ShowBanners", true ),
m_bShowMouseCursor ( "ShowMouseCursor", true ), m_bShowMouseCursor ( "ShowMouseCursor", true ),
m_bHiddenSongs ( "HiddenSongs", false ), m_bHiddenSongs ( "HiddenSongs", false ),
m_bVsync ( "Vsync", true ), m_bVsync ( "Vsync", true ),
m_FastNoteRendering("FastNoteRendering", false), m_FastNoteRendering ( "FastNoteRendering", false),
m_bInterlaced ( "Interlaced", false ), m_bInterlaced ( "Interlaced", false ),
m_bPAL ( "PAL", false ), m_bPAL ( "PAL", false ),
m_bDelayedTextureDelete ( "DelayedTextureDelete", false ), m_bDelayedTextureDelete ( "DelayedTextureDelete", false ),
m_bDelayedModelDelete ( "DelayedModelDelete", false ), m_bDelayedModelDelete ( "DelayedModelDelete", false ),
m_BannerCache ( "BannerCache", BNCACHE_LOW_RES_PRELOAD ), m_BannerCache ( "BannerCache", BNCACHE_LOW_RES_PRELOAD ),
//m_BackgroundCache ( "BackgroundCache", BGCACHE_LOW_RES_PRELOAD ), //m_BackgroundCache ( "BackgroundCache", BGCACHE_LOW_RES_PRELOAD ),
m_bFastLoad ( "FastLoad", true ), m_bFastLoad ( "FastLoad", true ),
m_bFastLoadAdditionalSongs ( "FastLoadAdditionalSongs", true ), m_bFastLoadAdditionalSongs ( "FastLoadAdditionalSongs", true ),
m_NeverCacheList("NeverCacheList", ""), m_NeverCacheList ( "NeverCacheList", ""),
m_bOnlyDedicatedMenuButtons ( "OnlyDedicatedMenuButtons", false ), 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_iRegenComboAfterMiss ( "RegenComboAfterMiss", 5 ),
m_bMercifulDrain ( "MercifulDrain", false ), // negative life deltas are scaled by the players life percentage 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_bMinimum1FullSongInCourses ( "Minimum1FullSongInCourses", false ), // FEoS for 1st song, FailImmediate thereafter
m_bFailOffInBeginner ( "FailOffInBeginner", false ), m_bFailOffInBeginner ( "FailOffInBeginner", false ),
m_bFailOffForFirstStageEasy ( "FailOffForFirstStageEasy", false ), m_bFailOffForFirstStageEasy ( "FailOffForFirstStageEasy", false ),
@@ -214,7 +214,7 @@ PrefsManager::PrefsManager() :
m_bShowCaution ( "ShowCaution", true ), m_bShowCaution ( "ShowCaution", true ),
m_bShowNativeLanguage ( "ShowNativeLanguage", true ), m_bShowNativeLanguage ( "ShowNativeLanguage", true ),
m_iArcadeOptionsNavigation ( "ArcadeOptionsNavigation", 0 ), m_iArcadeOptionsNavigation ( "ArcadeOptionsNavigation", 0 ),
m_ThreeKeyNavigation("ThreeKeyNavigation", false), m_ThreeKeyNavigation ( "ThreeKeyNavigation", false ),
m_MusicWheelUsesSections ( "MusicWheelUsesSections", MusicWheelUsesSections_ALWAYS ), m_MusicWheelUsesSections ( "MusicWheelUsesSections", MusicWheelUsesSections_ALWAYS ),
m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 15 ), m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 15 ),
m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ), m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ),
@@ -223,17 +223,18 @@ PrefsManager::PrefsManager() :
m_iSongsPerPlay ( "SongsPerPlay", 3, ValidateSongsPerPlay ), m_iSongsPerPlay ( "SongsPerPlay", 3, ValidateSongsPerPlay ),
m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ), m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ),
m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ), m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ),
m_AllowMultipleToasties("AllowMultipleToasties", true), m_AllowMultipleToasties ("AllowMultipleToasties", true ),
m_MinTNSToHideNotes("MinTNSToHideNotes", TNS_W3), m_MinTNSToHideNotes ("MinTNSToHideNotes", TNS_W3 ),
m_ShowSongOptions ( "ShowSongOptions", Maybe_NO ), m_ShowSongOptions ( "ShowSongOptions", Maybe_NO ),
m_bDancePointsForOni ( "DancePointsForOni", true ), m_bDancePointsForOni ( "DancePointsForOni", true ),
m_bPercentageScoring ( "PercentageScoring", false ), 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_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_bDisqualification ( "Disqualification", false ),
m_bAutogenSteps ( "AutogenSteps", false ), m_bAutogenSteps ( "AutogenSteps", false ),
m_bAutogenGroupCourses ( "AutogenGroupCourses", true ), m_bAutogenGroupCourses ( "AutogenGroupCourses", true ),
m_bOnlyPreferredDifficulties ( "OnlyPreferredDifficulties", false ), m_bOnlyPreferredDifficulties ( "OnlyPreferredDifficulties", false ),
m_bBreakComboToGetItem ( "BreakComboToGetItem", false ), m_bBreakComboToGetItem ( "BreakComboToGetItem", false ),
m_bLockCourseDifficulties ( "LockCourseDifficulties", true ), m_bLockCourseDifficulties ( "LockCourseDifficulties", true ),
m_ShowDancingCharacters ( "ShowDancingCharacters", SDC_Random ), m_ShowDancingCharacters ( "ShowDancingCharacters", SDC_Random ),
@@ -261,8 +262,8 @@ PrefsManager::PrefsManager() :
m_fDebounceCoinInputTime ( "DebounceCoinInputTime", 0 ), m_fDebounceCoinInputTime ( "DebounceCoinInputTime", 0 ),
m_fPadStickSeconds ( "PadStickSeconds", 0 ), m_fPadStickSeconds ( "PadStickSeconds", 0 ),
m_EditRecordModeLeadIn("EditRecordModeLeadIn", 1.0f), m_EditRecordModeLeadIn ("EditRecordModeLeadIn", 1.0f ),
m_EditClearPromptThreshold("EditClearPromptThreshold", 50), m_EditClearPromptThreshold ("EditClearPromptThreshold", 50),
m_bForceMipMaps ( "ForceMipMaps", false ), m_bForceMipMaps ( "ForceMipMaps", false ),
m_bTrilinearFiltering ( "TrilinearFiltering", false ), m_bTrilinearFiltering ( "TrilinearFiltering", false ),
m_bAnisotropicFiltering ( "AnisotropicFiltering", false ), m_bAnisotropicFiltering ( "AnisotropicFiltering", false ),
@@ -290,10 +291,10 @@ PrefsManager::PrefsManager() :
m_bMonkeyInput ( "MonkeyInput", false ), m_bMonkeyInput ( "MonkeyInput", false ),
m_sMachineName ( "MachineName", "" ), m_sMachineName ( "MachineName", "" ),
m_sCoursesToShowRanking ( "CoursesToShowRanking", "" ), m_sCoursesToShowRanking ( "CoursesToShowRanking", "" ),
m_MuteActions("MuteActions", false), m_MuteActions ( "MuteActions", false ),
m_bAllowSongDeletion("AllowSongDeletion", false), m_bAllowSongDeletion ( "AllowSongDeletion", false ),
m_bQuirksMode ( "QuirksMode", false ), m_bQuirksMode ( "QuirksMode", false ),
/* Debug: */ /* Debug: */
m_bLogToDisk ( "LogToDisk", true ), m_bLogToDisk ( "LogToDisk", true ),
+14
View File
@@ -645,6 +645,19 @@ void RageSound::SetStopModeFromString( const RString &sStopMode )
class LunaRageSound: public Luna<RageSound> class LunaRageSound: public Luna<RageSound>
{ {
public: 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 ) static int pitch( T* p, lua_State *L )
{ {
RageSoundParams params( p->GetParams() ); RageSoundParams params( p->GetParams() );
@@ -703,6 +716,7 @@ public:
LunaRageSound() LunaRageSound()
{ {
ADD_METHOD(get_length);
ADD_METHOD( pitch ); ADD_METHOD( pitch );
ADD_METHOD( speed ); ADD_METHOD( speed );
ADD_METHOD( volume ); ADD_METHOD( volume );
+1 -1
View File
@@ -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_write_fn( pPng, &f, RageFile_png_write, RageFile_png_flush );
png_set_compression_level( pPng, 1 ); 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_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE );
png_write_info( pPng, pInfo ); png_write_info( pPng, pInfo );
+1 -1
View File
@@ -76,7 +76,7 @@ void RageTexture::GetFrameDimensionsFromFileName( RString sPath, int* piFramesWi
const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
{ {
return &m_TextureCoordRects[iFrameNo]; return &m_TextureCoordRects[iFrameNo % GetNumFrames()];
} }
// lua start // lua start
+33 -7
View File
@@ -3,6 +3,7 @@
#include "RageMath.h" #include "RageMath.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageFile.h" #include "RageFile.h"
#include "RageSoundReader_FileReader.h"
#include "Foreach.h" #include "Foreach.h"
#include "LocalizedString.h" #include "LocalizedString.h"
#include "LuaBinding.h" #include "LuaBinding.h"
@@ -2431,8 +2432,8 @@ int LuaFunc_commify(lua_State* L)
} }
LUAFUNC_REGISTER_COMMON(commify); 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, const float mult);
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, int process_index)
{ {
#define TONUMBER_NICE(dest, num_name, index) \ #define TONUMBER_NICE(dest, num_name, index) \
if(!lua_isnumber(L, 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); luaL_error(L, "approach: speed %d is negative.", process_index);
} }
fapproach(val, goal, speed); fapproach(val, goal, speed*mult);
lua_pushnumber(L, val); lua_pushnumber(L, val);
} }
@@ -2460,7 +2461,7 @@ int LuaFunc_approach(lua_State* L)
{ {
// Args: current, goal, speed // Args: current, goal, speed
// Returns: new_current // Returns: new_current
luafunc_approach_internal(L, 1, 2, 3, 1); luafunc_approach_internal(L, 1, 2, 3, 1.0f, 1);
return 1; return 1;
} }
LUAFUNC_REGISTER_COMMON(approach); LUAFUNC_REGISTER_COMMON(approach);
@@ -2468,16 +2469,24 @@ LUAFUNC_REGISTER_COMMON(approach);
int LuaFunc_multiapproach(lua_State* L); int LuaFunc_multiapproach(lua_State* L);
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} // Returns: {currents}
// Modifies the values in {currents} in place. // 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."); 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 currents_len= lua_objlen(L, 1);
size_t goals_len= lua_objlen(L, 2); size_t goals_len= lua_objlen(L, 2);
size_t speeds_len= lua_objlen(L, 3); 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) 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."); 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, 1, i);
lua_rawgeti(L, 2, i); lua_rawgeti(L, 2, i);
lua_rawgeti(L, 3, 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_rawseti(L, 1, i);
lua_pop(L, 3); lua_pop(L, 3);
} }
@@ -2500,6 +2509,23 @@ int LuaFunc_multiapproach(lua_State* L)
} }
LUAFUNC_REGISTER_COMMON(multiapproach); 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 * Copyright (c) 2001-2005 Chris Danford, Glenn Maynard
* All rights reserved. * All rights reserved.