fuckin merges reverted

This commit is contained in:
Flameshadowxeroshin
2011-03-14 19:30:41 -05:00
parent 96b90ee086
commit 4efd7886ed
122 changed files with 701 additions and 802 deletions
-1
View File
@@ -37,7 +37,6 @@ src/libtomcrypt/Release-*
src/libtommath/build-* src/libtommath/build-*
src/libtommath/Release-* src/libtommath/Release-*
src/*.old src/*.old
src/.deps
ver.cpp ver.cpp
lib*_link.a lib*_link.a
Data/UserPrefs Data/UserPrefs
+15 -12
View File
@@ -10,18 +10,7 @@ supported but exist anyways.)
_____________________________________________________________________________ _____________________________________________________________________________
================================================================================ ================================================================================
sm-ssc v1.2.4 | 20110??? sm-ssc v1.2.3 | 201103??
--------------------------------------------------------------------------------
20110313
--------
* [NotesWriterSM] Allow for either the #DESCRIPTION or #CREDIT tags to be used
for the .sm format's description token. [Wolfman2000]
* [ScreenEdit] Add Tap Note Cycling to allow inputting all of the taps. The way
to make holds and rolls are still the same as before. [Wolfman2000]
================================================================================
sm-ssc v1.2.3 | 20110323
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
20110309 20110309
@@ -36,6 +25,20 @@ sm-ssc v1.2.3 | 20110323
* [MeterDisplay] Add Lua binding. "Allow setting and changing the width * [MeterDisplay] Add Lua binding. "Allow setting and changing the width
dynamically. Phase out the "StreamWidth" node property; set it with dynamically. Phase out the "StreamWidth" node property; set it with
SetStreamWidth instead." [Glenn Maynard] SetStreamWidth instead." [Glenn Maynard]
* sm5svn r28280: "Previously, we didn't create MusicWheel sorts when the screen
loads; it was delayed until the screen begins. This allowed preloading before
the style is set. However, it caused a major skip when the screen starts,
because creating the sorts is fairly expensive.
Refactor this. Load the sorts when the screen is loaded, and then go through
them and quickly filter out unplayable data and handle other initialization
on begin. This is much faster, so we can more easily transition seamlessly
from the previous menu.
One known limitation: the sorts are created before we know the style, so we
have to guess. This means if you're in a style like dance-solo or
pump-halfdouble, sorts will still be based on regular mode. This affects the
difficulty, top grade and roulette sorts." [Glenn Maynard]
20110305 20110305
-------- --------
+1 -3
View File
@@ -1223,7 +1223,7 @@ Enter a new sub title transliteration.=Enter a new sub title transliteration.
Enter a new sub title.=Enter a new sub title. Enter a new sub title.=Enter a new sub title.
More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted.
No backgrounds available=No backgrounds available No backgrounds available=No backgrounds available
EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n
PlayRecordHelpText=Press START to end PlayRecordHelpText=Press START to end
Save successful.=Save successful. Save successful.=Save successful.
Saved as SM and DWI.=Saved as SM and DWI. Saved as SM and DWI.=Saved as SM and DWI.
@@ -1244,7 +1244,6 @@ Description=Description
Chart Style=Chart Style Chart Style=Chart Style
Main title=Main title Main title=Main title
Subtitle=Subtitle Subtitle=Subtitle
Tap Note=Tap Note
Tap Steps=Tap Steps Tap Steps=Tap Steps
Jumps=Jumps Jumps=Jumps
Hands=Hands Hands=Hands
@@ -1926,7 +1925,6 @@ Insert beat and shift down=Insert beat and shift down
Shift BPM changes and stops down one beat=Shift BPM changes and stops down one beat Shift BPM changes and stops down one beat=Shift BPM changes and stops down one beat
Delete beat and shift up=Delete beat and shift up Delete beat and shift up=Delete beat and shift up
Shift BPM changes and stops up one beat=Shift BPM changes and stops up one beat Shift BPM changes and stops up one beat=Shift BPM changes and stops up one beat
Cycle between tap notes=Cycle between tap notes
Lay mine=Lay mine Lay mine=Lay mine
Lay lift=Lay lift Lay lift=Lay lift
Add to/remove from right half=Add to/remove from right half Add to/remove from right half=Add to/remove from right half
-4
View File
@@ -647,9 +647,6 @@ LyricBackChangedCommand=LyricCommand,"Back"
InLength=0 InLength=0
OutLength=0 OutLength=0
[NotesWriterSM]
DescriptionUsesCreditField=false
[OptionRow] [OptionRow]
ShowModIcons=false ShowModIcons=false
ShowUnderlines=true ShowUnderlines=true
@@ -3652,7 +3649,6 @@ DescriptionFormat="%s:\n %s\n"
ChartStyleFormat="%s:\n %s\n" ChartStyleFormat="%s:\n %s\n"
MainTitleFormat="%s:\n %s\n" MainTitleFormat="%s:\n %s\n"
SubtitleFormat="%s:\n %s\n" SubtitleFormat="%s:\n %s\n"
TapNoteTypeFormat="%s: %s\n"
NumStepsFormat="%s: %d\n" NumStepsFormat="%s: %d\n"
NumJumpsFormat="%s: %d\n" NumJumpsFormat="%s: %d\n"
NumHoldsFormat="%s: %d\n" NumHoldsFormat="%s: %d\n"
@@ -0,0 +1 @@
_CombinedLifeMeterTug stream p1
@@ -0,0 +1 @@
_CombinedLifeMeterTug stream p2
-1
View File
@@ -649,7 +649,6 @@ MeterSetCommand=%function(self,param) \
end; \ end; \
if param.Meter then \ if param.Meter then \
if param.Meter >= 10 then \ if param.Meter >= 10 then \
self:textglowmode('TextGlowMode_Inner'); \
self:glowshift(); \ self:glowshift(); \
else \ else \
self:stopeffect(); \ self:stopeffect(); \
@@ -1,62 +1,8 @@
local t = Def.ActorFrame {}; return Def.ActorFrame {
--
--[[ local tGridSizeMajor = { 32, 32 };
local tGridSizeMinor = { 16, 16 };
local function CreateDebugGrid()
local t = Def.ActorFrame {};
local numX = math.ceil(SCREEN_WIDTH/tGridSizeMajor[1])
local numY = math.ceil(SCREEN_HEIGHT/tGridSizeMajor[2])
local offset = ( math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - SCREEN_WIDTH ) + SCREEN_WIDTH;
for a=1,numY do
for b=1,numX do
t[#t+1] = Def.Quad {
InitCommand=cmd(x,b*tGridSizeMajor[1]-(tGridSizeMajor[1]/2);y,a*tGridSizeMajor[2]-(tGridSizeMajor[2]/2));
OnCommand=cmd(zoomto,tGridSizeMajor[1]-2,tGridSizeMajor[2]-2;diffuse,color("1,1,1,0.25"));
};
end;
end;
return t
end --]]
--
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
LoadActor("VOL1-29-NTSC") .. {
InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT);
OnCommand=cmd(diffusealpha,0.75);
};
};
--
local bShow = 0;
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(visible,false);
ToggleConsoleDisplayMessageCommand=function(self)
bShow = 1 - bShow;
self:visible( bShow == 1 );
end;
-- Grid
LoadActor("_32") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32);
OnCommand=cmd(diffuse,color("0,0,0,0.5"));
};
LoadActor("_16") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16);
OnCommand=cmd(diffuse,color("1,1,1,0.125"));
};
--[[ LoadActor("_8") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/8,SCREEN_HEIGHT/8);
OnCommand=cmd(diffuse,color("#00BFE833"));
}; --]]
-- Left
Def.Quad { Def.Quad {
InitCommand=cmd(horizalign,left;x,SCREEN_LEFT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,0.5")); OnCommand=cmd(diffuse,color("0.25,0.15,0.25,1"));
};
-- Right
Def.Quad {
InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,0.5"));
}; };
}; };
--
return t
@@ -2,6 +2,8 @@
-- I prefer to keep these optional, incase another screen wants to hide -- I prefer to keep these optional, incase another screen wants to hide
-- these elements. -- these elements.
local t = Def.ActorFrame {}; local t = Def.ActorFrame {};
t[#t+1] = StandardDecorationFromFileOptional("Header","Header"); t[#t+1] = StandardDecorationFromFileOptional("Header","Header");
t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer");
return t return t
@@ -4,8 +4,10 @@ local t = Def.ActorFrame {};
t[#t+1] = LoadFont("Common Normal") .. { t[#t+1] = LoadFont("Common Normal") .. {
Text=gc:GetText(); Text=gc:GetText();
InitCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemInitCommand");
GainFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand");
LoseFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand");
}; };
t.GainFocusCommand=cmd(diffusealpha,1);
t.LoseFocusCommand=cmd(diffusealpha,0.5);
return t; return t;
@@ -0,0 +1,3 @@
return Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH,32);
};
@@ -0,0 +1,3 @@
return Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH,48);
};
+46 -24
View File
@@ -1,37 +1,59 @@
[Global] [Global]
FallbackTheme=_fallback FallbackTheme=_fallback
[CustomScoring]
ComboAboveThresholdAddsToScoreBonus=0
ComboScoreBonusThreshold=50
ComboScoreBonusValue=+1000
ComboMultiplier=0.0
DoubleNoteScoreMultiplier=2.0
TripleNoteScoreMultiplier=3.0
QuadOrHigherNoteScoreMultiplier=4.0
PointsW1=+50
PointsW2=+20
PointsW3=+10
PointsW4=+5
PointsW5=0
PointsMiss=-5
PointsHitMine=-5
PointsCheckpointHit=+5
PointsCheckpointMiss=-5
PointsNone=0
PointsHoldHeld=+5
PointsHoldLetGo=-5
[ScreenWithMenuElements] [ScreenWithMenuElements]
WaitForChildrenBeforeTweeningOut=true
ShowHeader=true ShowHeader=true
HeaderX=SCREEN_CENTER_X HeaderX=SCREEN_CENTER_X
HeaderY=SCREEN_TOP HeaderY=SCREEN_TOP
HeaderOnCommand= HeaderOnCommand=vertalign,top;diffuse,color("0.5,0.25,0.35,1");
HeaderOffCommand= HeaderOffCommand=
#
ShowFooter=true ShowFooter=true
FooterX=SCREEN_CENTER_X FooterX=SCREEN_CENTER_X
FooterY=SCREEN_BOTTOM FooterY=SCREEN_BOTTOM
FooterOnCommand= FooterOnCommand=vertalign,bottom;diffuse,color("0.5,0.25,0.35,1");
FooterOffCommand= FooterOffCommand=
#
TimerX=SCREEN_WIDTH-64
TimerY=SCREEN_TOP+48-4.5
TimerOnCommand=
TimerOffCommand=
[MenuTimer]
# Text
Text1OnCommand=stopeffect;stoptweening;vertalign,bottom;horizalign,right
Text1FormatFunction=function(fSeconds) \
return string.format("%0.1f", fSeconds); \
end
FrameOnCommand=
# Warning
Warning10Command=diffuseshift;effectperiod,1;effectcolor2,Color("Red");effectcolor1,color("0.5,0,0,1");
[ScreenTitleMenu] [ScreenTitleMenu]
ShowHeader=true ScrollerY=SCREEN_CENTER_Y*1.5
ShowFooter=true ScrollerOnCommand=
# New: Load ScrollerItem SpacingX/Y
ScrollerTransform=function(self,offset,itemIndex,numItems) \
local fSpaceX = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingX"); \
local fSpaceY = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingY"); \
self:x( (i-1) * fSpaceX ); \
self:y( (i-1) * fSpaceY ); \
end;
# New: Adjust menu items
ScrollerItemSpacingX=0
ScrollerItemSpacingY=24
ScrollerItemInitCommand=zoom,1;shadowlength,1
ScrollerItemGainFocusCommand=finishtweening;linear,0.125;zoom,1.25
ScrollerItemLoseFocusCommand=finishtweening;linear,0.125;zoom,1
[ScreenSelectMusic] [ScreenSelectMusic]
MusicWheelX=SCREEN_RIGHT-128-18
MusicWheelOnCommand=draworder,-1
[MusicWheel]
ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ); self:y( offsetFromCenter*48 ); end
NumWheelItems=13
+1 -1
View File
@@ -50,7 +50,7 @@
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>10.4.10</string> <string>10.4.10</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Copyright 2001-2011</string> <string>Copyright 2001-2010</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>SMApplication</string> <string>SMApplication</string>
</dict> </dict>
+8 -24
View File
@@ -7099,7 +7099,7 @@
GCC_DYNAMIC_NO_PIC = YES; GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = NO; GCC_FAST_MATH = YES;
GCC_FAST_OBJC_DISPATCH = NO; GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7112,20 +7112,16 @@
GCC_UNROLL_LOOPS = YES; GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0; GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES; GCC_WARN_SHADOW = NO;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = NO; GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
@@ -7636,7 +7632,7 @@
GCC_DYNAMIC_NO_PIC = YES; GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = NO; GCC_FAST_MATH = YES;
GCC_FAST_OBJC_DISPATCH = NO; GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7648,20 +7644,16 @@
GCC_UNROLL_LOOPS = YES; GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0; GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES; GCC_WARN_SHADOW = NO;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
@@ -7971,7 +7963,7 @@
GCC_DYNAMIC_NO_PIC = YES; GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = NO; GCC_FAST_MATH = YES;
GCC_FAST_OBJC_DISPATCH = NO; GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7983,20 +7975,16 @@
GCC_UNROLL_LOOPS = YES; GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0; GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES; GCC_WARN_SHADOW = NO;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
@@ -8100,7 +8088,7 @@
GCC_DYNAMIC_NO_PIC = YES; GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = NO; GCC_FAST_MATH = YES;
GCC_FAST_OBJC_DISPATCH = NO; GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -8112,20 +8100,16 @@
GCC_UNROLL_LOOPS = YES; GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0; GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES; GCC_WARN_SHADOW = NO;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
+1 -1
View File
@@ -445,7 +445,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
{ {
// find the middle, and split based on iColNum // find the middle, and split based on iColNum
// it's unknown if this will work for routine. // it's unknown if this will work for routine.
const int iMiddleColumn = static_cast<int>(floor(pStyle->m_iColsPerPlayer/2.0f)); const int iMiddleColumn = floor(pStyle->m_iColsPerPlayer/2.0f);
if( iColNum > iMiddleColumn-1 ) if( iColNum > iMiddleColumn-1 )
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset); fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset);
else else
+2 -2
View File
@@ -34,8 +34,8 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay
fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat );
fStartBeat = truncf(fStartBeat)+1; fStartBeat = truncf(fStartBeat)+1;
const float lStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat ); const float fStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat );
const float fEndSecond = lStartSecond + fSecsRemaining; const float fEndSecond = fStartSecond + fSecsRemaining;
fEndBeat = pSong->GetBeatFromElapsedTime( fEndSecond ); fEndBeat = pSong->GetBeatFromElapsedTime( fEndSecond );
fEndBeat = truncf(fEndBeat)+1; fEndBeat = truncf(fEndBeat)+1;
+11 -9
View File
@@ -32,10 +32,7 @@ struct Attack
bGlobal = false; bGlobal = false;
bShowInAttackList = true; bShowInAttackList = true;
} }
Attack(): level(ATTACK_LEVEL_1), fStartSecond(-1), Attack() { MakeBlank(); }
fSecsRemaining(0), sModifiers(RString()),
bOn(false), bGlobal(false), bShowInAttackList(true)
{} // MakeBlank() is effectively called here.
Attack( Attack(
AttackLevel level_, AttackLevel level_,
float fStartSecond_, float fStartSecond_,
@@ -43,11 +40,16 @@ struct Attack
RString sModifiers_, RString sModifiers_,
bool bOn_, bool bOn_,
bool bGlobal_, bool bGlobal_,
bool bShowInAttackList_ = true ): bool bShowInAttackList_ = true )
level(level_), fStartSecond(fStartSecond_), {
fSecsRemaining(fSecsRemaining_), sModifiers(sModifiers_), level = level_;
bOn(bOn_), bGlobal(bGlobal_), fStartSecond = fStartSecond_;
bShowInAttackList(bShowInAttackList_) {} fSecsRemaining = fSecsRemaining_;
sModifiers = sModifiers_;
bOn = bOn_;
bGlobal = bGlobal_;
bShowInAttackList = bShowInAttackList_;
}
void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const; void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const;
void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const; void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const;
+2 -2
View File
@@ -80,11 +80,11 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
bool bSoundIsGlobal = true; bool bSoundIsGlobal = true;
{ {
PlayerNumber pn = GetNextEnabledPlayer((PlayerNumber)-1); PlayerNumber pn = GetNextEnabledPlayer((PlayerNumber)-1);
const TapNote &tap = tn[pn]; const TapNote &t = tn[pn];
pn = GetNextEnabledPlayer(pn); pn = GetNextEnabledPlayer(pn);
while( pn != PLAYER_INVALID ) while( pn != PLAYER_INVALID )
{ {
if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex ) if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != t.iKeysoundIndex )
bSoundIsGlobal = false; bSoundIsGlobal = false;
pn = GetNextEnabledPlayer(pn); pn = GetNextEnabledPlayer(pn);
} }
+3 -3
View File
@@ -77,9 +77,9 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo
else else
{ {
// import as a single layer // import as a single layer
BGAnimationLayer* bgLayer = new BGAnimationLayer; BGAnimationLayer* pLayer = new BGAnimationLayer;
bgLayer->LoadFromNode( pKey ); pLayer->LoadFromNode( pKey );
this->AddChild( bgLayer ); this->AddChild( pLayer );
} }
} }
} }
+3 -3
View File
@@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( !change.m_sTransition.empty() ) if( !change.m_sTransition.empty() )
{ {
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition ); map<RString,BackgroundTransition>::const_iterator iter = mapNameToTransition.find( change.m_sTransition );
ASSERT( lIter != mapNameToTransition.end() ); ASSERT( iter != mapNameToTransition.end() );
const BackgroundTransition &bt = lIter->second; const BackgroundTransition &bt = iter->second;
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves ); m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
m_pFadingBGA->RunCommands( *bt.cmdRoot ); m_pFadingBGA->RunCommands( *bt.cmdRoot );
} }
-2
View File
@@ -250,11 +250,9 @@ void BeginnerHelper::DrawPrimitives()
m_sStepCircle[scd][scde].Draw(); m_sStepCircle[scd][scde].Draw();
if( DrawCelShaded ) if( DrawCelShaded )
{
FOREACH_PlayerNumber( pn ) // Draw each dancer FOREACH_PlayerNumber( pn ) // Draw each dancer
if( GAMESTATE->IsHumanPlayer(pn) ) if( GAMESTATE->IsHumanPlayer(pn) )
m_pDancer[pn]->DrawCelShaded(); m_pDancer[pn]->DrawCelShaded();
}
else else
{ {
DISPLAY->SetLighting( true ); DISPLAY->SetLighting( true );
+4 -3
View File
@@ -5,9 +5,10 @@
#include "RageTextureID.h" #include "RageTextureID.h"
#include "ActorUtil.h" #include "ActorUtil.h"
Character::Character(): m_sCharDir(""), m_sCharacterID(""), Character::Character()
m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), {
m_bUsableInRave(false), m_iPreloadRefcount(0) {} m_iPreloadRefcount = 0;
}
bool Character::Load( RString sCharDir ) bool Character::Load( RString sCharDir )
{ {
+4 -4
View File
@@ -519,8 +519,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
if( e->iChooseIndex < int(vSongAndSteps.size()) ) if( e->iChooseIndex < int(vSongAndSteps.size()) )
{ {
resolved.pSong = vpSongs[e->iChooseIndex]; resolved.pSong = vpSongs[e->iChooseIndex];
const vector<Steps*> &mappedSongs = mapSongToSteps[resolved.pSong]; const vector<Steps*> &vpSongs = mapSongToSteps[resolved.pSong];
resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ]; resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ];
} }
else else
{ {
@@ -930,8 +930,8 @@ const CourseEntry *Course::FindFixedSong( const Song *pSong ) const
FOREACH_CONST( CourseEntry, m_vEntries, e ) FOREACH_CONST( CourseEntry, m_vEntries, e )
{ {
const CourseEntry &entry = *e; const CourseEntry &entry = *e;
Song *lSong = entry.songID.ToSong(); Song *pSong = entry.songID.ToSong();
if( pSong == lSong ) if( pSong == pSong )
return &entry; return &entry;
} }
+12 -3
View File
@@ -55,9 +55,18 @@ public:
float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only.
int iGainLives; // lives gained back at the beginning of the next song int iGainLives; // lives gained back at the beginning of the next song
CourseEntry(): bSecret(false), bNoDifficult(false), CourseEntry()
songSort(SongSort_Randomize), iChooseIndex(0), {
sModifiers(RString("")), fGainSeconds(0), iGainLives(-1) {} bSecret = false;
bNoDifficult = false;
songSort = SongSort_Randomize;
iChooseIndex = 0;
sModifiers = "";
fGainSeconds = 0;
iGainLives = -1;
}
bool IsFixedSong() const { return songID.IsValid(); } bool IsFixedSong() const { return songID.IsValid(); }
+1 -1
View File
@@ -464,7 +464,7 @@ void EditCourseUtil::PrepareForPlay()
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_GoalType = GoalType_Time; PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_GoalType = GoalType_Time;
Course *pCourse = GAMESTATE->m_pCurCourse; Course *pCourse = GAMESTATE->m_pCurCourse;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = static_cast<int>(pCourse->m_fGoalSeconds); PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = pCourse->m_fGoalSeconds;
} }
void EditCourseUtil::GetAllEditCourses( vector<Course*> &vpCoursesOut ) void EditCourseUtil::GetAllEditCourses( vector<Course*> &vpCoursesOut )
+6 -6
View File
@@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const
bool Font::FontCompleteForString( const wstring &str ) const bool Font::FontCompleteForString( const wstring &str ) const
{ {
map<wchar_t,glyph*>::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); map<wchar_t,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH );
if( mapDefault == m_iCharToGlyph.end() ) if( m_pDefault == m_iCharToGlyph.end() )
RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() ); RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() );
for( unsigned i = 0; i < str.size(); ++i ) for( unsigned i = 0; i < str.size(); ++i )
{ {
// If the glyph for this character is the default glyph, we're incomplete. // If the glyph for this character is the default glyph, we're incomplete.
const glyph &g = GetGlyph( str[i] ); const glyph &g = GetGlyph( str[i] );
if( &g == mapDefault->second ) if( &g == m_pDefault->second )
return false; return false;
} }
return true; return true;
@@ -718,8 +718,8 @@ void Font::Load( const RString &sIniPath, RString sChars )
for(unsigned i = 0; i < ImportList.size(); ++i) for(unsigned i = 0; i < ImportList.size(); ++i)
{ {
RString fPath = THEME->GetPathF( "", ImportList[i], true ); RString path = THEME->GetPathF( "", ImportList[i], true );
if( fPath == "" ) if( path == "" )
{ {
RString s = ssprintf( "Font \"%s\" imports a font \"%s\" that doesn't exist", sIniPath.c_str(), ImportList[i].c_str() ); RString s = ssprintf( "Font \"%s\" imports a font \"%s\" that doesn't exist", sIniPath.c_str(), ImportList[i].c_str() );
Dialog::OK( s ); Dialog::OK( s );
@@ -727,7 +727,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
} }
Font subfont; Font subfont;
subfont.Load(fPath,""); subfont.Load(path,"");
MergeFont(subfont); MergeFont(subfont);
//FONT->UnloadFont(subfont); //FONT->UnloadFont(subfont);
} }
+5 -5
View File
@@ -76,23 +76,23 @@ void Foreground::Update( float fDeltaTime )
/* Update the actor even if we're about to hide it, so queued commands /* Update the actor even if we're about to hide it, so queued commands
* are always run. */ * are always run. */
float lDeltaTime; float fDeltaTime;
if( !bga.m_bga->GetVisible() ) if( !bga.m_bga->GetVisible() )
{ {
bga.m_bga->SetVisible( true ); bga.m_bga->SetVisible( true );
const float fStartSecond = m_pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat ); const float fStartSecond = m_pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat );
lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; fDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond;
} }
else else
{ {
lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
} }
// This shouldn't go down, but be safe: // This shouldn't go down, but be safe:
lDeltaTime = max( lDeltaTime, 0 ); fDeltaTime = max( fDeltaTime, 0 );
bga.m_bga->Update( lDeltaTime / fRate ); bga.m_bga->Update( fDeltaTime / fRate );
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat )
{ {
+2 -2
View File
@@ -93,8 +93,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
if( m_pSteps == NULL && m_dc != Difficulty_Invalid ) if( m_pSteps == NULL && m_dc != Difficulty_Invalid )
{ {
// Why is this checking for all players? // Why is this checking for all players?
FOREACH_HumanPlayer( human ) FOREACH_HumanPlayer( pn )
if( GAMESTATE->m_PreferredDifficulty[human] != m_dc ) if( GAMESTATE->m_PreferredDifficulty[pn] != m_dc )
return false; return false;
} }
+2 -2
View File
@@ -2361,9 +2361,9 @@ public:
return 1; return 1;
} }
static int GetCurrentStepsCredits( T* t, lua_State *L ) static int GetCurrentStepsCredits( T* p, lua_State *L )
{ {
const Song* pSong = t->m_pCurSong; const Song* pSong = p->m_pCurSong;
if( pSong == NULL ) if( pSong == NULL )
return 0; return 0;
+3 -3
View File
@@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile
vector<RString> sDeviceInputStrings; vector<RString> sDeviceInputStrings;
split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false );
for( unsigned j=0; j<sDeviceInputStrings.size() && j<unsigned(NUM_GAME_TO_DEVICE_SLOTS); j++ ) for( unsigned i=0; i<sDeviceInputStrings.size() && i<unsigned(NUM_GAME_TO_DEVICE_SLOTS); i++ )
{ {
DeviceInput DeviceI; DeviceInput DeviceI;
DeviceI.FromString( sDeviceInputStrings[j] ); DeviceI.FromString( sDeviceInputStrings[i] );
if( DeviceI.IsValid() ) if( DeviceI.IsValid() )
SetInputMap( DeviceI, GameI, j ); SetInputMap( DeviceI, GameI, i );
} }
} }
} }
+14 -6
View File
@@ -12,12 +12,20 @@ const int NUM_USER_GAME_TO_DEVICE_SLOTS = 2;
struct AutoMappingEntry struct AutoMappingEntry
{ {
AutoMappingEntry( int i, DeviceButton db, GameButton gb, bool b ): AutoMappingEntry( int i, DeviceButton db, GameButton gb, bool b )
m_iSlotIndex(i), m_deviceButton(db), {
m_gb(gb), m_bSecondController(b) {} m_iSlotIndex = i;
AutoMappingEntry(): m_iSlotIndex(-1), m_deviceButton = db;
m_deviceButton(DeviceButton_Invalid), m_gb(GameButton_Invalid), m_gb = gb;
m_bSecondController(false) {} m_bSecondController = b;
}
AutoMappingEntry()
{
m_iSlotIndex = -1;
m_deviceButton = DeviceButton_Invalid;
m_gb = GameButton_Invalid;
m_bSecondController = false;
}
bool IsEmpty() const { return m_deviceButton == DeviceButton_Invalid && m_gb == GameButton_Invalid; } bool IsEmpty() const { return m_deviceButton == DeviceButton_Invalid && m_gb == GameButton_Invalid; }
int m_iSlotIndex; int m_iSlotIndex;
-2
View File
@@ -25,8 +25,6 @@ private:
void CreateImpl(); void CreateImpl();
RString m_sGroup, m_sName; RString m_sGroup, m_sName;
ILocalizedStringImpl *m_pImpl; ILocalizedStringImpl *m_pImpl;
// Swallow up warnings. If they must be used, define them.
LocalizedString& operator=(const LocalizedString& rhs);
}; };
#endif #endif
-6
View File
@@ -42,9 +42,6 @@ public:
private: private:
lua_State *m_pLuaMain; lua_State *m_pLuaMain;
// Swallow up warnings. If they must be used, define them.
LuaManager& operator=(const LuaManager& rhs);
LuaManager(const LuaManager& rhs);
}; };
extern LuaManager *LUA; extern LuaManager *LUA;
@@ -158,9 +155,6 @@ private:
LuaReference *m_Name; LuaReference *m_Name;
LuaReference *m_pOldValue; LuaReference *m_pOldValue;
// Swallow up warnings. If they must be used, define them.
LuaThreadVariable& operator=(const LuaThreadVariable& rhs);
}; };
/** /**
+3 -3
View File
@@ -155,15 +155,15 @@ void ModIconRow::SetFromGameState()
continue; // skip continue; // skip
// search for a vacant spot // search for a vacant spot
for( int j=iPerferredCol; j<NUM_OPTION_ICONS; j++ ) for( int i=iPerferredCol; i<NUM_OPTION_ICONS; i++ )
{ {
if( vsText[j] != "" ) if( vsText[i] != "" )
{ {
continue; continue;
} }
else else
{ {
vsText[j] = sOption; vsText[i] = sOption;
break; break;
} }
} }
+6 -3
View File
@@ -66,9 +66,12 @@ private:
RageTexture* pTexture_, RageTexture* pTexture_,
float fDelaySecs_, float fDelaySecs_,
RageVector2 vTranslate_ RageVector2 vTranslate_
): )
pTexture(pTexture_), fDelaySecs(fDelaySecs_), {
vTranslate(vTranslate_) {} pTexture = pTexture_;
fDelaySecs = fDelaySecs_;
vTranslate = vTranslate_;
}
RageTexture* pTexture; RageTexture* pTexture;
float fDelaySecs; float fDelaySecs;
+2 -2
View File
@@ -847,9 +847,9 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow,
--prev; --prev;
if( prev->second.type == TapNote::hold_head ) if( prev->second.type == TapNote::hold_head )
{ {
int localStartRow = prev->first; int iStartRow = prev->first;
const TapNote &tn = prev->second; const TapNote &tn = prev->second;
if( localStartRow + tn.iDuration >= iEndRow ) if( iStartRow + tn.iDuration >= iEndRow )
end = prev; end = prev;
} }
} }
+5 -2
View File
@@ -250,8 +250,8 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
for( int t=0; t<out.GetNumTracks(); t++ ) for( int t=0; t<out.GetNumTracks(); t++ )
{ {
NoteData::iterator begin = out.begin( t ); NoteData::iterator begin = out.begin( t );
NoteData::iterator lEnd = out.end( t ); NoteData::iterator end = out.end( t );
while( begin != lEnd ) while( begin != end )
{ {
NoteData::iterator next = Increment( begin ); NoteData::iterator next = Increment( begin );
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
@@ -627,12 +627,15 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu
int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow )
{ {
int iMaxTailRow = -1; int iMaxTailRow = -1;
for( int t=0; t<in.GetNumTracks(); t++ )
{
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
const TapNote &tn = in.GetTapNote( t, iRow ); const TapNote &tn = in.GetTapNote( t, iRow );
if( tn.type == TapNote::hold_head ) if( tn.type == TapNote::hold_head )
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration ); iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
} }
}
return iMaxTailRow; return iMaxTailRow;
} }
+9 -13
View File
@@ -209,7 +209,7 @@ void NoteField::Load(
memset( m_pDisplays, 0, sizeof(m_pDisplays) ); memset( m_pDisplays, 0, sizeof(m_pDisplays) );
FOREACH_EnabledPlayer( pn ) FOREACH_EnabledPlayer( pn )
{ {
sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; RString sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin;
// XXX: Re-setup sNoteSkinLower. Unsure if inserting the skin again is needed. // XXX: Re-setup sNoteSkinLower. Unsure if inserting the skin again is needed.
if (sNoteSkinLower.empty()) if (sNoteSkinLower.empty())
@@ -1005,8 +1005,8 @@ void NoteField::DrawPrimitives()
m_pNoteData->GetTapNoteRange( c, iFirstRowToDraw, iLastRowToDraw+1, begin, end ); m_pNoteData->GetTapNoteRange( c, iFirstRowToDraw, iLastRowToDraw+1, begin, end );
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
int q = begin->first; int i = begin->first;
const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, q); const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, i);
// Switch modified by Wolfman2000, tested by Saturn2888 // Switch modified by Wolfman2000, tested by Saturn2888
// Fixes hold head overlapping issue, but not the rolls. // Fixes hold head overlapping issue, but not the rolls.
@@ -1031,11 +1031,10 @@ void NoteField::DrawPrimitives()
// TRICKY: If boomerang is on, then all notes in the range // TRICKY: If boomerang is on, then all notes in the range
// [iFirstRowToDraw,iLastRowToDraw] aren't necessarily visible. // [iFirstRowToDraw,iLastRowToDraw] aren't necessarily visible.
// Test every note to make sure it's on screen before drawing. // Test every note to make sure it's on screen before drawing.
if( !IsOnScreen( NoteRowToBeat(q), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) if( !IsOnScreen( NoteRowToBeat(i), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) )
continue; // skip continue; // skip
ASSERT_M( NoteRowToBeat(q) > -2000, ssprintf("%i %i %i, %f %f", q, iLastRowToDraw, ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, iLastRowToDraw, iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) );
iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) );
// See if there is a hold step that begins on this index. // See if there is a hold step that begins on this index.
// Only do this if the noteskin cares. // Only do this if the noteskin cares.
@@ -1044,7 +1043,7 @@ void NoteField::DrawPrimitives()
{ {
for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ ) for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ )
{ {
if( m_pNoteData->GetTapNote(c2, q).type == TapNote::hold_head) if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head)
{ {
bHoldNoteBeginsOnThisBeat = true; bHoldNoteBeginsOnThisBeat = true;
break; break;
@@ -1054,18 +1053,15 @@ void NoteField::DrawPrimitives()
bool bIsInSelectionRange = false; bool bIsInSelectionRange = false;
if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 )
bIsInSelectionRange = m_iBeginMarker<=q && q<m_iEndMarker; bIsInSelectionRange = m_iBeginMarker<=i && i<m_iEndMarker;
bool bIsAddition = (tn.source == TapNote::addition); bool bIsAddition = (tn.source == TapNote::addition);
bool bIsHopoPossible = (tn.bHopoPossible); bool bIsHopoPossible = (tn.bHopoPossible);
bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; bool bUseAdditionColoring = bIsAddition || bIsHopoPossible;
NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn];
displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(q), bHoldNoteBeginsOnThisBeat, displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT );
bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail,
m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels,
FADE_BEFORE_TARGETS_PERCENT );
bool bNoteIsUpcoming = NoteRowToBeat(q) > GAMESTATE->m_fSongBeat; bool bNoteIsUpcoming = NoteRowToBeat(i) > GAMESTATE->m_fSongBeat;
bAnyUpcomingInThisCol |= bNoteIsUpcoming; bAnyUpcomingInThisCol |= bNoteIsUpcoming;
} }
+7 -7
View File
@@ -282,22 +282,22 @@ try_again:
const NoteSkinData &data = iter->second; const NoteSkinData &data = iter->second;
RString sPath; // fill this in below RString sPath; // fill this in below
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
{ {
if( sButtonName.empty() ) if( sButtonName.empty() )
sPath = GetPathFromDirAndFile( *lIter, sElement ); sPath = GetPathFromDirAndFile( *iter, sElement );
else else
sPath = GetPathFromDirAndFile( *lIter, sButtonName+" "+sElement ); sPath = GetPathFromDirAndFile( *iter, sButtonName+" "+sElement );
if( !sPath.empty() ) if( !sPath.empty() )
break; // done searching break; // done searching
} }
if( sPath.empty() ) if( sPath.empty() )
{ {
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
{ {
if( !sButtonName.empty() ) if( !sButtonName.empty() )
sPath = GetPathFromDirAndFile( *lIter, "Fallback "+sElement ); sPath = GetPathFromDirAndFile( *iter, "Fallback "+sElement );
if( !sPath.empty() ) if( !sPath.empty() )
break; // done searching break; // done searching
} }
@@ -340,9 +340,9 @@ try_again:
GetFileContents( sPath, sNewFileName, true ); GetFileContents( sPath, sNewFileName, true );
RString sRealPath; RString sRealPath;
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
{ {
sRealPath = GetPathFromDirAndFile( *lIter, sNewFileName ); sRealPath = GetPathFromDirAndFile( *iter, sNewFileName );
if( !sRealPath.empty() ) if( !sRealPath.empty() )
break; // done searching break; // done searching
} }
-23
View File
@@ -204,29 +204,6 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F'
extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_TAP;
extern TapNote TAP_ADDITION_MINE; extern TapNote TAP_ADDITION_MINE;
/**
* @brief Retrieve the string representing the TapNote Type.
*
* TODO: Find a way to standardize this with the other enum string calls.
* @param tn the TapNote's type.
* @return the intended string. */
inline const RString TapNoteTypeToString( TapNote::Type tn )
{
switch( tn )
{
case TapNote::empty: return RString("empty");
case TapNote::tap: return RString("tap");
case TapNote::hold_head: return RString("hold_head");
case TapNote::hold_tail: return RString("hold_tail");
case TapNote::mine: return RString("mine");
case TapNote::lift: return RString("lift");
case TapNote::attack: return RString("attack");
case TapNote::autoKeysound: return RString("autoKeysound");
case TapNote::fake: return RString("fake");
default: return RString();
}
}
/** /**
* @brief The number of tracks allowed. * @brief The number of tracks allowed.
* *
+12 -12
View File
@@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
if( sNoteId != "00" ) if( sNoteId != "00" )
{ {
vTapNotes.push_back( TAP_ORIGINAL_TAP ); vTapNotes.push_back( TAP_ORIGINAL_TAP );
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
if( rInt != idToKeySoundIndex.end() ) if( it != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = rInt->second; vTapNotes.back().iKeysoundIndex = it->second;
} }
else else
{ {
@@ -762,28 +762,28 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
continue; continue;
// this is keysound file name. Looks like "#WAV1A" // this is keysound file name. Looks like "#WAV1A"
RString nData = it->second; RString sData = it->second;
RString sWavID = sName.Right(2); RString sWavID = sName.Right(2);
/* Due to bugs in some programs, many BMS files have a "WAV" extension /* Due to bugs in some programs, many BMS files have a "WAV" extension
* on files in the BMS for files that actually have some other extension. * on files in the BMS for files that actually have some other extension.
* Do a search. Don't do a wildcard search; if sData is "song.wav", * Do a search. Don't do a wildcard search; if sData is "song.wav",
* we might also have "song.png", which we shouldn't match. */ * we might also have "song.png", which we shouldn't match. */
if( !IsAFile(out.GetSongDir()+nData) ) if( !IsAFile(out.GetSongDir()+sData) )
{ {
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
for( unsigned i = 0; exts[i] != NULL; ++i ) for( unsigned i = 0; exts[i] != NULL; ++i )
{ {
RString fn = SetExtension( nData, exts[i] ); RString fn = SetExtension( sData, exts[i] );
if( IsAFile(out.GetSongDir()+fn) ) if( IsAFile(out.GetSongDir()+fn) )
{ {
nData = fn; sData = fn;
break; break;
} }
} }
} }
if( !IsAFile(out.GetSongDir()+nData) ) if( !IsAFile(out.GetSongDir()+sData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
sWavID.MakeUpper(); // HACK: undo the MakeLower() sWavID.MakeUpper(); // HACK: undo the MakeLower()
out.m_vsKeysoundFile.push_back( sData ); out.m_vsKeysoundFile.push_back( sData );
@@ -807,11 +807,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut ); float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure ); int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
RString nData = it->second; RString sData = it->second;
int totalPairs = nData.size() / 2; int totalPairs = sData.size() / 2;
for( int i = 0; i < totalPairs; ++i ) for( int i = 0; i < totalPairs; ++i )
{ {
RString sPair = nData.substr( i*2, 2 ); RString sPair = sData.substr( i*2, 2 );
int iVal = 0; int iVal = 0;
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
+5 -5
View File
@@ -750,9 +750,9 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut )
if( uVelocity == 0 ) if( uVelocity == 0 )
midiEventType = note_off; midiEventType = note_off;
MidiEvent mEvent = { count, midiEventType }; MidiEvent event = { count, midiEventType };
//float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) ); //float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) );
vMidiEvent[uNoteNumber].push_back( mEvent ); vMidiEvent[uNoteNumber].push_back( event );
} }
break; break;
default: default:
@@ -850,13 +850,13 @@ skip_track:
// hold note ending on the same row as a tap note. // hold note ending on the same row as a tap note.
NoteData::TrackMap::iterator begin, end; NoteData::TrackMap::iterator begin, end;
noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true ); noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true );
for( NoteData::TrackMap::iterator lIter = begin; lIter != end; lIter++ ) for( NoteData::TrackMap::iterator iter = begin; iter != end; iter++ )
{ {
// if( gd == expert && fBeat >= 27*4-2 && nnt == green ) // if( gd == expert && fBeat >= 27*4-2 && nnt == green )
// LOG->Trace( "shortening hold at %f, length %d", fBeat, length ); // LOG->Trace( "shortening hold at %f, length %d", fBeat, length );
ASSERT( lIter->second.type == TapNote::hold_head ); ASSERT( iter->second.type == TapNote::hold_head );
lIter->second.iDuration = MidiCountToNoteRow(count) - lIter->first - 2; iter->second.iDuration = MidiCountToNoteRow(count) - iter->first - 2;
} }
noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn ); noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn );
+14 -14
View File
@@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo
if( sNoteId != "00" ) if( sNoteId != "00" )
{ {
vTapNotes.push_back( TAP_ORIGINAL_TAP ); vTapNotes.push_back( TAP_ORIGINAL_TAP );
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
if( rInt != idToKeySoundIndex.end() ) if( it != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = rInt->second; vTapNotes.back().iKeysoundIndex = it->second;
} }
else else
{ {
@@ -609,31 +609,31 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
continue; continue;
// this is keysound file name. Looks like "#WAV1A" // this is keysound file name. Looks like "#WAV1A"
RString nData = it->second; RString sData = it->second;
RString sWavID = sName.Right(2); RString sWavID = sName.Right(2);
/* Due to bugs in some programs, many PMS files have a "WAV" extension /* Due to bugs in some programs, many PMS files have a "WAV" extension
* on files in the PMS for files that actually have some other extension. * on files in the PMS for files that actually have some other extension.
* Do a search. Don't do a wildcard search; if sData is "song.wav", * Do a search. Don't do a wildcard search; if sData is "song.wav",
* we might also have "song.png", which we shouldn't match. */ * we might also have "song.png", which we shouldn't match. */
if( !IsAFile(out.GetSongDir()+nData) ) if( !IsAFile(out.GetSongDir()+sData) )
{ {
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
for( unsigned i = 0; exts[i] != NULL; ++i ) for( unsigned i = 0; exts[i] != NULL; ++i )
{ {
RString fn = SetExtension( nData, exts[i] ); RString fn = SetExtension( sData, exts[i] );
if( IsAFile(out.GetSongDir()+fn) ) if( IsAFile(out.GetSongDir()+fn) )
{ {
nData = fn; sData = fn;
break; break;
} }
} }
} }
if( !IsAFile(out.GetSongDir()+nData) ) if( !IsAFile(out.GetSongDir()+sData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
sWavID.MakeUpper(); // HACK: undo the MakeLower() sWavID.MakeUpper(); // HACK: undo the MakeLower()
out.m_vsKeysoundFile.push_back( nData ); out.m_vsKeysoundFile.push_back( sData );
idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1; idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1;
LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() ); LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() );
} }
@@ -654,11 +654,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut ); float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure ); int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
RString nData = it->second; RString sData = it->second;
int totalPairs = nData.size() / 2; int totalPairs = sData.size() / 2;
for( int i = 0; i < totalPairs; ++i ) for( int i = 0; i < totalPairs; ++i )
{ {
RString sPair = nData.substr( i*2, 2 ); RString sPair = sData.substr( i*2, 2 );
int iVal = 0; int iVal = 0;
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
@@ -738,7 +738,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
{ {
// XXX: offset // XXX: offset
int iBPMNo; int iBPMNo;
sscanf( nData, "%x", &iBPMNo ); // data is in hexadecimal sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal
RString sBPM; RString sBPM;
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo ); RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
+2 -3
View File
@@ -37,7 +37,6 @@ void SMLoader::LoadFromSMTokens(
// insert stepstype hacks from GameManager.cpp here? -aj // insert stepstype hacks from GameManager.cpp here? -aj
out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType ); out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType );
out.SetDescription( sDescription ); out.SetDescription( sDescription );
out.SetCredit( sDescription ); // this is often used for both.
out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) );
// Handle hacks that originated back when StepMania didn't have // Handle hacks that originated back when StepMania didn't have
@@ -414,9 +413,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
if(arrayWarpsFromNegativeBPMs.size() > 0) if(arrayWarpsFromNegativeBPMs.size() > 0)
{ {
// zomg we already have some warps... // zomg we already have some warps...
for( unsigned j=0; j<arrayWarpsFromNegativeBPMs.size(); j++ ) for( unsigned i=0; i<arrayWarpsFromNegativeBPMs.size(); i++ )
{ {
out.AddWarpSegment( arrayWarpsFromNegativeBPMs[j] ); out.AddWarpSegment( arrayWarpsFromNegativeBPMs[i] );
} }
} }
// warp sorting will need to take place. // warp sorting will need to take place.
+1 -5
View File
@@ -15,9 +15,6 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "Song.h" #include "Song.h"
#include "Steps.h" #include "Steps.h"
#include "ThemeMetric.h"
ThemeMetric<bool> USE_CREDIT ( "NotesWriterSM", "DescriptionUsesCreditField" );
/** /**
* @brief Turn the BackgroundChange into a string. * @brief Turn the BackgroundChange into a string.
@@ -271,8 +268,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in )
GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) ); GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) );
lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" ); lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" );
lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) );
RString desc = (USE_CREDIT ? in.GetCredit() : in.GetDescription()); lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) );
lines.push_back( ssprintf( " %s:", SmEscape(desc).c_str() ) );
lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) );
+1 -1
View File
@@ -603,7 +603,7 @@ void OptionRow::UpdateEnabledDisabled()
case LAYOUT_SHOW_ONE_IN_ROW: case LAYOUT_SHOW_ONE_IN_ROW:
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
{ {
bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); bool bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end();
if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers ) if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers )
{ {
+7 -7
View File
@@ -149,15 +149,15 @@ public:
{ {
// Parse the basic configuration metric. // Parse the basic configuration metric.
Commands lCmds = ParseCommands( ENTRY(sParam) ); Commands cmds = ParseCommands( ENTRY(sParam) );
if( lCmds.v.size() < 1 ) if( cmds.v.size() < 1 )
RageException::Throw( "Parse error in \"ScreenOptionsMaster::%s\".", sParam.c_str() ); RageException::Throw( "Parse error in \"ScreenOptionsMaster::%s\".", sParam.c_str() );
m_Def.m_bOneChoiceForAllPlayers = false; m_Def.m_bOneChoiceForAllPlayers = false;
const int NumCols = atoi( lCmds.v[0].m_vsArgs[0] ); const int NumCols = atoi( cmds.v[0].m_vsArgs[0] );
for( unsigned i=1; i<lCmds.v.size(); i++ ) for( unsigned i=1; i<cmds.v.size(); i++ )
{ {
const Command &cmd = lCmds.v[i]; const Command &cmd = cmds.v[i];
RString sName = cmd.GetName(); RString sName = cmd.GetName();
if( sName == "together" ) m_Def.m_bOneChoiceForAllPlayers = true; if( sName == "together" ) m_Def.m_bOneChoiceForAllPlayers = true;
@@ -188,8 +188,8 @@ public:
} }
else if( sName == "broadcastonexport" ) else if( sName == "broadcastonexport" )
{ {
for( unsigned j=1; j<cmd.m_vsArgs.size(); j++ ) for( unsigned i=1; i<cmd.m_vsArgs.size(); i++ )
m_vsBroadcastOnExport.push_back( cmd.m_vsArgs[j] ); m_vsBroadcastOnExport.push_back( cmd.m_vsArgs[i] );
} }
else else
{ {
+1 -12
View File
@@ -75,18 +75,7 @@ struct OptionRowDefinition
return m_vEnabledForPlayers.find(pn) != m_vEnabledForPlayers.end(); return m_vEnabledForPlayers.find(pn) != m_vEnabledForPlayers.end();
} }
OptionRowDefinition(): m_sName(""), m_sExplanationName(""), OptionRowDefinition() { Init(); }
m_bOneChoiceForAllPlayers(false), m_selectType(SELECT_ONE),
m_layoutType(LAYOUT_SHOW_ALL_IN_ROW), m_iDefault(-1),
m_bExportOnChange(false), m_bAllowThemeItems(true),
m_bAllowThemeTitle(true), m_bAllowExplanation(true),
m_bShowChoicesListOnSelect(false)
{
m_vsChoices.clear();
m_vEnabledForPlayers.clear();
FOREACH_PlayerNumber( pn )
m_vEnabledForPlayers.insert( pn );
}
void Init() void Init()
{ {
m_sName = ""; m_sName = "";
+4 -4
View File
@@ -53,12 +53,12 @@ void OptionsCursor::Load( const RString &sMetricsGroup, bool bLoadCanGos )
} }
#undef LOAD_SPR #undef LOAD_SPR
m_iOriginalLeftX = static_cast<int>(m_sprLeft->GetX()); m_iOriginalLeftX = m_sprLeft->GetX();
m_iOriginalRightX = static_cast<int>(m_sprRight->GetX()); m_iOriginalRightX = m_sprRight->GetX();
if( bLoadCanGos ) if( bLoadCanGos )
{ {
m_iOriginalCanGoLeftX = static_cast<int>(m_sprCanGoLeft->GetX()); m_iOriginalCanGoLeftX = m_sprCanGoLeft->GetX();
m_iOriginalCanGoRightX = static_cast<int>(m_sprCanGoRight->GetX()); m_iOriginalCanGoRightX = m_sprCanGoRight->GetX();
} }
SetCanGo( false, false ); SetCanGo( false, false );
+14 -14
View File
@@ -138,17 +138,17 @@ void OptionListRow::SetUnderlines( const vector<bool> &aSelections, const Option
if( pTarget->m_Def.m_selectType == SELECT_ONE ) if( pTarget->m_Def.m_selectType == SELECT_ONE )
{ {
int iSelection = m_pOptions->GetOneSelection(sDest); int iSelection = m_pOptions->GetOneSelection(sDest);
const OptionRowHandler *lHandler = m_pOptions->m_Rows.find(sDest)->second; const OptionRowHandler *pHandler = m_pOptions->m_Rows.find(sDest)->second;
int iDefault = lHandler->GetDefaultOption(); int iDefault = pHandler->GetDefaultOption();
if( iDefault != -1 && iSelection != iDefault ) if( iDefault != -1 && iSelection != iDefault )
bSelected |= true; bSelected |= true;
} }
else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE ) else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE )
{ {
const vector<bool> &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; const vector<bool> &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second;
for( unsigned j=0; j<bTargetSelections.size(); j++ ) for( unsigned i=0; i<bTargetSelections.size(); i++ )
{ {
if( bTargetSelections[j] ) if( bTargetSelections[i] )
bSelected = true; bSelected = true;
} }
} }
@@ -400,10 +400,10 @@ void OptionsList::Input( const InputEventPlus &input )
wrap( iSelection, bTargetSelections.size() ); wrap( iSelection, bTargetSelections.size() );
SelectItem( sDest, iSelection ); SelectItem( sDest, iSelection );
Message lMsg("OptionsListQuickChange"); Message msg("OptionsListQuickChange");
lMsg.SetParam( "Player", pn ); msg.SetParam( "Player", pn );
lMsg.SetParam( "Direction", iDir ); msg.SetParam( "Direction", iDir );
MESSAGEMAN->Broadcast( lMsg ); MESSAGEMAN->Broadcast( msg );
} }
} }
return; return;
@@ -426,9 +426,9 @@ void OptionsList::Input( const InputEventPlus &input )
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
PositionCursor(); PositionCursor();
Message lMsg("OptionsListLeft"); Message msg("OptionsListLeft");
lMsg.SetParam( "Player", input.pn ); msg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( lMsg ); MESSAGEMAN->Broadcast( msg );
return; return;
} }
else if( input.MenuI == GAME_BUTTON_RIGHT ) else if( input.MenuI == GAME_BUTTON_RIGHT )
@@ -447,9 +447,9 @@ void OptionsList::Input( const InputEventPlus &input )
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
PositionCursor(); PositionCursor();
Message lMsg("OptionsListRight"); Message msg("OptionsListRight");
lMsg.SetParam( "Player", input.pn ); msg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( lMsg ); MESSAGEMAN->Broadcast( msg );
return; return;
} }
else if( input.MenuI == GAME_BUTTON_START ) else if( input.MenuI == GAME_BUTTON_START )
+7 -14
View File
@@ -175,15 +175,8 @@ ThemeMetric<bool> REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" );
* For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */
ThemeMetric<bool> ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); ThemeMetric<bool> ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" );
ThemeMetric<bool> CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); ThemeMetric<bool> CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" );
/** ThemeMetric<bool> SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); // sm-ssc addition
* @brief Do we score missed holds and rolls with HoldNoteScores?
*
* If set to true, missed holds and rolls are given LetGo judgments.
* If set to false, missed holds and rolls are given no judgment on the hold side of things. */
ThemeMetric<bool> SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" );
/** @brief How much of the song/course must have gone by before a Player's combo is colored? */
ThemeMetric<float> PERCENT_UNTIL_COLOR_COMBO ( "Player", "PercentUntilColorCombo" ); ThemeMetric<float> PERCENT_UNTIL_COLOR_COMBO ( "Player", "PercentUntilColorCombo" );
/** @brief How much combo must be earned before the announcer says "Combo Stopped"? */
ThemeMetric<int> COMBO_STOPPED_AT ( "Player", "ComboStoppedAt" ); ThemeMetric<int> COMBO_STOPPED_AT ( "Player", "ComboStoppedAt" );
ThemeMetric<float> ATTACK_RUN_TIME_RANDOM ( "Player", "AttackRunTimeRandom" ); ThemeMetric<float> ATTACK_RUN_TIME_RANDOM ( "Player", "AttackRunTimeRandom" );
ThemeMetric<float> ATTACK_RUN_TIME_MINE ( "Player", "AttackRunTimeMine" ); ThemeMetric<float> ATTACK_RUN_TIME_MINE ( "Player", "AttackRunTimeMine" );
@@ -2817,16 +2810,16 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
int iNumHoldsMissedThisRow = 0; int iNumHoldsMissedThisRow = 0;
// start at r-1 so that we consider holds whose end rows are equal to the checkpoint row // start at r-1 so that we consider holds whose end rows are equal to the checkpoint row
NoteData::all_tracks_iterator nIter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true );
for( ; !nIter.IsAtEnd(); ++nIter ) for( ; !iter.IsAtEnd(); ++iter )
{ {
TapNote &tn = *nIter; TapNote &tn = *iter;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNote::hold_head )
continue; continue;
int iStartRow = nIter.Row(); int iStartRow = iter.Row();
int iEndRow = iStartRow + tn.iDuration; int iEndRow = iStartRow + tn.iDuration;
int iTrack = nIter.Track(); int iTrack = iter.Track();
// "the first row after the hold head that lands on a beat" // "the first row after the hold head that lands on a beat"
int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows;
@@ -3200,7 +3193,7 @@ void Player::SetCombo( int iCombo, int iMisses )
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
{ {
int iSongIndexStartColoring = GAMESTATE->m_pCurCourse->GetEstimatedNumStages(); int iSongIndexStartColoring = GAMESTATE->m_pCurCourse->GetEstimatedNumStages();
iSongIndexStartColoring = static_cast<int>(floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO)); iSongIndexStartColoring = floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO);
bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring; bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring;
} }
else else
+2
View File
@@ -12,6 +12,8 @@
#include "CommonMetrics.h" #include "CommonMetrics.h"
#include <float.h> #include <float.h>
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; }
ThemeMetric<float> RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" ); ThemeMetric<float> RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" );
ThemeMetric<float> RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" ); ThemeMetric<float> RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" );
ThemeMetric<float> RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" ); ThemeMetric<float> RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" );
+1 -30
View File
@@ -7,42 +7,13 @@ class Steps;
class Trail; class Trail;
struct lua_State; struct lua_State;
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; }
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PlayerNumber.h" #include "PlayerNumber.h"
/** @brief Per-player options that are not saved between sessions. */ /** @brief Per-player options that are not saved between sessions. */
class PlayerOptions class PlayerOptions
{ {
public: public:
/** PlayerOptions() { Init(); };
* @brief Set up the PlayerOptions with some reasonable defaults.
*
* This code was taken from Init() to use proper initialization. */
PlayerOptions(): m_bSetScrollSpeed(false),
m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f),
m_fScrollSpeed(1.0f), m_SpeedfScrollSpeed(1.0f),
m_fScrollBPM(200), m_SpeedfScrollBPM(1.0f),
m_fDark(0), m_SpeedfDark(1.0f),
m_fBlind(0), m_SpeedfBlind(1.0f),
m_fCover(0), m_SpeedfCover(1.0f),
m_fRandAttack(0), m_SpeedfRandAttack(1.0f),
m_fSongAttack(0), m_SpeedfSongAttack(1.0f),
m_fPlayerAutoPlay(0), m_SpeedfPlayerAutoPlay(1.0f),
m_bSetTiltOrSkew(false),
m_fPerspectiveTilt(0), m_SpeedfPerspectiveTilt(1.0f),
m_fSkew(0), m_SpeedfSkew(1.0f),
m_fPassmark(0), m_SpeedfPassmark(1.0f),
m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f),
m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE),
m_ScoreDisplay(SCORING_ADD), m_sNoteSkin("")
{
ZERO( m_fAccels ); ONE( m_SpeedfAccels );
ZERO( m_fEffects ); ONE( m_SpeedfEffects );
ZERO( m_fAppearances ); ONE( m_SpeedfAppearances );
ZERO( m_fScrolls ); ONE( m_SpeedfScrolls );
ZERO( m_bTurns ); ZERO( m_bTransforms );
};
void Init(); void Init();
void Approach( const PlayerOptions& other, float fDeltaSeconds ); void Approach( const PlayerOptions& other, float fDeltaSeconds );
RString GetString( bool bForceNoteSkin = false ) const; RString GetString( bool bForceNoteSkin = false ) const;
+7 -7
View File
@@ -363,8 +363,8 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const
FOREACHM_CONST( StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j ) FOREACHM_CONST( StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j )
{ {
const StepsID &sid = j->first; const StepsID &id = j->first;
Steps* pSteps = sid.ToSteps( pSong, true ); Steps* pSteps = id.ToSteps( pSong, true );
CHECKPOINT_M( ssprintf("Profile::GetSongsActual: song %p, steps %p", pSong, pSteps) ); CHECKPOINT_M( ssprintf("Profile::GetSongsActual: song %p, steps %p", pSong, pSteps) );
// If the Steps isn't loaded on the current machine, then we can't // If the Steps isn't loaded on the current machine, then we can't
@@ -375,7 +375,7 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const
if( pSteps->m_StepsType != st ) if( pSteps->m_StepsType != st )
continue; continue;
CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", sid.ToString().c_str(), pSteps) ); CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", id.ToString().c_str(), pSteps) );
if( pSteps->GetDifficulty() != dc ) if( pSteps->GetDifficulty() != dc )
continue; // skip continue; // skip
CHECKPOINT; CHECKPOINT;
@@ -1303,13 +1303,13 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
if( style->GetName() != "Style" ) if( style->GetName() != "Style" )
continue; continue;
StyleID sID; StyleID s;
sID.LoadFromNode( style ); s.LoadFromNode( style );
if( !sID.IsValid() ) if( !s.IsValid() )
WARN_AND_CONTINUE; WARN_AND_CONTINUE;
style->GetTextValue( m_iNumSongsPlayedByStyle[sID] ); style->GetTextValue( m_iNumSongsPlayedByStyle[s] );
} }
} }
} }
+3 -3
View File
@@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID )
g_vLocalProfile.erase( i ); g_vLocalProfile.erase( i );
// Delete all references to this profileID // Delete all references to this profileID
FOREACH_CONST( Preference<RString>*, m_sDefaultLocalProfileID.m_v, j ) FOREACH_CONST( Preference<RString>*, m_sDefaultLocalProfileID.m_v, i )
{ {
if( (*j)->Get() == sProfileID ) if( (*i)->Get() == sProfileID )
(*j)->Set( "" ); (*i)->Set( "" );
} }
return true; return true;
} }
+1 -1
View File
@@ -760,7 +760,7 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
int iHeight = 480; int iHeight = 480;
// This used to be lrintf. However, lrintf causes odd resolutions like // This used to be lrintf. However, lrintf causes odd resolutions like
// 639x480 (4:3) and 853x480 (16:9). ceilf gives correct values. -aj // 639x480 (4:3) and 853x480 (16:9). ceilf gives correct values. -aj
int iWidth = static_cast<int>(ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio )); int iWidth = ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio );
timer.Touch(); timer.Touch();
RageSurfaceUtils::Zoom( surface, iWidth, iHeight ); RageSurfaceUtils::Zoom( surface, iWidth, iHeight );
// LOG->Trace( "%ix%i -> %ix%i (%.3f) in %f seconds", surface->w, surface->h, iWidth, iHeight, GetActualVideoModeParams().fDisplayAspectRatio, timer.GetDeltaTime() ); // LOG->Trace( "%ix%i -> %ix%i (%.3f) in %f seconds", surface->w, surface->h, iWidth, iHeight, GetActualVideoModeParams().fDisplayAspectRatio, timer.GetDeltaTime() );
+21 -25
View File
@@ -71,7 +71,6 @@ enum PixelFormat
}; };
const RString& PixelFormatToString( PixelFormat i ); const RString& PixelFormatToString( PixelFormat i );
/** @brief The parameters used for the present Video Mode. */
class VideoModeParams class VideoModeParams
{ {
public: public:
@@ -92,27 +91,24 @@ public:
RString sIconFile_, RString sIconFile_,
bool PAL_, bool PAL_,
float fDisplayAspectRatio_ float fDisplayAspectRatio_
): )
windowed(windowed_), {
width(width_), windowed = windowed_;
height(height_), width = width_;
bpp(bpp_), height = height_;
rate(rate_), bpp = bpp_;
vsync(vsync_), rate = rate_;
interlaced(interlaced_), vsync = vsync_;
bSmoothLines(bSmoothLines_), interlaced = interlaced_;
bTrilinearFiltering(bTrilinearFiltering_), bSmoothLines = bSmoothLines_;
bAnisotropicFiltering(bAnisotropicFiltering_), bTrilinearFiltering = bTrilinearFiltering_;
sWindowTitle(sWindowTitle_), bAnisotropicFiltering = bAnisotropicFiltering_;
sIconFile(sIconFile_), sWindowTitle = sWindowTitle_;
PAL(PAL_), sIconFile = sIconFile_;
fDisplayAspectRatio(fDisplayAspectRatio_) {} PAL = PAL_;
fDisplayAspectRatio = fDisplayAspectRatio_;
VideoModeParams(): windowed(false), width(0), height(0), }
bpp(0), rate(0), vsync(false), interlaced(false), VideoModeParams() {}
bSmoothLines(false), bTrilinearFiltering(false),
bAnisotropicFiltering(false), sWindowTitle(RString()),
sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0) {}
bool windowed; bool windowed;
int width; int width;
@@ -120,14 +116,14 @@ public:
int bpp; int bpp;
int rate; int rate;
bool vsync; bool vsync;
bool interlaced;
bool bSmoothLines; bool bSmoothLines;
bool bTrilinearFiltering; bool bTrilinearFiltering;
bool bAnisotropicFiltering; bool bAnisotropicFiltering;
RString sWindowTitle; bool interlaced;
RString sIconFile;
bool PAL; bool PAL;
float fDisplayAspectRatio; float fDisplayAspectRatio;
RString sWindowTitle;
RString sIconFile;
}; };
struct RenderTargetParam struct RenderTargetParam
+2 -8
View File
@@ -6,11 +6,8 @@
#include "RageFileBasic.h" #include "RageFileBasic.h"
struct lua_State; struct lua_State;
/** /* This is the high-level interface, which interfaces with RageFileObj implementations
* @brief High-level file access. * and RageFileManager. */
*
* This is the high-level interface, which interfaces with RageFileObj
* implementations and RageFileManager. */
class RageFile: public RageFileBasic class RageFile: public RageFileBasic
{ {
public: public:
@@ -84,9 +81,6 @@ private:
RString m_Path; RString m_Path;
RString m_sError; RString m_sError;
int m_Mode; int m_Mode;
// Swallow up warnings. If they must be used, define them.
RageFile& operator=(const RageFile& rhs);
}; };
/** @brief Convenience wrappers for reading binary files. */ /** @brief Convenience wrappers for reading binary files. */
-3
View File
@@ -152,9 +152,6 @@ private:
* file, and no seeking is performed. */ * file, and no seeking is performed. */
bool m_bCRC32Enabled; bool m_bCRC32Enabled;
uint32_t m_iCRC32; uint32_t m_iCRC32;
// Swallow up warnings. If they must be used, define them.
RageFileObj& operator=(const RageFileObj& rhs);
}; };
#endif #endif
+3 -3
View File
@@ -245,14 +245,14 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes )
if( m_pDeflate->avail_out < sizeof(buf) ) if( m_pDeflate->avail_out < sizeof(buf) )
{ {
int lBytes = sizeof(buf)-m_pDeflate->avail_out; int iBytes = sizeof(buf)-m_pDeflate->avail_out;
int iRet = m_pFile->Write( buf, lBytes ); int iRet = m_pFile->Write( buf, iBytes );
if( iRet == -1 ) if( iRet == -1 )
{ {
SetError( m_pFile->GetError() ); SetError( m_pFile->GetError() );
return -1; return -1;
} }
if( iRet < lBytes ) if( iRet < iBytes )
{ {
SetError( "Partial write" ); SetError( "Partial write" );
return -1; return -1;
+2 -2
View File
@@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector<RString> &Add
for( unsigned j = OldStart; j < AddTo.size(); ++j ) for( unsigned j = OldStart; j < AddTo.size(); ++j )
{ {
/* Skip the trailing slash on the mountpoint; there's already a slash there. */ /* Skip the trailing slash on the mountpoint; there's already a slash there. */
RString &lPath = AddTo[j]; RString &sPath = AddTo[j];
lPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); sPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 );
} }
} }
} }
+13 -10
View File
@@ -60,8 +60,11 @@ inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; }
struct InputDeviceInfo struct InputDeviceInfo
{ {
InputDeviceInfo( InputDevice id_, RString sDesc_ ): InputDeviceInfo( InputDevice id_, RString sDesc_ )
id(id_), sDesc(sDesc_) {} {
id = id_;
sDesc = sDesc_;
}
InputDevice id; InputDevice id;
RString sDesc; RString sDesc;
@@ -314,22 +317,22 @@ public:
* (0..1). This should be 0 for analog axes within the dead zone. */ * (0..1). This should be 0 for analog axes within the dead zone. */
float level; float level;
// Mouse coordinates
unsigned x;
unsigned y;
/* Whether this button is pressed. This is level with a threshold and /* Whether this button is pressed. This is level with a threshold and
* debouncing applied. */ * debouncing applied. */
bool bDown; bool bDown;
// Mouse coordinates
unsigned x;
unsigned y;
RageTimer ts; RageTimer ts;
DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { } DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { }
DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), x(0), y(0), bDown(l > 0.5f), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5f), ts(RageZeroTimer) { }
DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ):
device(d), button(b), level(l), x(0), y(0), bDown(level > 0.5f), ts(t) { } device(d), button(b), level(l), bDown(level > 0.5f), ts(t) { }
DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ): DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ):
device(d), button(b), level(0), x(xPos), y(yPos), bDown(false), ts(t) { } device(d), button(b), x(xPos), y(yPos), bDown(false), ts(t) { }
bool operator==( const DeviceInput &other ) const bool operator==( const DeviceInput &other ) const
{ {
+7 -2
View File
@@ -78,14 +78,19 @@ enum
WRITE_LOUD = 0x04 WRITE_LOUD = 0x04
}; };
RageLog::RageLog(): m_bLogToDisk(false), m_bInfoToDisk(false), RageLog::RageLog()
m_bUserLogToDisk(false), m_bFlush(false), m_bShowLogOutput(false)
{ {
g_fileLog = new RageFile; g_fileLog = new RageFile;
g_fileInfo = new RageFile; g_fileInfo = new RageFile;
g_fileUserLog = new RageFile; g_fileUserLog = new RageFile;
g_Mutex = new RageMutex( "Log" ); g_Mutex = new RageMutex( "Log" );
m_bLogToDisk = false;
m_bInfoToDisk = false;
m_bUserLogToDisk = false;
m_bFlush = false;
m_bShowLogOutput = false;
} }
RageLog::~RageLog() RageLog::~RageLog()
+2 -2
View File
@@ -575,8 +575,8 @@ float RageFastSin( float x )
bInited = true; bInited = true;
for( unsigned i=0; i<ARRAYLEN(table); i++ ) for( unsigned i=0; i<ARRAYLEN(table); i++ )
{ {
float z = SCALE(i,0,ARRAYLEN(table),0.0f,PI); float x = SCALE(i,0,ARRAYLEN(table),0.0f,PI);
table[i] = sinf(z); table[i] = sinf(x);
} }
} }
+25 -9
View File
@@ -39,20 +39,36 @@
#define samplerate() m_pSource->GetSampleRate() #define samplerate() m_pSource->GetSampleRate()
RageSoundParams::RageSoundParams(): RageSoundParams::RageSoundParams():
m_StartSecond(0), m_LengthSeconds(-1), m_fFadeInSeconds(0), m_StartTime( RageZeroTimer )
m_fFadeOutSeconds(0), m_Volume(1.0f), m_fAttractVolume(1.0f), {
m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), m_StartSecond = 0;
StopMode(M_AUTO), m_bIsCriticalSound(false) {} m_LengthSeconds = -1;
m_fFadeInSeconds = 0;
m_fFadeOutSeconds = 0;
m_Volume = 1.0f;
m_fAttractVolume = 1.0f;
m_fPitch = 1.0f;
m_fSpeed = 1.0f;
StopMode = M_AUTO;
m_bIsCriticalSound = false;
}
RageSoundLoadParams::RageSoundLoadParams(): RageSoundLoadParams::RageSoundLoadParams()
m_bSupportRateChanging(false), m_bSupportPan(false) {} {
m_bSupportRateChanging = false;
m_bSupportPan = false;
}
RageSound::RageSound(): RageSound::RageSound():
m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), m_Mutex( "RageSound" )
m_iStoppedSourceFrame(0), m_bPlaying(false),
m_bDeleteWhenFinished(false)
{ {
ASSERT( SOUNDMAN ); ASSERT( SOUNDMAN );
m_pSource = NULL;
m_iStreamFrame = 0;
m_iStoppedSourceFrame = 0;
m_bPlaying = false;
m_bDeleteWhenFinished = false;
} }
RageSound::~RageSound() RageSound::~RageSound()
+11 -10
View File
@@ -22,10 +22,7 @@ public:
virtual RString GetLoadedFilePath() const = 0; virtual RString GetLoadedFilePath() const = 0;
}; };
/** /* These are parameters to play a sound. These are normally changed before playing begins,
* @brief The parameters to play a sound.
*
* These are normally changed before playing begins,
* and are constant from then on. */ * and are constant from then on. */
struct RageSoundParams struct RageSoundParams
{ {
@@ -53,13 +50,17 @@ struct RageSoundParams
* If zero, or if not supported, the sound will start immediately. */ * If zero, or if not supported, the sound will start immediately. */
RageTimer m_StartTime; RageTimer m_StartTime;
/** @brief How does the sound stop itself, if it does? */ /* M_STOP stops the sound at the end.
* M_LOOP restarts.
* M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound.
* M_AUTO (default) stops, obeying filename hints.
*/
enum StopMode_t { enum StopMode_t {
M_STOP, /**< The sound is stopped at the end. */ M_STOP,
M_LOOP, /**< The sound restarts itself. */ M_LOOP,
M_CONTINUE, /**< Silence is fed at the end to continue timing longer than the sound. */ M_CONTINUE,
M_AUTO /**< The default, the sound stops while obeying filename hints. */ M_AUTO
} /** @brief How does the sound stop itself, if it does? */ StopMode; } StopMode;
bool m_bIsCriticalSound; // "is a sound that should be played even during attract" bool m_bIsCriticalSound; // "is a sound that should be played even during attract"
}; };
+5 -2
View File
@@ -35,8 +35,11 @@ static Preference<RString> g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAU
RageSoundManager *SOUNDMAN = NULL; RageSoundManager *SOUNDMAN = NULL;
RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f), RageSoundManager::RageSoundManager()
m_fVolumeOfNonCriticalSounds(1.0f) {} {
m_fMixVolume = 1.0f;
m_fVolumeOfNonCriticalSounds = 1.0f;
}
static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" );
void RageSoundManager::Init() void RageSoundManager::Init()
-3
View File
@@ -53,9 +53,6 @@ private:
/* Prefs: */ /* Prefs: */
float m_fMixVolume; float m_fMixVolume;
float m_fVolumeOfNonCriticalSounds; float m_fVolumeOfNonCriticalSounds;
// Swallow up warnings. If they must be used, define them.
RageSoundManager& operator=(const RageSoundManager& rhs);
RageSoundManager(const RageSoundManager& rhs);
}; };
extern RageSoundManager *SOUNDMAN; extern RageSoundManager *SOUNDMAN;
+3
View File
@@ -33,6 +33,7 @@ RageSoundReader_Chain::~RageSoundReader_Chain()
while( !m_apActiveSounds.empty() ) while( !m_apActiveSounds.empty() )
ReleaseSound( m_apActiveSounds.front() ); ReleaseSound( m_apActiveSounds.front() );
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_apLoadedSounds, it ) FOREACH( RageSoundReader *, m_apLoadedSounds, it )
delete *it; delete *it;
} }
@@ -102,6 +103,7 @@ int RageSoundReader_Chain::GetSampleRateInternal() const
if( m_apLoadedSounds.empty() ) if( m_apLoadedSounds.empty() )
return m_iPreferredSampleRate; return m_iPreferredSampleRate;
map<RString, RageSoundReader *>::const_iterator it;
int iRate = -1; int iRate = -1;
FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it ) FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it )
{ {
@@ -118,6 +120,7 @@ void RageSoundReader_Chain::Finish()
/* Figure out how many channels we have. All sounds must either have 1 or 2 channels, /* Figure out how many channels we have. All sounds must either have 1 or 2 channels,
* which will be converted as needed, or have the same number of channels. */ * which will be converted as needed, or have the same number of channels. */
m_iChannels = 1; m_iChannels = 1;
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_apLoadedSounds, it ) FOREACH( RageSoundReader *, m_apLoadedSounds, it )
m_iChannels = max( m_iChannels, (*it)->GetNumChannels() ); m_iChannels = max( m_iChannels, (*it)->GetNumChannels() );
+1 -1
View File
@@ -426,7 +426,7 @@ int RageSoundReader_MP3::do_mad_frame_decode( bool headers_only )
return -1; return -1;
} }
ret = fill_buffer(); int ret = fill_buffer();
if( ret <= 0 ) if( ret <= 0 )
return ret; return ret;
bytes_read += ret; bytes_read += ret;
+1
View File
@@ -18,6 +18,7 @@ RageSoundReader_Merge::RageSoundReader_Merge()
RageSoundReader_Merge::~RageSoundReader_Merge() RageSoundReader_Merge::~RageSoundReader_Merge()
{ {
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_aSounds, it ) FOREACH( RageSoundReader *, m_aSounds, it )
delete *it; delete *it;
} }
-2
View File
@@ -29,8 +29,6 @@ private:
float m_fPitchRatio; float m_fPitchRatio;
float m_fLastSetSpeedRatio; float m_fLastSetSpeedRatio;
float m_fLastSetPitchRatio; float m_fLastSetPitchRatio;
// Swallow up warnings. If they must be used, define them.
RageSoundReader_PitchChange& operator=(const RageSoundReader_PitchChange& rhs);
}; };
#endif #endif
+1 -2
View File
@@ -34,8 +34,7 @@ bool RageSoundReader_Preload::PreloadSound( RageSoundReader *&pSound )
} }
RageSoundReader_Preload::RageSoundReader_Preload(): RageSoundReader_Preload::RageSoundReader_Preload():
m_Buffer( new RString ), m_bBufferIs16Bit(false), m_Buffer( new RString )
m_iPosition(0), m_iSampleRate(0), m_iChannels(0), m_fRate(0.0f)
{ {
m_bBufferIs16Bit = g_bSoundPreload16bit.Get(); m_bBufferIs16Bit = g_bSoundPreload16bit.Get();
} }
+1 -2
View File
@@ -53,8 +53,7 @@ private:
int iFramesBuffered; int iFramesBuffered;
int iPositionOfFirstFrame; int iPositionOfFirstFrame;
float fRate; float fRate;
Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), Mapping() { iFramesBuffered = iPositionOfFirstFrame = 0; fRate = 1.0f; }
fRate(1.0f) {}
}; };
list<Mapping> m_StreamPosition; list<Mapping> m_StreamPosition;
+1 -1
View File
@@ -7,7 +7,7 @@
struct RageSurfaceColor struct RageSurfaceColor
{ {
uint8_t r, g, b, a; uint8_t r, g, b, a;
RageSurfaceColor(): r(0), g(0), b(0), a(0) { } RageSurfaceColor() { }
RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ): RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ):
r(r_), g(g_), b(b_), a(a_) { } r(r_), g(g_), b(b_), a(a_) { }
+2 -2
View File
@@ -585,8 +585,8 @@ static bool blit_rgba_to_rgba( const RageSurface *src_surf, const RageSurface *d
unsigned int opixel = 0; unsigned int opixel = 0;
for( int c = 0; c < 4; ++c ) for( int c = 0; c < 4; ++c )
{ {
int lSrc = (pixel & src_masks[c]) >> src_shifts[c]; int src = (pixel & src_masks[c]) >> src_shifts[c];
opixel |= lookup[c][lSrc] << dst_shifts[c]; opixel |= lookup[c][src] << dst_shifts[c];
} }
// Store it. // Store it.
+6 -6
View File
@@ -454,7 +454,7 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i
#ifdef REP_AVERAGE_PIXELS #ifdef REP_AVERAGE_PIXELS
int indx = bv[bi].ind; int indx = bv[bi].ind;
int clrs = bv[bi].colors; int clrs = bv[bi].colors;
long r = 0, g = 0, b = 0, a = 0, lSum = 0; long r = 0, g = 0, b = 0, a = 0, sum = 0;
for ( int i = 0; i < clrs; ++i ) for ( int i = 0; i < clrs; ++i )
{ {
@@ -462,15 +462,15 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i
g += PAM_GETG( achv[indx + i].acolor ) * achv[indx + i].value; g += PAM_GETG( achv[indx + i].acolor ) * achv[indx + i].value;
b += PAM_GETB( achv[indx + i].acolor ) * achv[indx + i].value; b += PAM_GETB( achv[indx + i].acolor ) * achv[indx + i].value;
a += PAM_GETA( achv[indx + i].acolor ) * achv[indx + i].value; a += PAM_GETA( achv[indx + i].acolor ) * achv[indx + i].value;
lSum += achv[indx + i].value; sum += achv[indx + i].value;
} }
r = r / lSum; r = r / sum;
r = min( r, (long) maxval ); r = min( r, (long) maxval );
g = g / lSum; g = g / sum;
g = min( g, (long) maxval ); g = min( g, (long) maxval );
b = b / lSum; b = b / sum;
b = min( b, (long) maxval ); b = min( b, (long) maxval );
a = a / lSum; a = a / sum;
a = min( a, (long) maxval ); a = min( a, (long) maxval );
PAM_ASSIGN( acolormap[bi].acolor, (uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)a ); PAM_ASSIGN( acolormap[bi].acolor, (uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)a );
#endif // REP_AVERAGE_PIXELS #endif // REP_AVERAGE_PIXELS
+10 -5
View File
@@ -7,11 +7,16 @@
RageTexture::RageTexture( RageTextureID name ): RageTexture::RageTexture( RageTextureID name ):
m_ID(name), m_iRefCount(1), m_bWasUsed(false), m_ID(name)
m_iSourceWidth(0), m_iSourceHeight(0), {
m_iTextureWidth(0), m_iTextureHeight(0), m_iRefCount = 1;
m_iImageWidth(0), m_iImageHeight(0), m_bWasUsed = false;
m_iFramesWide(1), m_iFramesHigh(1) {}
m_iSourceWidth = m_iSourceHeight = 0;
m_iTextureWidth = m_iTextureHeight = 0;
m_iImageWidth = m_iImageHeight = 0;
m_iFramesWide = m_iFramesHigh = 1;
}
RageTexture::~RageTexture() RageTexture::~RageTexture()
+2 -9
View File
@@ -59,15 +59,8 @@ struct RageTextureID
void Init(); void Init();
RageTextureID(): filename(RString()), iMaxSize(0), bMipMaps(false), RageTextureID() { Init(); }
iAlphaBits(0), iGrayscaleBits(0), iColorDepth(0), RageTextureID( const RString &fn ) { Init(); SetFilename(fn); }
bDither(false), bStretch(false), bHotPinkColorKey(false),
AdditionalTextureHints(RString()), Policy(TEX_DEFAULT) { Init(); }
RageTextureID( const RString &fn ): filename(RString()), iMaxSize(0),
bMipMaps(false), iAlphaBits(0), iGrayscaleBits(0),
iColorDepth(0), bDither(false), bStretch(false),
bHotPinkColorKey(false), AdditionalTextureHints(RString()),
Policy(TEX_DEFAULT) { Init(); SetFilename(fn); }
void SetFilename( const RString &fn ); void SetFilename( const RString &fn );
}; };
+7 -4
View File
@@ -36,9 +36,11 @@ namespace
map<RageTextureID, RageTexture*> m_mapPathToTexture; map<RageTextureID, RageTexture*> m_mapPathToTexture;
}; };
RageTextureManager::RageTextureManager(): RageTextureManager::RageTextureManager()
m_iNoWarnAboutOddDimensions(0), {
m_TexturePolicy(RageTextureID::TEX_DEFAULT) {} m_iNoWarnAboutOddDimensions = 0;
m_TexturePolicy = RageTextureID::TEX_DEFAULT;
}
RageTextureManager::~RageTextureManager() RageTextureManager::~RageTextureManager()
{ {
@@ -104,8 +106,9 @@ class RageTexture_Default: public RageTexture
{ {
public: public:
RageTexture_Default(): RageTexture_Default():
RageTexture( RageTextureID() ), m_uTexHandle(0) RageTexture( RageTextureID() )
{ {
m_uTexHandle = 0;
m_iSourceWidth = m_iSourceHeight = 1; m_iSourceWidth = m_iSourceHeight = 1;
m_iTextureWidth = m_iTextureHeight = 1; m_iTextureWidth = m_iTextureHeight = 1;
m_iImageWidth = m_iImageHeight = 1; m_iImageWidth = m_iImageHeight = 1;
+18 -11
View File
@@ -14,23 +14,30 @@ struct RageTextureManagerPrefs
bool m_bHighResolutionTextures; bool m_bHighResolutionTextures;
bool m_bMipMaps; bool m_bMipMaps;
RageTextureManagerPrefs(): m_iTextureColorDepth(16), RageTextureManagerPrefs()
m_iMovieColorDepth(16), m_bDelayedDelete(false), {
m_iMaxTextureResolution(1024), m_bDelayedDelete = false;
m_bHighResolutionTextures(true), m_bMipMaps(false) {} m_iMovieColorDepth = 16;
m_iTextureColorDepth = 16;
m_iMaxTextureResolution = 1024;
m_bHighResolutionTextures = true;
m_bMipMaps = false;
}
RageTextureManagerPrefs( RageTextureManagerPrefs(
int iTextureColorDepth, int iTextureColorDepth,
int iMovieColorDepth, int iMovieColorDepth,
bool bDelayedDelete, bool bDelayedDelete,
int iMaxTextureResolution, int iMaxTextureResolution,
bool bHighResolutionTextures, bool bHighResolutionTextures,
bool bMipMaps ): bool bMipMaps )
m_iTextureColorDepth(iTextureColorDepth), {
m_iMovieColorDepth(iMovieColorDepth), m_bDelayedDelete = bDelayedDelete;
m_bDelayedDelete(bDelayedDelete), m_iMovieColorDepth = iMovieColorDepth;
m_iMaxTextureResolution(iMaxTextureResolution), m_iTextureColorDepth = iTextureColorDepth;
m_bHighResolutionTextures(bHighResolutionTextures), m_iMaxTextureResolution = iMaxTextureResolution;
m_bMipMaps(bMipMaps) {} m_bHighResolutionTextures = bHighResolutionTextures;
m_bMipMaps = bMipMaps;
}
bool operator!=( const RageTextureManagerPrefs& rhs ) const bool operator!=( const RageTextureManagerPrefs& rhs ) const
{ {
+25 -11
View File
@@ -65,8 +65,7 @@ struct ThreadSlot
int m_iCurCheckpoint, m_iNumCheckpoints; int m_iCurCheckpoint, m_iNumCheckpoints;
const char *GetFormattedCheckpoint( int lineno ); const char *GetFormattedCheckpoint( int lineno );
ThreadSlot(): m_bUsed(false), m_iID(GetInvalidThreadId()), ThreadSlot() { Init(); }
m_pImpl(NULL), m_iCurCheckpoint(0), m_iNumCheckpoints(0) {}
void Init() void Init()
{ {
m_iID = GetInvalidThreadId(); m_iID = GetInvalidThreadId();
@@ -207,11 +206,18 @@ static ThreadSlot *GetUnknownThreadSlot()
return g_pUnknownThreadSlot; return g_pUnknownThreadSlot;
} }
RageThread::RageThread(): m_pSlot(NULL), m_sName("unnamed") {} RageThread::RageThread()
{
m_pSlot = NULL;
m_sName = "unnamed";
}
RageThread::RageThread( const RageThread &cpy )
{
/* Copying a thread does not start the copy. */ /* Copying a thread does not start the copy. */
RageThread::RageThread( const RageThread &cpy ): m_pSlot = NULL;
m_pSlot(NULL), m_sName(cpy.m_sName) {} m_sName = cpy.m_sName;
}
RageThread::~RageThread() RageThread::~RageThread()
{ {
@@ -514,9 +520,12 @@ static set<int> *g_FreeMutexIDs = NULL;
#endif #endif
RageMutex::RageMutex( const RString &name ): RageMutex::RageMutex( const RString &name ):
m_sName( name ), m_pMutex( MakeMutex (this ) ), m_sName( name )
m_LockedBy(GetInvalidThreadId()), m_LockCnt(0)
{ {
m_pMutex = MakeMutex( this );
m_LockedBy = GetInvalidThreadId();
m_LockCnt = 0;
/* if( g_FreeMutexIDs == NULL ) /* if( g_FreeMutexIDs == NULL )
{ {
@@ -650,8 +659,7 @@ LockMutex::LockMutex( RageMutex &pMutex, const char *file_, int line_ ):
mutex( pMutex ), mutex( pMutex ),
file( file_ ), file( file_ ),
line( line_ ), line( line_ ),
locked_at( RageTimer::GetTimeSinceStart() ), locked_at( RageTimer::GetTimeSinceStart() )
locked(false) // ensure it gets locked inside.
{ {
mutex.Lock(); mutex.Lock();
locked = true; locked = true;
@@ -679,7 +687,10 @@ void LockMutex::Unlock()
} }
RageEvent::RageEvent( RString name ): RageEvent::RageEvent( RString name ):
RageMutex( name ), m_pEvent(MakeEvent(m_pMutex)) {} RageMutex( name )
{
m_pEvent = MakeEvent( m_pMutex );
}
RageEvent::~RageEvent() RageEvent::~RageEvent()
{ {
@@ -721,7 +732,10 @@ bool RageEvent::WaitTimeoutSupported() const
} }
RageSemaphore::RageSemaphore( RString sName, int iInitialValue ): RageSemaphore::RageSemaphore( RString sName, int iInitialValue ):
m_sName( sName ), m_pSema(MakeSemaphore( iInitialValue )) {} m_sName( sName )
{
m_pSema = MakeSemaphore( iInitialValue );
}
RageSemaphore::~RageSemaphore() RageSemaphore::~RageSemaphore()
{ {
-20
View File
@@ -46,9 +46,6 @@ private:
static bool s_bSystemSupportsTLS; static bool s_bSystemSupportsTLS;
static bool s_bIsShowingDialog; static bool s_bIsShowingDialog;
// Swallow up warnings. If they must be used, define them.
RageThread& operator=(const RageThread& rhs);
}; };
/** /**
@@ -64,9 +61,6 @@ public:
private: private:
ThreadSlot *m_pSlot; ThreadSlot *m_pSlot;
// Swallow up warnings. If they must be used, define them.
RageThreadRegister& operator=(const RageThreadRegister& rhs);
RageThreadRegister(const RageThreadRegister& rhs);
}; };
namespace Checkpoints namespace Checkpoints
@@ -108,10 +102,6 @@ protected:
int m_LockCnt; int m_LockCnt;
void MarkLockedMutex(); void MarkLockedMutex();
private:
// Swallow up warnings. If they must be used, define them.
RageMutex& operator=(const RageMutex& rhs);
RageMutex(const RageMutex& rhs);
}; };
/** /**
@@ -138,9 +128,6 @@ public:
* *
* This can only be called once. */ * This can only be called once. */
void Unlock(); void Unlock();
private:
// Swallow up warnings. If they must be used, define them.
LockMutex& operator=(const LockMutex& rhs);
}; };
#define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) #define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__)
@@ -162,9 +149,6 @@ public:
void Signal(); void Signal();
void Broadcast(); void Broadcast();
bool WaitTimeoutSupported() const; bool WaitTimeoutSupported() const;
// Swallow up warnings. If they must be used, define them.
RageEvent& operator=(const RageEvent& rhs);
RageEvent(const RageEvent& rhs);
private: private:
EventImpl *m_pEvent; EventImpl *m_pEvent;
@@ -186,10 +170,6 @@ public:
private: private:
SemaImpl *m_pSema; SemaImpl *m_pSema;
RString m_sName; RString m_sName;
// Swallow up warnings. If they must be used, define them.
RageSemaphore& operator=(const RageSemaphore& rhs);
RageSemaphore(const RageSemaphore& rhs);
}; };
#endif #endif
+1 -1
View File
@@ -6,7 +6,7 @@
class RageTimer class RageTimer
{ {
public: public:
RageTimer(): m_secs(0), m_us(0) { Touch(); } RageTimer() { Touch(); }
RageTimer( int secs, int us ): m_secs(secs), m_us(us) { } RageTimer( int secs, int us ): m_secs(secs), m_us(us) { }
/* Time ago this RageTimer represents. */ /* Time ago this RageTimer represents. */
+15 -16
View File
@@ -100,9 +100,9 @@ struct lua_State;
struct RageVector2 struct RageVector2
{ {
public: public:
RageVector2(): x(0), y(0) {} RageVector2() {}
RageVector2( const float * f ): x(f[0]), y(f[1]) {} RageVector2( const float * f ) { x=f[0]; y=f[1]; }
RageVector2( float x1, float y1 ): x(x1), y(y1) {} RageVector2( float x1, float y1 ) { x=x1; y=y1; }
// casting // casting
operator float* () { return &x; }; operator float* () { return &x; };
@@ -129,9 +129,9 @@ public:
struct RageVector3 struct RageVector3
{ {
public: public:
RageVector3(): x(0), y(0), z(0) {} RageVector3() {}
RageVector3( const float * f ): x(f[0]), y(f[1]), z(f[2]) {} RageVector3( const float * f ) { x=f[0]; y=f[1]; z=f[2]; }
RageVector3( float x1, float y1, float z1 ): x(x1), y(y1), z(z1) {} RageVector3( float x1, float y1, float z1 ) { x=x1; y=y1; z=z1; }
// casting // casting
operator float* () { return &x; }; operator float* () { return &x; };
@@ -158,9 +158,9 @@ public:
struct RageVector4 struct RageVector4
{ {
public: public:
RageVector4(): x(0), y(0), z(0), w(0) {} RageVector4() {}
RageVector4( const float * f ): x(f[0]), y(f[1]), z(f[2]), w(f[3]) {} RageVector4( const float * f ) { x=f[0]; y=f[1]; z=f[2]; w=f[3]; }
RageVector4( float x1, float y1, float z1, float w1 ): x(x1), y(y1), z(z1), w(w1) {} RageVector4( float x1, float y1, float z1, float w1 ) { x=x1; y=y1; z=z1; w=w1; }
// casting // casting
operator float* () { return &x; }; operator float* () { return &x; };
@@ -187,8 +187,8 @@ struct RageColor
{ {
public: public:
RageColor() : r(0), g(0), b(0), a(0) {} RageColor() : r(0), g(0), b(0), a(0) {}
explicit RageColor( const float * f ): r(f[0]), g(f[1]), b(f[2]), a(f[3]) {} explicit RageColor( const float * f ) { r=f[0]; g=f[1]; b=f[2]; a=f[3]; }
RageColor( float r1, float g1, float b1, float a1 ): r(r1), g(g1), b(b1), a(a1) {} RageColor( float r1, float g1, float b1, float a1 ) { r=r1; g=g1; b=b1; a=a1; }
// casting // casting
operator float* () { return &r; }; operator float* () { return &r; };
@@ -290,8 +290,8 @@ class RageVColor
public: public:
uint8_t b,g,r,a; // specific ordering required by Direct3D uint8_t b,g,r,a; // specific ordering required by Direct3D
RageVColor(): b(0), g(0), r(0), a(0) { } RageVColor() { }
RageVColor(const RageColor &rc): b(0), g(0), r(0), a(0) { *this = rc; } RageVColor(const RageColor &rc) { *this = rc; }
RageVColor &operator= (const RageColor &rc) RageVColor &operator= (const RageColor &rc)
{ {
r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a); r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a);
@@ -305,8 +305,8 @@ namespace StepMania
class Rect class Rect
{ {
public: public:
Rect(): left(0), top(0), right(0), bottom(0) {} Rect() {};
Rect(T l, T t, T r, T b): left(l), top(t), right(r), bottom(b) {} Rect(T l, T t, T r, T b) { left = l, top = t, right = r, bottom = b; };
T GetWidth() const { return right-left; }; T GetWidth() const { return right-left; };
T GetHeight() const { return bottom-top; }; T GetHeight() const { return bottom-top; };
@@ -349,7 +349,6 @@ struct RageModelVertex // doesn't have color. Relies on material color
p(0,0,0), p(0,0,0),
n(0,0,0), n(0,0,0),
t(0,0), t(0,0),
bone(0),
TextureMatrixScale(1,1) TextureMatrixScale(1,1)
{ } { }
RageVector3 p; // position RageVector3 p; // position
+5 -3
View File
@@ -17,7 +17,7 @@
RandomGen g_RandomNumberGenerator; RandomGen g_RandomNumberGenerator;
MersenneTwister::MersenneTwister( int iSeed ) : m_iNext(0) MersenneTwister::MersenneTwister( int iSeed )
{ {
Reset( iSeed ); Reset( iSeed );
} }
@@ -1315,13 +1315,15 @@ void Regex::Release()
m_sPattern = RString(); m_sPattern = RString();
} }
Regex::Regex( const RString &sStr ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString()) Regex::Regex( const RString &sStr )
{ {
m_pReg = NULL;
Set( sStr ); Set( sStr );
} }
Regex::Regex( const Regex &rhs ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString()) Regex::Regex( const Regex &rhs )
{ {
m_pReg = NULL;
Set( rhs.m_sPattern ); Set( rhs.m_sPattern );
} }
+18 -8
View File
@@ -27,17 +27,22 @@ class AutoPtrCopyOnWrite
{ {
public: public:
/* This constructor only exists to make us work with STL containers. */ /* This constructor only exists to make us work with STL containers. */
inline AutoPtrCopyOnWrite(): m_pPtr(NULL), m_iRefCount(new int(1)) inline AutoPtrCopyOnWrite()
{ {
m_pPtr = NULL;
m_iRefCount = new int(1);
} }
explicit inline AutoPtrCopyOnWrite( T *p ): m_pPtr(p), m_iRefCount(new int(1)) explicit inline AutoPtrCopyOnWrite( T *p )
{ {
m_pPtr = p;
m_iRefCount = new int(1);
} }
inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ): inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs )
m_pPtr(rhs.m_pPtr), m_iRefCount(rhs.m_iRefCount)
{ {
m_pPtr = rhs.m_pPtr;
m_iRefCount = rhs.m_iRefCount;
++(*m_iRefCount); ++(*m_iRefCount);
} }
@@ -127,11 +132,16 @@ public:
T& operator*() { return *m_pPtr; } T& operator*() { return *m_pPtr; }
T* operator->() { return m_pPtr; } T* operator->() { return m_pPtr; }
explicit HiddenPtr( T *p = NULL ): m_pPtr(p) {} explicit HiddenPtr( T *p = NULL )
HiddenPtr( const HiddenPtr<T> &cpy ): m_pPtr(NULL)
{ {
if( cpy.m_pPtr != NULL ) m_pPtr = p;
}
HiddenPtr( const HiddenPtr<T> &cpy )
{
if( cpy.m_pPtr == NULL )
m_pPtr = NULL;
else
m_pPtr = HiddenPtrTraits<T>::Copy( cpy.m_pPtr ); m_pPtr = HiddenPtrTraits<T>::Copy( cpy.m_pPtr );
} }
+2 -1
View File
@@ -112,8 +112,9 @@ class CachedObjectPointer
public: public:
typedef CachedObject<T> Object; typedef CachedObject<T> Object;
CachedObjectPointer() : m_pCache(NULL), m_bCacheIsSet(false) CachedObjectPointer()
{ {
m_bCacheIsSet = false;
Object::Register( this ); Object::Register( this );
} }
+1 -1
View File
@@ -488,7 +488,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
p += m_CustomComboBonusValue; p += m_CustomComboBonusValue;
} }
p += static_cast<int>(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier); p += m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier;
if( m_iNumNotesHitThisRow == 2 ) if( m_iNumNotesHitThisRow == 2 )
p = (int)(p * m_DoubleNoteMultiplier); p = (int)(p * m_DoubleNoteMultiplier);
+1 -1
View File
@@ -165,7 +165,7 @@ void ScreenBookkeeping::UpdateView()
if( iSongIndex < (int)vpSongs.size() ) if( iSongIndex < (int)vpSongs.size() )
{ {
Song *pSong = vpSongs[iSongIndex]; Song *pSong = vpSongs[iSongIndex];
iCount = pProfile->GetSongNumTimesPlayed( pSong ); int iCount = pProfile->GetSongNumTimesPlayed( pSong );
RString sTitle = ssprintf("%4d",iCount) + " " + pSong->GetDisplayFullTitle(); RString sTitle = ssprintf("%4d",iCount) + " " + pSong->GetDisplayFullTitle();
if( sTitle.length() > 22 ) if( sTitle.length() > 22 )
sTitle = sTitle.Left(20) + "..."; sTitle = sTitle.Left(20) + "...";
+19 -19
View File
@@ -273,30 +273,30 @@ void ScreenDebugOverlay::Init()
FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p )
{ {
{ {
BitmapText *bt = new BitmapText; BitmapText *p = new BitmapText;
bt->SetName( "ButtonText" ); p->SetName( "ButtonText" );
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
bt->SetHorizAlign( align_right ); p->SetHorizAlign( align_right );
bt->SetText( "blah" ); p->SetText( "blah" );
//p->SetShadowLength( 2 ); //p->SetShadowLength( 2 );
LOAD_ALL_COMMANDS( *bt ); LOAD_ALL_COMMANDS( *p );
// xxx: I shouldn't have to do this: // xxx: I shouldn't have to do this:
ON_COMMAND( bt ); ON_COMMAND( p );
m_vptextButton.push_back( bt ); m_vptextButton.push_back( p );
this->AddChild( bt ); this->AddChild( p );
} }
{ {
BitmapText *bt = new BitmapText; BitmapText *p = new BitmapText;
bt->SetName( "FunctionText" ); p->SetName( "FunctionText" );
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
bt->SetHorizAlign( align_left ); p->SetHorizAlign( align_left );
bt->SetText( "blah" ); p->SetText( "blah" );
//p->SetShadowLength( 2 ); //p->SetShadowLength( 2 );
LOAD_ALL_COMMANDS( *bt ); LOAD_ALL_COMMANDS( *p );
// xxx: I shouldn't have to do this: // xxx: I shouldn't have to do this:
ON_COMMAND( bt ); ON_COMMAND( p );
m_vptextFunction.push_back( bt ); m_vptextFunction.push_back( p );
this->AddChild( bt ); this->AddChild( p );
} }
} }
@@ -498,7 +498,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
bt.FinishTweening(); bt.FinishTweening();
// blink 5 times instead of 8 // blink 5 times instead of 8
// TODO: make this all metrics instead -aj // TODO: make this all metrics instead -aj
for( i=0; i<5; i++ ) for( int i=0; i<5; i++ )
{ {
bt.SetGlow( RageColor(1,0,0,1) ); bt.SetGlow( RageColor(1,0,0,1) );
bt.Sleep(0.1f); bt.Sleep(0.1f);
+36 -41
View File
@@ -16,7 +16,6 @@
#include "LocalizedString.h" #include "LocalizedString.h"
#include "NoteDataUtil.h" #include "NoteDataUtil.h"
#include "NoteSkinManager.h" #include "NoteSkinManager.h"
#include "NoteTypes.h"
#include "NotesWriterSM.h" #include "NotesWriterSM.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "RageSoundManager.h" #include "RageSoundManager.h"
@@ -266,11 +265,10 @@ void ScreenEdit::InitEditMappings()
m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT);
// m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm);
m_EditMappingsDeviceInput.button [EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_UP); m_EditMappingsDeviceInput.button [EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_UP);
m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL);
@@ -329,8 +327,10 @@ void ScreenEdit::InitEditMappings()
m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC);
m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK; m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK;
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT);
m_RecordMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC);
@@ -731,8 +731,6 @@ void ScreenEdit::Init()
m_bReturnToRecordMenuAfterPlay = false; m_bReturnToRecordMenuAfterPlay = false;
m_fBeatToReturnTo = 0; m_fBeatToReturnTo = 0;
m_selectedTap = TAP_ORIGINAL_TAP;
GAMESTATE->m_bGameplayLeadIn.Set( true ); GAMESTATE->m_bGameplayLeadIn.Set( true );
GAMESTATE->m_EditMode = EDIT_MODE.GetValue(); GAMESTATE->m_EditMode = EDIT_MODE.GetValue();
GAMESTATE->m_fSongBeat = 0; GAMESTATE->m_fSongBeat = 0;
@@ -956,7 +954,7 @@ void ScreenEdit::Update( float fDeltaTime )
else if( fSecsHeld > RECORD_HOLD_SECONDS ) else if( fSecsHeld > RECORD_HOLD_SECONDS )
{ {
// create or extend a hold or roll note // create or extend a hold or roll note
TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD;
tn.pn = m_InputPlayerNumber; tn.pn = m_InputPlayerNumber;
m_NoteDataRecord.AddHoldNote( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), tn ); m_NoteDataRecord.AddHoldNote( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), tn );
@@ -1026,7 +1024,6 @@ static LocalizedString DESCRIPTION("ScreenEdit", "Description");
static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style"); static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style");
static LocalizedString MAIN_TITLE("ScreenEdit", "Main title"); static LocalizedString MAIN_TITLE("ScreenEdit", "Main title");
static LocalizedString SUBTITLE("ScreenEdit", "Subtitle"); static LocalizedString SUBTITLE("ScreenEdit", "Subtitle");
static LocalizedString TAP_NOTE_TYPE("ScreenEdit", "Tap Note");
static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps"); static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps");
static LocalizedString JUMPS("ScreenEdit", "Jumps"); static LocalizedString JUMPS("ScreenEdit", "Jumps");
static LocalizedString HANDS("ScreenEdit", "Hands"); static LocalizedString HANDS("ScreenEdit", "Hands");
@@ -1051,7 +1048,6 @@ static ThemeMetric<RString> DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat"
static ThemeMetric<RString> CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat"); static ThemeMetric<RString> CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat");
static ThemeMetric<RString> MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat"); static ThemeMetric<RString> MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat");
static ThemeMetric<RString> SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat"); static ThemeMetric<RString> SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat");
static ThemeMetric<RString> TAP_NOTE_TYPE_FORMAT("ScreenEdit", "TapNoteTypeFormat");
static ThemeMetric<RString> NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat"); static ThemeMetric<RString> NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat");
static ThemeMetric<RString> NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat"); static ThemeMetric<RString> NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat");
static ThemeMetric<RString> NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); static ThemeMetric<RString> NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat");
@@ -1120,7 +1116,6 @@ void ScreenEdit::UpdateTextInfo()
sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() );
if( m_pSong->m_sSubTitle.size() ) if( m_pSong->m_sSubTitle.size() )
sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() );
sText += ssprintf( TAP_NOTE_TYPE_FORMAT.GetValue(), TAP_NOTE_TYPE.GetValue().c_str(), TapNoteTypeToString( m_selectedTap.type ).c_str() );
break; break;
} }
sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() );
@@ -1301,48 +1296,43 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY ); m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY );
// Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. // Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes.
} }
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) )
{
m_soundAddNote.Play();
SetDirty( true );
SaveUndo();
TapNote tn = TAP_ORIGINAL_MINE;
tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo();
}
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) ) else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) )
{ {
g_iLastInsertTapAttackTrack = iCol; g_iLastInsertTapAttackTrack = iCol;
EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack ); EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack );
} }
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) )
{
m_soundAddNote.Play();
SetDirty( true );
SaveUndo();
TapNote tn = TAP_ORIGINAL_LIFT;
tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo();
}
else else
{ {
m_soundAddNote.Play(); m_soundAddNote.Play();
SetDirty( true ); SetDirty( true );
SaveUndo(); SaveUndo();
TapNote tn = m_selectedTap; TapNote tn = TAP_ORIGINAL_TAP;
tn.pn = m_InputPlayerNumber; tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn ); m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo(); CheckNumberOfNotesAndUndo();
} }
} }
break; break;
case EDIT_BUTTON_CYCLE_TAP_LEFT:
{
switch ( m_selectedTap.type )
{
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break;
DEFAULT_FAIL( m_selectedTap.type );
}
break;
}
case EDIT_BUTTON_CYCLE_TAP_RIGHT:
{
switch ( m_selectedTap.type )
{
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break;
DEFAULT_FAIL( m_selectedTap.type );
}
break;
}
case EDIT_BUTTON_SCROLL_SPEED_UP: case EDIT_BUTTON_SCROLL_SPEED_UP:
case EDIT_BUTTON_SCROLL_SPEED_DOWN: case EDIT_BUTTON_SCROLL_SPEED_DOWN:
{ {
@@ -2116,6 +2106,10 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY );
TapNote tn = TAP_ORIGINAL_TAP; TapNote tn = TAP_ORIGINAL_TAP;
if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) )
tn = TAP_ORIGINAL_MINE;
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) )
tn = TAP_ORIGINAL_LIFT;
tn.pn = m_InputPlayerNumber; tn.pn = m_InputPlayerNumber;
m_NoteDataRecord.SetTapNote( iCol, iRow, tn ); m_NoteDataRecord.SetTapNote( iCol, iRow, tn );
m_NoteFieldRecord.Step( iCol, TNS_W1 ); m_NoteFieldRecord.Step( iCol, TNS_W1 );
@@ -2508,7 +2502,7 @@ void ScreenEdit::ScrollTo( float fDestinationBeat )
// Don't SaveUndo. We want to undo the whole hold, not just the last segment // Don't SaveUndo. We want to undo the whole hold, not just the last segment
// that the user made. Dragging the hold bigger can only absorb and remove // that the user made. Dragging the hold bigger can only absorb and remove
// other taps, so dragging won't cause us to exceed the note limit. // other taps, so dragging won't cause us to exceed the note limit.
TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD;
tn.pn = m_InputPlayerNumber; tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.AddHoldNote( iCol, iStartRow, iEndRow, tn ); m_NoteDataEdit.AddHoldNote( iCol, iStartRow, iEndRow, tn );
@@ -4041,7 +4035,8 @@ static const EditHelpLine g_EditHelpLines[] =
EditHelpLine( "Shift BPM changes and stops down one beat", EDIT_BUTTON_INSERT_SHIFT_PAUSES ), EditHelpLine( "Shift BPM changes and stops down one beat", EDIT_BUTTON_INSERT_SHIFT_PAUSES ),
EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ), EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ),
EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ), EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ),
EditHelpLine( "Cycle between tap notes", EDIT_BUTTON_CYCLE_TAP_LEFT, EDIT_BUTTON_CYCLE_TAP_RIGHT ), EditHelpLine( "Lay mine", EDIT_BUTTON_LAY_MINE_OR_ROLL ),
EditHelpLine( "Lay lift", EDIT_BUTTON_LAY_LIFT ),
EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ), EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ),
EditHelpLine( "Switch player (Routine only)", EDIT_BUTTON_SWITCH_PLAYERS ), EditHelpLine( "Switch player (Routine only)", EDIT_BUTTON_SWITCH_PLAYERS ),
}; };
+2 -9
View File
@@ -9,7 +9,6 @@
#include "Background.h" #include "Background.h"
#include "Foreground.h" #include "Foreground.h"
#include "NoteField.h" #include "NoteField.h"
#include "NoteTypes.h"
#include "Song.h" #include "Song.h"
#include "Steps.h" #include "Steps.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
@@ -51,14 +50,11 @@ enum EditButton
// These are modifiers to EDIT_BUTTON_COLUMN_*. // These are modifiers to EDIT_BUTTON_COLUMN_*.
EDIT_BUTTON_RIGHT_SIDE, EDIT_BUTTON_RIGHT_SIDE,
EDIT_BUTTON_LAY_ROLL, EDIT_BUTTON_LAY_MINE_OR_ROLL,
EDIT_BUTTON_LAY_TAP_ATTACK, EDIT_BUTTON_LAY_TAP_ATTACK,
EDIT_BUTTON_LAY_LIFT,
EDIT_BUTTON_REMOVE_NOTE, EDIT_BUTTON_REMOVE_NOTE,
// These are modifiers to change the present tap note.
EDIT_BUTTON_CYCLE_TAP_LEFT,
EDIT_BUTTON_CYCLE_TAP_RIGHT,
EDIT_BUTTON_SCROLL_UP_LINE, EDIT_BUTTON_SCROLL_UP_LINE,
EDIT_BUTTON_SCROLL_UP_PAGE, EDIT_BUTTON_SCROLL_UP_PAGE,
EDIT_BUTTON_SCROLL_DOWN_LINE, EDIT_BUTTON_SCROLL_DOWN_LINE,
@@ -237,9 +233,6 @@ protected:
BitmapText m_textInputTips; BitmapText m_textInputTips;
/** @brief The current TapNote that would be inserted. */
TapNote m_selectedTap;
void UpdateTextInfo(); void UpdateTextInfo();
BitmapText m_textInfo; // status information that changes BitmapText m_textInfo; // status information that changes
bool m_bTextInfoNeedsUpdate; bool m_bTextInfoNeedsUpdate;
+7 -3
View File
@@ -797,12 +797,12 @@ void ScreenGameplay::InitSongQueues()
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{ {
Trail *lTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ]; Trail *pTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ];
ASSERT( lTrail ); ASSERT( pTrail );
pi->m_vpStepsQueue.clear(); pi->m_vpStepsQueue.clear();
pi->m_asModifiersQueue.clear(); pi->m_asModifiersQueue.clear();
FOREACH_CONST( TrailEntry, lTrail->m_vEntries, e ) FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
{ {
ASSERT( e->pSteps ); ASSERT( e->pSteps );
pi->m_vpStepsQueue.push_back( e->pSteps ); pi->m_vpStepsQueue.push_back( e->pSteps );
@@ -1270,6 +1270,8 @@ void ScreenGameplay::LoadLights()
{ {
if( asDifficulties[0].CompareNoCase("selected") == 0 ) if( asDifficulties[0].CompareNoCase("selected") == 0 )
{ {
PlayerInfo pi;
// Base lights off current difficulty of active player // Base lights off current difficulty of active player
// Can be either P1 or P2 if they're individual or P1 if both are active // Can be either P1 or P2 if they're individual or P1 if both are active
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
@@ -1303,6 +1305,8 @@ void ScreenGameplay::LoadLights()
// We've also specified for Player 2 to be based off current difficulty // We've also specified for Player 2 to be based off current difficulty
if( asDifficulties[1].CompareNoCase("selected") == 0 && GAMESTATE->GetNumPlayersEnabled() > 1 ) if( asDifficulties[1].CompareNoCase("selected") == 0 && GAMESTATE->GetNumPlayersEnabled() > 1 )
{ {
PlayerInfo pi;
// Base lights off current difficulty of active player // Base lights off current difficulty of active player
// Only do this for P2 in a two-player situation, since P1 is taken care of above // Only do this for P2 in a two-player situation, since P1 is taken care of above
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
+7 -7
View File
@@ -106,10 +106,10 @@ void ScreenJukebox::SetSong()
SONGMAN->GetAllCourses( apCourses, false ); SONGMAN->GetAllCourses( apCourses, false );
vector<const CourseEntry *> apOptions; vector<const CourseEntry *> apOptions;
vector<Course*> apPossibleCourses; vector<Course*> apPossibleCourses;
for( unsigned j = 0; j < apCourses.size(); ++j ) for( unsigned i = 0; i < apCourses.size(); ++i )
{ {
Course *lCourse = apCourses[j]; Course *pCourse = apCourses[i];
const CourseEntry *pEntry = lCourse->FindFixedSong( pSong ); const CourseEntry *pEntry = pCourse->FindFixedSong( pSong );
if( pEntry == NULL || pEntry->attacks.size() == 0 ) if( pEntry == NULL || pEntry->attacks.size() == 0 )
continue; continue;
@@ -144,14 +144,14 @@ void ScreenJukebox::SetSong()
{ {
int iIndex = RandomInt( apOptions.size() ); int iIndex = RandomInt( apOptions.size() );
m_pCourseEntry = apOptions[iIndex]; m_pCourseEntry = apOptions[iIndex];
Course *lCourse = apPossibleCourses[iIndex]; Course *pCourse = apPossibleCourses[iIndex];
PlayMode pm = CourseTypeToPlayMode( lCourse->GetCourseType() ); PlayMode pm = CourseTypeToPlayMode( pCourse->GetCourseType() );
GAMESTATE->m_PlayMode.Set( pm ); GAMESTATE->m_PlayMode.Set( pm );
GAMESTATE->m_pCurCourse.Set( lCourse ); GAMESTATE->m_pCurCourse.Set( pCourse );
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) ); GAMESTATE->m_pCurTrail[p].Set( pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) );
ASSERT( GAMESTATE->m_pCurTrail[p] ); ASSERT( GAMESTATE->m_pCurTrail[p] );
} }
} }
+5 -5
View File
@@ -236,15 +236,15 @@ void ColorBitmapText::SetText( const RString& _sText, const RString& _sAlternate
RString FirstThree = m_sText.substr( i, 3 ); RString FirstThree = m_sText.substr( i, 3 );
if( FirstThree.CompareNoCase("|c0") == 0 && iCharsLeft > 8 ) if( FirstThree.CompareNoCase("|c0") == 0 && iCharsLeft > 8 )
{ {
ColorChange cChange; ColorChange change;
unsigned int r, g, b; unsigned int r, g, b;
sscanf( m_sText.substr( i, 9 ).c_str(), "|%*c0%2x%2x%2x", &r, &g, &b ); sscanf( m_sText.substr( i, 9 ).c_str(), "|%*c0%2x%2x%2x", &r, &g, &b );
cChange.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f ); change.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f );
cChange.l = iGlyphsSoFar; change.l = iGlyphsSoFar;
if( iGlyphsSoFar == 0 ) if( iGlyphsSoFar == 0 )
m_vColors[0] = cChange; m_vColors[0] = change;
else else
m_vColors.push_back( cChange ); m_vColors.push_back( change );
i+=8; i+=8;
continue; continue;
} }
+4 -4
View File
@@ -261,7 +261,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
{ {
case EditCourseRow_Minutes: case EditCourseRow_Minutes:
row.SetOneSharedSelection( 0 ); row.SetOneSharedSelection( 0 );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(static_cast<int>(GAMESTATE->m_pCurCourse->m_fGoalSeconds)/60) ); row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) );
break; break;
default: default:
{ {
@@ -383,14 +383,14 @@ void ScreenOptionsEditCourse::SetCurrentSong()
} }
else else
{ {
iRow = m_iCurrentRow[PLAYER_1]; int iRow = m_iCurrentRow[PLAYER_1];
int iEntryIndex = RowToEntryIndex( iRow ); int iEntryIndex = RowToEntryIndex( iRow );
Song *pSong = NULL; Song *pSong = NULL;
if( iEntryIndex != -1 ) if( iEntryIndex != -1 )
{ {
int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song); int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song);
OptionRow &oRow = *m_pRows[ iCurrentSongRow ]; OptionRow &row = *m_pRows[ iCurrentSongRow ];
int index = oRow.GetOneSelection(PLAYER_1); int index = row.GetOneSelection(PLAYER_1);
if( index != 0 ) if( index != 0 )
pSong = m_vpSongs[ index - 1 ]; pSong = m_vpSongs[ index - 1 ];
} }
+1 -1
View File
@@ -142,7 +142,7 @@ void ScreenOptionsManageCourses::BeginScreen()
vector<Course*>::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse ); vector<Course*>::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse );
if( iter != m_vpCourses.end() ) if( iter != m_vpCourses.end() )
{ {
iIndex = iter - m_vpCourses.begin(); int iIndex = iter - m_vpCourses.begin();
this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex ); this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex );
} }
} }
+1 -1
View File
@@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] ); vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] );
if( iter != m_vpSteps.end() ) if( iter != m_vpSteps.end() )
{ {
iIndex = iter - m_vpSteps.begin(); int iIndex = iter - m_vpSteps.begin();
this->MoveRowAbsolute( PLAYER_1, 1 + iIndex ); this->MoveRowAbsolute( PLAYER_1, 1 + iIndex );
} }
} }

Some files were not shown because too many files have changed in this diff Show More