diff --git a/.hgignore b/.hgignore index 20fdaa9a3e..74c48098be 100644 --- a/.hgignore +++ b/.hgignore @@ -48,6 +48,7 @@ nsis_strings_temp.inc Data/SpeedMods.txt Program/StepMania*.lib crashinfo.txt +Utils/temp* syntax: regexp .*\#.*\#$ diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 25f54d49be..261a0a1edb 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -10,9 +10,21 @@ supported but exist anyways.) _____________________________________________________________________________ ================================================================================ -sm-ssc v1.2.3 | 201102?? +sm-ssc v1.2.3 | 2011022? -------------------------------------------------------------------------------- +20110225 +-------- +* Add lifts and fakes to all Pump noteskins. [Daisuke Master, Wolfman2000] + +20110224 +-------- +* [NotesLoaderSSC] Allowed reading of #NOTES2 again. [AJ] + +20110223 +-------- +* [Steps] Added GetChartStyle() Lua binding. [AJ] + 20110222 -------- * [ScreenEdit] Display the Player Number for Routine mode. [Wolfman2000] diff --git a/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir deleted file mode 100644 index 616a4c45ef..0000000000 --- a/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir deleted file mode 100644 index e2420613bd..0000000000 --- a/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir deleted file mode 100644 index 4794025bd0..0000000000 --- a/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir deleted file mode 100644 index 3f66d470df..0000000000 --- a/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir deleted file mode 100644 index ded273a4b8..0000000000 --- a/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir b/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir deleted file mode 100644 index d0f3148ab0..0000000000 --- a/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note 5x1 (doubleres).png diff --git a/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir deleted file mode 100644 index 0792534152..0000000000 --- a/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir deleted file mode 100644 index b277d2ba2f..0000000000 --- a/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir deleted file mode 100644 index 81890c8ddb..0000000000 --- a/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir deleted file mode 100644 index 9a82692de7..0000000000 --- a/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/default/Center Fake Note 3x2.redir b/NoteSkins/pump/default/Center Fake Note 3x2.redir deleted file mode 100644 index ae781b40a7..0000000000 --- a/NoteSkins/pump/default/Center Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note 3x2.png diff --git a/NoteSkins/pump/default/Center Tap Lift.lua b/NoteSkins/pump/default/Center Tap Lift.lua index 4862995a70..3691eba751 100644 --- a/NoteSkins/pump/default/Center Tap Lift.lua +++ b/NoteSkins/pump/default/Center Tap Lift.lua @@ -1,3 +1,3 @@ return NOTESKIN:LoadActor("Center","Tap Note")..{ - InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5); + InitCommand=cmd(effectclock,"beat";effectmagnitude,0.5,1,0); }; \ No newline at end of file diff --git a/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir b/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir deleted file mode 100644 index 30ea0f63da..0000000000 --- a/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/default/DownLeft Tap Lift.lua b/NoteSkins/pump/default/DownLeft Tap Lift.lua index ca88dfa0e9..90a29250be 100644 --- a/NoteSkins/pump/default/DownLeft Tap Lift.lua +++ b/NoteSkins/pump/default/DownLeft Tap Lift.lua @@ -1,3 +1,3 @@ return NOTESKIN:LoadActor("DownLeft","Tap Note")..{ - InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) + InitCommand=cmd(effectclock,"beat";effectmagnitude,0.5,1,0) }; \ No newline at end of file diff --git a/NoteSkins/pump/default/DownRight Fake Note 3x2.redir b/NoteSkins/pump/default/DownRight Fake Note 3x2.redir deleted file mode 100644 index f38d257377..0000000000 --- a/NoteSkins/pump/default/DownRight Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note 3x2.png diff --git a/NoteSkins/pump/default/DownRight Tap Lift.lua b/NoteSkins/pump/default/DownRight Tap Lift.lua index 314bb97d5d..ee18e3364f 100644 --- a/NoteSkins/pump/default/DownRight Tap Lift.lua +++ b/NoteSkins/pump/default/DownRight Tap Lift.lua @@ -1,3 +1,3 @@ return NOTESKIN:LoadActor("DownRight","Tap Note")..{ - InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) + InitCommand=cmd(effectclock,"beat";effectmagnitude,0.5,1,0) }; \ No newline at end of file diff --git a/NoteSkins/pump/default/NoteSkin.lua b/NoteSkins/pump/default/NoteSkin.lua index 6baf5572b7..a0d475808f 100644 --- a/NoteSkins/pump/default/NoteSkin.lua +++ b/NoteSkins/pump/default/NoteSkin.lua @@ -118,6 +118,10 @@ local function func() t.BaseRotationZ=Noteskin.BaseRotZ[sButton] end + if sElement == "Tap Lift" then + t.InitCommand=cmd(pulse;effectclock,"beat";effectmagnitude,1,0.75,0); + end + return t end diff --git a/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir b/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir deleted file mode 100644 index b30612a556..0000000000 --- a/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/default/UpLeft Tap Lift.lua b/NoteSkins/pump/default/UpLeft Tap Lift.lua index 3b9f12dc29..9096d27dec 100644 --- a/NoteSkins/pump/default/UpLeft Tap Lift.lua +++ b/NoteSkins/pump/default/UpLeft Tap Lift.lua @@ -1,3 +1,3 @@ return NOTESKIN:LoadActor("UpLeft","Tap Note")..{ - InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) + InitCommand=cmd(effectclock,"beat";effectmagnitude,0.5,1,0) }; \ No newline at end of file diff --git a/NoteSkins/pump/default/UpRight Fake Note 3x2.redir b/NoteSkins/pump/default/UpRight Fake Note 3x2.redir deleted file mode 100644 index de9255e5d6..0000000000 --- a/NoteSkins/pump/default/UpRight Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note 3x2.png diff --git a/NoteSkins/pump/default/UpRight Tap Lift.lua b/NoteSkins/pump/default/UpRight Tap Lift.lua index 3653089be6..91c4f11011 100644 --- a/NoteSkins/pump/default/UpRight Tap Lift.lua +++ b/NoteSkins/pump/default/UpRight Tap Lift.lua @@ -1,3 +1,3 @@ return NOTESKIN:LoadActor("UpRight","Tap Note")..{ - InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) + InitCommand=cmd(effectclock,"beat";effectmagnitude,0.5,1,0) }; \ No newline at end of file diff --git a/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir deleted file mode 100644 index 4ecb1daac0..0000000000 --- a/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir deleted file mode 100644 index fe54142c3e..0000000000 --- a/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir deleted file mode 100644 index 0a7ca4aee9..0000000000 --- a/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir deleted file mode 100644 index a2690031c4..0000000000 --- a/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir deleted file mode 100644 index 19397f9cd6..0000000000 --- a/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/newextra/Center Fake Note 3x2.redir b/NoteSkins/pump/newextra/Center Fake Note 3x2.redir deleted file mode 100644 index ae781b40a7..0000000000 --- a/NoteSkins/pump/newextra/Center Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir b/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir deleted file mode 100644 index 30ea0f63da..0000000000 --- a/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir b/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir deleted file mode 100644 index f38d257377..0000000000 --- a/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir b/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir deleted file mode 100644 index b30612a556..0000000000 --- a/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir b/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir deleted file mode 100644 index de9255e5d6..0000000000 --- a/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note 3x2.png diff --git a/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir deleted file mode 100644 index 68f151a5eb..0000000000 --- a/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir +++ /dev/null @@ -1 +0,0 @@ -_Center Tap Note 6x8.png diff --git a/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir deleted file mode 100644 index 2b783801e2..0000000000 --- a/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir +++ /dev/null @@ -1 +0,0 @@ -_DownLeft Tap Note 6x8.png diff --git a/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir deleted file mode 100644 index 0f333c38eb..0000000000 --- a/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir +++ /dev/null @@ -1 +0,0 @@ -_UpLeft Tap Note 6x8.png diff --git a/NoteSkins/pump/simple/Center Fake Note 8x1.redir b/NoteSkins/pump/simple/Center Fake Note 8x1.redir deleted file mode 100644 index f606d36e06..0000000000 --- a/NoteSkins/pump/simple/Center Fake Note 8x1.redir +++ /dev/null @@ -1 +0,0 @@ -Center Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir b/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir deleted file mode 100644 index 2d86780dab..0000000000 --- a/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir +++ /dev/null @@ -1 +0,0 @@ -DownLeft Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir b/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir deleted file mode 100644 index a8b3a6e3ec..0000000000 --- a/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir +++ /dev/null @@ -1 +0,0 @@ -DownRight Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir b/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir deleted file mode 100644 index bedac9a1e9..0000000000 --- a/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir +++ /dev/null @@ -1 +0,0 @@ -UpLeft Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir b/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir deleted file mode 100644 index f5acbee926..0000000000 --- a/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir +++ /dev/null @@ -1 +0,0 @@ -UpRight Tap Note 8x1.png diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua new file mode 100644 index 0000000000..4b9b2013c3 --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua @@ -0,0 +1,3 @@ +return Def.Quad{ + InitCommand=cmd(Center;FullScreen;diffuse,HSV(192,1,0.8);diffusebottomedge,HSV(192,0.625,0.25)); +}; \ No newline at end of file diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua new file mode 100644 index 0000000000..919f13545d --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua @@ -0,0 +1,51 @@ +local t = Def.ActorFrame{ + LoadActor(THEME:GetPathG("_click","target"))..{ + InitCommand=cmd(diffusealpha,0;Real); + LeftClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" }); + end; + RightClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Right" }); + end; + MiddleClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Middle" }); + end; + MouseWheelUpMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelUp" }); + end; + MouseWheelDownMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelDown" }); + end; + MouseInputMessageCommand=function(self,param) + local cX = INPUTFILTER:GetMouseX() + local cY = INPUTFILTER:GetMouseY() + if param.Input == "Left" then + self:stoptweening() + self:x(cX) + self:y(cY) + self:diffusealpha(1) + self:sleep(1) + self:diffusealpha(0) + end + end + }; + LoadFont("common normal")..{ + Name="Coords"; + InitCommand=cmd(shadowlength,1;zoom,0.5;align,0,1); + MouseInputMessageCommand=function(self,param) + local cX = INPUTFILTER:GetMouseX() + local cY = INPUTFILTER:GetMouseY() + if param.Input == "Left" then + self:stoptweening() + self:x(cX + 8) + self:y(cY + 16) + self:settext("(".. string.format("%i",cX) ..",".. string.format("%i",cY) ..")") + self:diffusealpha(1) + self:sleep(1) + self:diffusealpha(0) + end + end + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua new file mode 100644 index 0000000000..f78dd28efc --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua @@ -0,0 +1,32 @@ +local t = Def.ActorFrame{}; + +local mou = Def.ActorFrame{ + LoadFont("common normal")..{ + Name="Coords"; + InitCommand=cmd(align,0,0;x,SCREEN_LEFT+8;y,SCREEN_BOTTOM-48); + }; +}; +local function UpdateMouse(self) + local coords = self:GetChild("Coords") + local mouseX = INPUTFILTER:GetMouseX() + local mouseY = INPUTFILTER:GetMouseY() + local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY; + coords:settext(text) +end +mou.InitCommand=cmd(SetUpdateFunction,UpdateMouse); +t[#t+1] = mou; + +t[#t+1] = Def.ActorFrame{ + LoadFont("Common normal")..{ + Name="Title"; + Text=THEME:GetString("MouseTest","Title"); + InitCommand=cmd(CenterX;y,SCREEN_TOP+28;diffuse,color("#333333")); + }; + LoadFont("Common normal")..{ + Name="Instructions"; + Text=THEME:GetString("MouseTest","Instructions"); + InitCommand=cmd(x,SCREEN_LEFT+12;align,0,0;y,SCREEN_TOP+42;diffuse,color("#333333");zoom,16/24;wrapwidthpixels,SCREEN_WIDTH*1.5); + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua new file mode 100644 index 0000000000..36fe28ff45 --- /dev/null +++ b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua @@ -0,0 +1,43 @@ +local gc = Var("GameCommand"); +local index = gc:GetIndex(); +local name = gc:GetName(); +local text = gc:GetText(); + +local itemColors = { + HSV(128, 0.6, 0.85), -- play + HSV(192, 0.6, 0.85), -- options + HSV(160, 0.6, 0.85), -- customization + HSV( 64, 0.6, 0.85), -- edit + HSV( 0, 0.6, 0.85), -- exit +}; + +local t = Def.ActorFrame{ + --[[ + Def.Actor{ + Name="TitleMenuController"; + GainFocusCommand=function(self) + MESSAGEMAN:Broadcast("TitleChange",{NewColor=itemColors[index+1]}); + end; + }; + ]] + LoadFont("Common Normal")..{ + Text=Screen.String(text); + InitCommand=cmd(diffuse,color("1,1,1,1")); + DisabledCommand=cmd(diffuse,color("0.5,0.5,0.5,0.85")); + --GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,itemColors[index+1]); + GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,0.2,0.2,1")); + LoseFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,1,1,1")); + }; + --[[ begin triangle ]] + Def.Quad{ + InitCommand=cmd(x,-SCREEN_WIDTH*0.105;zoomto,8,24;zwrite,true;blend,'BlendMode_NoEffect'); + }; + Def.Quad{ + InitCommand=cmd(x,-SCREEN_WIDTH*0.1;zoomto,12,12;rotationz,45;diffuselowerleft,color("0,0,0,0");ztest,true); + GainFocusCommand=cmd(stoptweening;visible,true); + LoseFocusCommand=cmd(stoptweening;visible,false); + }; + --[[ end triangle ]] +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/Graphics/_click target.png b/Themes/MouseTest/Graphics/_click target.png new file mode 100644 index 0000000000..88fe2211e7 Binary files /dev/null and b/Themes/MouseTest/Graphics/_click target.png differ diff --git a/Themes/MouseTest/Languages/en.ini b/Themes/MouseTest/Languages/en.ini new file mode 100644 index 0000000000..69659b79b7 --- /dev/null +++ b/Themes/MouseTest/Languages/en.ini @@ -0,0 +1,6 @@ +[Common] +WindowTitle=sm-ssc Mouse Test + +[MouseTest] +Title=sm-ssc Mouse Test +Instructions=Move around with the mouse. You'll see some coordinates in the bottom right, and when you click, a target appears. \ No newline at end of file diff --git a/Themes/MouseTest/ThemeInfo.ini b/Themes/MouseTest/ThemeInfo.ini new file mode 100644 index 0000000000..a44e86304e --- /dev/null +++ b/Themes/MouseTest/ThemeInfo.ini @@ -0,0 +1,3 @@ +[ThemeInfo] +DisplayName=sm-ssc Mouse Test +Author=sm-ssc Developers \ No newline at end of file diff --git a/Themes/MouseTest/metrics.ini b/Themes/MouseTest/metrics.ini new file mode 100644 index 0000000000..1a707786b5 --- /dev/null +++ b/Themes/MouseTest/metrics.ini @@ -0,0 +1,15 @@ +# sm-ssc Mouse Test theme +[Common] +InitialScreen="ScreenTitleMenu" + +[ScreenTitleMenu] +IdleTimeoutSeconds=-1 +IdleTimeoutScreen="ScreenTitleMenu" + +ChoiceNames="1,2" +Choice1="screen,ScreenOptionsService;text,Options" +Choice2="screen,ScreenExit;text,Exit" + +[ScreenOptionsService] +PrevScreen="ScreenTitleMenu" +NextScreen="ScreenTitleMenu" \ No newline at end of file diff --git a/Themes/_fallback/Scripts/02 StageMods.lua b/Themes/_fallback/Scripts/02 StageMods.lua index 37bd927a5a..d61db7c252 100644 --- a/Themes/_fallback/Scripts/02 StageMods.lua +++ b/Themes/_fallback/Scripts/02 StageMods.lua @@ -50,6 +50,8 @@ function ScreenSelectMusic:setupmusicstagemods() GAMESTATE:SetPreferredDifficulty( pn, difficulty ) MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} ) end + +-- if PREFSMAN:GetPreference(" GAMESTATE:SetSongOptions( "ModsLevel_Stage", so ) MESSAGEMAN:Broadcast( "SongOptionsChanged" ) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 1cc853a60a..bfc0d6b4b6 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -196,7 +196,7 @@ ScrollRoulette=false [BitmapText] # The colors in the 'roulette' text. you can have alot! NumRainbowColors=7 -RainbowColor1=color("1.0,1.0,1.0,1") -- red +RainbowColor1=color("1.0,0.0,0.4,1") -- red RainbowColor2=color("0.8,0.2,0.6,1") -- pink RainbowColor3=color("0.4,0.3,0.5,1") -- purple RainbowColor4=color("0.2,0.6,1.0,1") -- sky blue diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/basemeter.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/basemeter.png new file mode 100644 index 0000000000..469e617168 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/basemeter.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/center (doubleres).png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/center (doubleres).png new file mode 100644 index 0000000000..f792417219 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/center (doubleres).png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/corner (doubleres).png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/corner (doubleres).png new file mode 100644 index 0000000000..f509dde7a7 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/corner (doubleres).png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/danger.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/danger.png new file mode 100644 index 0000000000..3adbe6ff21 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/danger.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/decoration_corner (doubleres).png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/decoration_corner (doubleres).png new file mode 100644 index 0000000000..865e4ce12b Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/decoration_corner (doubleres).png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/default.lua b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/default.lua new file mode 100644 index 0000000000..1fa7919e8c --- /dev/null +++ b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/default.lua @@ -0,0 +1,512 @@ +local t = Def.ActorFrame{} + +local newBPS; +local oldBPS; + + +-- DECORATIONS //////////////////////// + +-- Left Hex Corner Decoration +t[#t+1] = LoadActor("decoration_corner") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_1)); + OnCommand=cmd(horizalign,left;x,SCREEN_LEFT;vertalign,top;y,SCREEN_TOP;zoomy,0.4;zoomx,0.6;diffusealpha,0.3;blend,Blend.Add); +}; + +-- Right Hex Corner Decoration +t[#t+1] = LoadActor("decoration_corner") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_2)); + OnCommand=cmd(horizalign,left;x,SCREEN_RIGHT;vertalign,top;y,SCREEN_TOP;zoomy,0.4;;zoomx,-0.6;diffusealpha,0.3;blend,Blend.Add); +}; + + +-- WAVY LINE (thanks AJ) //////////////////////// + + +--P1 +t[#t+1] = LoadActor("hot_lores") .. { + OnCommand=cmd(diffusealpha,0;visible,GAMESTATE:IsHumanPlayer(PLAYER_1);horizalign,left;x,SCREEN_LEFT+18;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH/2-26;texcoordvelocity,0.1,0;queuecommand,"Begin"); + BeginCommand=function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + local move = GAMESTATE:GetSongBPS()/2 + if GAMESTATE:GetSongFreeze() then + move = 0; + end + self:texcoordvelocity(move,0); + self:sleep(0.001); + self:queuecommand("Begin"); + end; + end; + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_1 then + local lifeP1=params.LifeMeter:GetLife(); + if lifeP1>=THEME:GetMetric("LifeMeterBar", "HotValue") then + self:diffusealpha(0.5); + else + self:diffusealpha(0); + end; + end; + end; +}; + +--P2 +t[#t+1] = LoadActor("hot_lores") .. { + OnCommand=cmd(diffusealpha,0;visible,GAMESTATE:IsHumanPlayer(PLAYER_2);horizalign,left;x,SCREEN_RIGHT-18;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,(SCREEN_WIDTH/2-26)*-1;texcoordvelocity,0.1,0;queuecommand,"Begin"); + BeginCommand=function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + local move = GAMESTATE:GetSongBPS()/2 + if GAMESTATE:GetSongFreeze() then + move = 0; + end + self:texcoordvelocity(move,0); + self:sleep(0.001); + self:queuecommand("Begin"); + end; + end; + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_2 then + local lifeP2=params.LifeMeter:GetLife(); + if lifeP2>=THEME:GetMetric("LifeMeterBar", "HotValue") then + self:diffusealpha(0.5); + else + self:diffusealpha(0); + end; + end; + end; +}; + +--Double +--customtexturerect,0,0,[PixelsToCoverWidth]/[ImageWidth],[PixelsToCoverHeight]/[ImageHeight] +--I said that I was gonna write it down. thx midi + +t[#t+1] = LoadActor("hot_lores") .. { + OnCommand=cmd(diffusealpha,0;horizalign,left;x,SCREEN_LEFT+18;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH-36;texcoordvelocity,0.1,0;customtexturerect,0,0,600/(SCREEN_WIDTH-36),1;queuecommand,"Begin"); + BeginCommand=function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + local move = GAMESTATE:GetSongBPS()/2 + if GAMESTATE:GetSongFreeze() then + move = 0; + end + self:texcoordvelocity(move,0); + self:sleep(0.001); + self:queuecommand("Begin"); + else + self:visible(false); + end; + end; + LifeChangedMessageCommand=function(self,params) + local life=params.LifeMeter:GetLife(); + if life>=THEME:GetMetric("LifeMeterBar", "HotValue") then + self:diffusealpha(0.5); + else + self:diffusealpha(0); + end; + end; +}; + + +-- DANGER //////////////////////// + + +--DANGER P1 single +t[#t+1] = LoadActor("danger") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_1);horizalign,left;x,SCREEN_LEFT+18;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH/2-26;zoomy,0.5); + OnCommand=cmd(effectclock,"bgm";diffusealpha,1;linear,0.2;diffusealpha,0.25;linear,0.2;diffusealpha,1;queuecommand,"On"); + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_1 then + local lifeP1 = params.LifeMeter:GetLife(); + if lifeP1 <= THEME:GetMetric("LifeMeterBar", "DangerThreshold") then + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + self:visible(true); + end; + else + self:visible(false); + end; + end; +end; + +}; + +--DANGER P2 single +t[#t+1] = LoadActor("danger") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_2);horizalign,right;x,SCREEN_RIGHT-18;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH/2-26;zoomy,0.5); + OnCommand=cmd(effectclock,"bgm";diffusealpha,1;linear,0.2;diffusealpha,0.25;linear,0.2;diffusealpha,1;queuecommand,"On"); + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_2 then + local lifeP2 = params.LifeMeter:GetLife(); + if lifeP2 <= THEME:GetMetric("LifeMeterBar", "DangerThreshold") then + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + self:visible(true); + end; + else + self:visible(false); + end; + end; + end; +}; + +--DANGER double +t[#t+1] = LoadActor("danger") .. { + InitCommand=cmd(visible,false;horizalign,center;x,SCREEN_CENTER_X;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH-36;zoomy,0.5); + OnCommand=cmd(effectclock,"bgm";diffusealpha,1;linear,0.2;diffusealpha,0.25;linear,0.2;diffusealpha,1;queuecommand,"On"); + LifeChangedMessageCommand=function(self,params) + local life = params.LifeMeter:GetLife(); + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + if life <= THEME:GetMetric("LifeMeterBar", "DangerThreshold") then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + + + +-- METERS //////////////////////// + + + + + +---basemeter masked P1 +t[#t+1] = LoadActor("basemeter") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_1);horizalign,left;x,SCREEN_LEFT+18;valign,0.5;y,SCREEN_TOP+41;zoomy,0.5;blend,Blend.Add); + OnCommand=cmd(bounce;effectmagnitude,-40,0,0;effectclock,"bgm";effecttiming,2,0,0,0;); + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_1 then + local style = GAMESTATE:GetCurrentStyle(); + local lifeP1 = params.LifeMeter:GetLife(); + if GAMESTATE:IsHumanPlayer(PLAYER_1)==true then + if lifeP1==0 then + self:visible(false); + else + + if lifeP1==1 then + self:effectmagnitude(0,0,0); + else + self:effectmagnitude(-40,0,0); + end; + + self:visible(true); + end + end + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:zoomtowidth((SCREEN_WIDTH-40)*lifeP1+5); + else + self:zoomtowidth((SCREEN_WIDTH/2-26)*lifeP1); + end; + + end; + end; + +}; + + + + + + + +---basemeter masked P2 +t[#t+1] = LoadActor("basemeter") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_2);horizalign,right;x,SCREEN_RIGHT+18;valign,0.5;y,SCREEN_TOP+41;zoomy,0.5;blend,Blend.Add;queuecommand,"Set"); + OnCommand=cmd(bob;effectmagnitude,40,0,0;effectclock,"bgm";effecttiming,1,0,0,0;); + SetCommand=function(self,params) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:effectmagnitude(-40,0,0); + self:horizalign(left); + self:x(SCREEN_LEFT+18); + end; + end; + + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_2 then + local style = GAMESTATE:GetCurrentStyle(); + local lifeP2 = params.LifeMeter:GetLife(); + if GAMESTATE:IsHumanPlayer(PLAYER_2)==true then + if lifeP2==0 then + self:visible(false); + else + + if lifeP2==1 then + self:effectmagnitude(0,0,0); + else + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:effectmagnitude(-40,0,0); + else + self:effectmagnitude(40,0,0); + end + end; + + self:visible(true); + end + end + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:zoomtowidth((SCREEN_WIDTH-40)*lifeP2); + else + self:zoomtowidth(((SCREEN_WIDTH/2-26)*lifeP2)+40); + end; + + end; + end; + +}; + + + + +-- FRAMES & TIPS //////////////////////// + + +-- Left Corner +t[#t+1] = LoadActor("mask") .. { + OnCommand=cmd(horizalign,right;x,SCREEN_LEFT+130;vertalign,top;y,SCREEN_TOP+12;zoom,0.45;queuecommand,"Set"); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(true); + else + if GAMESTATE:IsHumanPlayer(PLAYER_1) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + +-- Right Corner +t[#t+1] = LoadActor("mask") .. { + OnCommand=cmd(horizalign,right;x,SCREEN_RIGHT-130;vertalign,top;y,SCREEN_TOP+12;zoomx,-0.45;zoomy,0.45;queuecommand,"Set"); +SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(true); + else + if GAMESTATE:IsHumanPlayer(PLAYER_2) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + + +-- Left Corner +t[#t+1] = LoadActor("corner") .. { + OnCommand=cmd(horizalign,left;x,SCREEN_LEFT+15;vertalign,top;y,SCREEN_TOP+16;zoom,0.75;queuecommand,"Set"); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(true); + else + if GAMESTATE:IsHumanPlayer(PLAYER_1) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + +-- Right Corner +t[#t+1] = LoadActor("corner") .. { + OnCommand=cmd(horizalign,left;x,SCREEN_RIGHT-15;vertalign,top;y,SCREEN_TOP+16;zoomx,-0.75;zoomy,0.75;queuecommand,"Set"); +SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(true); + else + if GAMESTATE:IsHumanPlayer(PLAYER_2) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + +-- Center Corner Left +t[#t+1] = LoadActor("center") .. { + OnCommand=cmd(horizalign,left;x,SCREEN_CENTER_X+5;vertalign,top;y,SCREEN_TOP+16;zoomx,-0.75;zoomy,0.75;queuecommand,"Set"); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + if GAMESTATE:IsHumanPlayer(PLAYER_1) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + +-- Center Corner Right +t[#t+1] = LoadActor("center") .. { + OnCommand=cmd(horizalign,left;x,SCREEN_CENTER_X-5;vertalign,top;y,SCREEN_TOP+16;zoom,0.75;queuecommand,"Set"); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false); + else + if GAMESTATE:IsHumanPlayer(PLAYER_2) == true then + self:visible(true); + else + self:visible(false); + end; + end; + end; +}; + +-- Center part 1 +t[#t+1] = LoadActor("frame") .. { + OnCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_1);horizalign,left;x,SCREEN_LEFT+52.5;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH/2-85;zoomy,0.75;queuecommand,"Set";); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:zoomtowidth(SCREEN_WIDTH-105); + self:visible(true) + else + if GAMESTATE:IsHumanPlayer(PLAYER_1) == false then + self:visible(false) + else + self:visible(true) + end + end; + end; +}; + +-- Center part 2 +t[#t+1] = LoadActor("frame") .. { + OnCommand=cmd(horizalign,right;x,SCREEN_RIGHT-52.5;vertalign,top;y,SCREEN_TOP+16;zoomtowidth,SCREEN_WIDTH/2-85;zoomy,0.75;queuecommand,"Set";); + SetCommand = function(self) + local style = GAMESTATE:GetCurrentStyle(); + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:visible(false) + else + if GAMESTATE:IsHumanPlayer(PLAYER_2) == true then + self:visible(true) + else + self:visible(false) + end; + end; + end; +}; + + + +---tip P1 +t[#t+1] = LoadActor("tip") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_1);valign,0.5;y,SCREEN_TOP+41;zoom,0.5;blend,Blend.Add;queuecommand,"Set"); + --OnCommand=cmd(bob;effectmagnitude,-40,0,0;effectclock,"bgm";effecttiming,1,0,0,0;); + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_1 then + local style = GAMESTATE:GetCurrentStyle(); + local lifeP1 = params.LifeMeter:GetLife(); + if GAMESTATE:IsHumanPlayer(PLAYER_1)==true then + if lifeP1==0 then + self:visible(false); + else + self:visible(true); + end + end + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:x((SCREEN_WIDTH-40)*lifeP1+20); + else + self:x((SCREEN_WIDTH/2-26)*lifeP1+20); + end; + + end; + end; + +}; + + + +---tip P2 +t[#t+1] = LoadActor("tip") .. { + InitCommand=cmd(visible,GAMESTATE:IsHumanPlayer(PLAYER_2);valign,0.5;y,SCREEN_TOP+41;zoom,0.5;blend,Blend.Add;); + --OnCommand=cmd(bob;effectmagnitude,40,0,0;effectclock,"bgm";effecttiming,1,0,0,0;); + LifeChangedMessageCommand=function(self,params) + if params.Player == PLAYER_2 then + local style = GAMESTATE:GetCurrentStyle(); + local lifeP2 = params.LifeMeter:GetLife(); + local fullstate; + if GAMESTATE:IsHumanPlayer(PLAYER_2)==true then + if lifeP2==0 then + self:visible(false); + else + self:visible(true); + end + end + if style:GetStyleType() == "StyleType_OnePlayerTwoSides" then + self:x((SCREEN_WIDTH-40)*lifeP2+20); + else + self:x(SCREEN_RIGHT-((SCREEN_WIDTH/2-26)*lifeP2)-20); + end; + + end; + end; + +}; + +-- NAMES //////////////////////// + +--P1 NAME +t[#t+1] = LoadFont("Common Normal") .. { + InitCommand=cmd(horizalign,left;x,SCREEN_LEFT+30;y,SCREEN_TOP+15;zoom,0.4;shadowlength,1;uppercase,true); + BeginCommand=function(self) + local profile = PROFILEMAN:GetProfile(PLAYER_1); + local name = profile:GetDisplayName(); + + if GAMESTATE:IsHumanPlayer(PLAYER_1) == true then + if name=="" then + self:settext("Player 1"); + else + self:settext( name ); + end + end + + end; + + }; + +--P2 NAME +t[#t+1] = LoadFont("Common Normal") .. { + InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT-30;y,SCREEN_TOP+15;zoom,0.4;shadowlength,1;uppercase,true); + BeginCommand=function(self) + local profile = PROFILEMAN:GetProfile(PLAYER_2); + local name = profile:GetDisplayName(); + + if GAMESTATE:IsHumanPlayer(PLAYER_2) == true then + if name=="" then + self:settext("Player 2"); + else + self:settext( name ); + end + end + end; + + }; + + + +return t \ No newline at end of file diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/frame (doubleres).png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/frame (doubleres).png new file mode 100644 index 0000000000..8f4fb1191a Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/frame (doubleres).png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/hot_lores.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/hot_lores.png new file mode 100644 index 0000000000..6b2698696e Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/hot_lores.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/mask.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/mask.png new file mode 100644 index 0000000000..94585b3638 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/mask.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/meter.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/meter.png new file mode 100644 index 0000000000..983338f40a Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/meter.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/tip.png b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/tip.png new file mode 100644 index 0000000000..05b8c15fd5 Binary files /dev/null and b/Themes/default-dev-midi/BGAnimations/ScreenGameplay underlay/tip.png differ diff --git a/Themes/default-dev-midi/BGAnimations/ScreenSelectMusic underlay.lua b/Themes/default-dev-midi/BGAnimations/ScreenSelectMusic underlay.lua new file mode 100644 index 0000000000..3c2b2a29b3 --- /dev/null +++ b/Themes/default-dev-midi/BGAnimations/ScreenSelectMusic underlay.lua @@ -0,0 +1 @@ +return Def.ActorFrame {}; \ No newline at end of file diff --git a/Themes/default-dev-midi/ThemeInfo.ini b/Themes/default-dev-midi/ThemeInfo.ini new file mode 100644 index 0000000000..56c62b42cd --- /dev/null +++ b/Themes/default-dev-midi/ThemeInfo.ini @@ -0,0 +1,3 @@ +[ThemeInfo] +DisplayName=Midi Dev Theme +Author=Midiman \ No newline at end of file diff --git a/Themes/default-dev-midi/metrics.ini b/Themes/default-dev-midi/metrics.ini new file mode 100644 index 0000000000..87e92e1686 --- /dev/null +++ b/Themes/default-dev-midi/metrics.ini @@ -0,0 +1,5 @@ +[Global] +FallbackTheme=default +[ScreenGameplay] +LifeP1OnCommand=visible,false +LifeP2OnCommand=visible,false \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua new file mode 100644 index 0000000000..8bf1f85bb4 --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua @@ -0,0 +1,63 @@ +local vStats = STATSMAN:GetCurStageStats(); +local function CreateStats( pnPlayer ) + -- Actor Templates + local aLabel = LoadFont("Common Normal") .. { Text="..."; InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; + local aText = LoadFont("Common Normal") .. { Text="..."; InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; + -- DA STATS, JIM!! + local pnStageStats = vStats:GetPlayerStageStats( pnPlayer ); + -- Organized Stats. + local tStats = { + W1 = pnStageStats:GetTapNoteScores('TapNoteScore_W1'); + W2 = pnStageStats:GetTapNoteScores('TapNoteScore_W2'); + W3 = pnStageStats:GetTapNoteScores('TapNoteScore_W3'); + W4 = pnStageStats:GetTapNoteScores('TapNoteScore_W4'); + W5 = pnStageStats:GetTapNoteScores('TapNoteScore_W5'); + Miss = pnStageStats:GetTapNoteScores('TapNoteScore_Miss'); + HitMine = pnStageStats:GetTapNoteScores('TapNoteScore_HitMine'); + AvoidMine = pnStageStats:GetTapNoteScores('TapNoteScore_AvoidMine'); + Held = pnStageStats:GetHoldNoteScores('HoldNoteScore_Held'); + LetGo = pnStageStats:GetHoldNoteScores('HoldNoteScore_LetGo'); + }; + -- Organized Equation Values + local tValues = { + -- marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 + ITG = ( tStats["W1"]*7 + tStats["W2"]*6 + tStats["W3"]*5 + tStats["W4"]*4 + tStats["W5"]*2 + tStats["Held"]*7 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 + ITG_MAX = ( tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"] + tStats["Held"] + tStats["LetGo"] )*7, + -- marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 + MIGS = ( tStats["W1"]*3 + tStats["W2"]*2 + tStats["W3"] - tStats["W5"]*4 - tStats["Miss"]*8 + tStats["Held"]*6 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 + MIGS_MAX = ( (tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"])*3 + (tStats["Held"] + tStats["LetGo"])*6 ), + + }; + -- + local t = Def.ActorFrame {}; + t[#t+1] = Def.ActorFrame { + InitCommand=cmd(y,-16); + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + }; + aLabel .. { Text="ITG DP:"; InitCommand=cmd(x,-64) }; + aText .. { Text=string.format("%04i",tValues["ITG"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.675); }; + aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; + aText .. { Text=string.format("%04i",tValues["ITG_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; + }; + t[#t+1] = Def.ActorFrame { + InitCommand=cmd(y,16); + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + }; + aLabel .. { Text="MIGS DP:"; InitCommand=cmd(x,-64) }; + aText .. { Text=string.format("%04i",tValues["MIGS"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.675); }; + aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; + aText .. { Text=string.format("%04i",tValues["MIGS_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; + }; + return t +end; +local t = Def.ActorFrame {}; +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,math.floor(SCREEN_CENTER_X*0.5)-8;y,SCREEN_CENTER_Y); + -- + CreateStats( PLAYER_1 ); +}; +return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua new file mode 100644 index 0000000000..df3f8441cb --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua @@ -0,0 +1,86 @@ +local ss = STATSMAN:GetCurStageStats(); +local pss = ss:GetPlayerStageStats('PlayerNumber_P1'); +local misscount = pss:GetTapNoteScores('TapNoteScore_Miss'); +local boocount = pss:GetTapNoteScores('TapNoteScore_W5'); +local goodcount = pss:GetTapNoteScores('TapNoteScore_W4'); +local greatcount = pss:GetTapNoteScores('TapNoteScore_W3'); +local perfcount = pss:GetTapNoteScores('TapNoteScore_W2'); +local marvcount = pss:GetTapNoteScores('TapNoteScore_W1'); +local minehitcount = pss:GetTapNoteScores('TapNoteScore_HitMine'); +local minemisscount = pss:GetTapNoteScores('TapNoteScore_AvoidMine'); +local okcount = pss:GetHoldNoteScores('HoldNoteScore_Held'); +local ngcount = pss:GetHoldNoteScores('HoldNoteScore_LetGo'); +local ITGdp = marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 +local ITGdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 +local MIGSdp = marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 +local MIGSdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 +local histogram = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} +local total = 0 +local maxValue = 0; +print("John11length: "..#histogram); + +for i=1,#tTotalJudgmentsSigned do + print("John11Timings: "..i.." - "..tTotalJudgmentsSigned[i]) + local index = math.floor((0.18-tTotalJudgmentsSigned[i])*(#histogram/.36)); + print("John11Index: "..i.." - "..index) + if index >= 0 and index <= #histogram - 1 then + histogram[index] = histogram[index] + 1 + total = total + 1 + if histogram[index] > maxValue then + maxValue = histogram[index] + end + end +end + +for i=1,#histogram do + print("John11Judgments: "..i.." - "..histogram[i]) +end + +local t = Def.ActorFrame {} +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X/3;y,SCREEN_CENTER_Y); + LoadFont("Common Normal") .. { + Text="MIGS DP: "..tostring(MIGSdp).."/"..tostring(MIGSdpmax).."\nITG DP: "..tostring(ITGdp).."/"..tostring(ITGdpmax).."\nOffset Avg: "..RoundTo(tTimingDifferenceAverage,5).."\nAbs Offset Avg: "..RoundTo(tTimingDifferenceAbsAverage,5).."\nEarly Taps: "..tEarlyHits.."\nLate Taps: "..tLateHits; + InitCommand=cmd(y,-4;shadowlength,1;diffuse,Color("Red");zoom,0.5) + }; +} + +for i=1,#histogram do + local offset = -1 + if i > #histogram/2 then + offset = 1 + end + t[#t+1] = Def.Quad { + InitCommand=cmd(diffuse,Color("Red");zoomtowidth,300/#histogram-1;zoomtoheight,histogram[#histogram-i]/maxValue*150;x,SCREEN_CENTER_X+100+300/#histogram*i+offset;y,SCREEN_CENTER_Y-histogram[#histogram-i]/maxValue*150/2); + } +end + +t[#t+1] = Def.Quad { + InitCommand=cmd(x,SCREEN_CENTER_X+250;y,SCREEN_CENTER_Y+3;zoomtowidth,300;zoomtoheight,5;diffuse,color("#FFFFFF")); +} + +t[#t+1] = Def.Quad { + InitCommand=cmd(x,SCREEN_CENTER_X+252;y,SCREEN_CENTER_Y-75;zoomtowidth,1;zoomtoheight,150;diffuse,color("#000000")); +} + + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X+125;y,SCREEN_CENTER_Y+15); + LoadFont("Common Normal") .. { + Text="Early"; + InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) + }; +} + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X+375;y,SCREEN_CENTER_Y+15); + LoadFont("Common Normal") .. { + Text="Late"; + InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) + }; +} + +print("John11Total: "..total) +print("John11MaxValue: "..maxValue) + +return t \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 97bf7a4d3a..29d9ea8bb0 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -638,7 +638,7 @@ ShowMeter=true ZeroMeterString="0" MeterX=56 MeterY=0 -MeterOnCommand=shadowlength,1;zoom,0.65 +MeterOnCommand=shadowlength,1;zoom,0.65;textglowmode,'TextGlowMode_Inner'; MeterOffCommand= MeterSetCommand=%function(self,param) \ if param.CustomDifficulty then \ diff --git a/Utils/doxygen_config b/Utils/doxygen_config index 3803e6da40..f589b3748c 100644 --- a/Utils/doxygen_config +++ b/Utils/doxygen_config @@ -3,10 +3,10 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = StepMania +PROJECT_NAME = sm-ssc PROJECT_NUMBER = OUTPUT_DIRECTORY = temp -CREATE_SUBDIRS = NO +CREATE_SUBDIRS = YES OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = YES BRIEF_MEMBER_DESC = YES @@ -23,7 +23,7 @@ MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 +TAB_SIZE = 4 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 2a8a86ed48..9c106e70aa 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -23,6 +23,8 @@ /* Begin PBXBuildFile section */ 1215D7A208C6559A00B87D8B /* ScreenGameplayNormal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1215D7A008C6559A00B87D8B /* ScreenGameplayNormal.cpp */; }; + 2B30D6821315EA7E00044B68 /* MouseDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B30D6801315EA7E00044B68 /* MouseDevice.cpp */; }; + 2B30D6831315EA7E00044B68 /* MouseDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B30D6811315EA7E00044B68 /* MouseDevice.h */; }; 2BA7925E1304F20D002BD8E1 /* NotesLoaderSSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7925A1304F20D002BD8E1 /* NotesLoaderSSC.cpp */; }; 2BA7925F1304F20D002BD8E1 /* NotesLoaderSSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA7925B1304F20D002BD8E1 /* NotesLoaderSSC.h */; }; 2BA792601304F20D002BD8E1 /* NotesWriterSSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7925C1304F20D002BD8E1 /* NotesWriterSSC.cpp */; }; @@ -1772,6 +1774,8 @@ 1215D7A108C6559A00B87D8B /* ScreenGameplayNormal.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = ScreenGameplayNormal.h; path = ../src/ScreenGameplayNormal.h; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 2B30D6801315EA7E00044B68 /* MouseDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseDevice.cpp; sourceTree = ""; }; + 2B30D6811315EA7E00044B68 /* MouseDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseDevice.h; sourceTree = ""; }; 2BA7925A1304F20D002BD8E1 /* NotesLoaderSSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NotesLoaderSSC.cpp; path = ../src/NotesLoaderSSC.cpp; sourceTree = SOURCE_ROOT; }; 2BA7925B1304F20D002BD8E1 /* NotesLoaderSSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotesLoaderSSC.h; path = ../src/NotesLoaderSSC.h; sourceTree = SOURCE_ROOT; }; 2BA7925C1304F20D002BD8E1 /* NotesWriterSSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NotesWriterSSC.cpp; path = ../src/NotesWriterSSC.cpp; sourceTree = SOURCE_ROOT; }; @@ -4820,6 +4824,8 @@ AA44708C0984720900983E82 /* JoystickDevice.h */, AA4470BB098476F600983E82 /* KeyboardDevice.cpp */, AA4470BA098476F600983E82 /* KeyboardDevice.h */, + 2B30D6801315EA7E00044B68 /* MouseDevice.cpp */, + 2B30D6811315EA7E00044B68 /* MouseDevice.h */, AA1F9C4609AF1BF5002C15A8 /* PumpDevice.cpp */, AA1F9C4509AF1BF5002C15A8 /* PumpDevice.h */, AABBFCD209838C3A00F077E2 /* SMMain.mm */, @@ -4928,6 +4934,7 @@ EE906F8B12BF3C7C00146C96 /* FileDownload.h in Headers */, 2BA7925F1304F20D002BD8E1 /* NotesLoaderSSC.h in Headers */, 2BA792611304F20D002BD8E1 /* NotesWriterSSC.h in Headers */, + 2B30D6831315EA7E00044B68 /* MouseDevice.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6172,6 +6179,7 @@ EE906F8A12BF3C7C00146C96 /* FileDownload.cpp in Sources */, 2BA7925E1304F20D002BD8E1 /* NotesLoaderSSC.cpp in Sources */, 2BA792601304F20D002BD8E1 /* NotesWriterSSC.cpp in Sources */, + 2B30D6821315EA7E00044B68 /* MouseDevice.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/Actor.h b/src/Actor.h index e67278602b..c393dcd952 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -63,6 +63,35 @@ LuaDeclareType( VertAlign ); #define align_middle 0.5f /** @brief The bottom vertical alignment constant. */ #define align_bottom 1.0f + +/* +enum EffectAction +{ + EffectAction_None, // no_effect + // [Diffuse] + EffectAction_DiffuseBlink, // diffuse_blink + EffectAction_DiffuseShift, // diffuse_shift + EffectAction_DiffuseRamp, // diffuse_ramp + EffectAction_Rainbow, // rainbow + // [Glow] + EffectAction_GlowBlink, // glow_blink + EffectAction_GlowShift, // glow_shift + EffectAction_GlowRamp, // glow_ramp + // [Translate] + EffectAction_Bob, + EffectAction_Bounce, + EffectAction_Vibrate, + // [Rotate] + EffectAction_Spin, + EffectAction_Wag, + // [Zoom] + EffectAction_Pulse, + NUM_EffectAction, + EffectAction_Invalid +}; +LuaDeclareType( EffectAction ); +*/ + /** @brief Base class for all objects that appear on the screen. */ class Actor : public MessageSubscriber { @@ -92,11 +121,59 @@ public: wag, bounce, bob, pulse, spin, vibrate }; + + /** @brief Various values an Actor's effect can be tied to. */ + enum EffectClock + { + CLOCK_TIMER, + CLOCK_TIMER_GLOBAL, + CLOCK_BGM_TIME, + CLOCK_BGM_BEAT, + CLOCK_BGM_TIME_NO_OFFSET, + CLOCK_BGM_BEAT_NO_OFFSET, + CLOCK_LIGHT_1 = 1000, + CLOCK_LIGHT_LAST = 1100, + NUM_CLOCKS + }; + + ///** @brief What type of Effect this is. */ /* enum EffectType { EffectType_Diffuse, + EffectType_Glow, EffectType_Translate, - Num_EffectType + EffectType_Rotate, + EffectType_Zoom, + NUM_EffectType, + EffectType_Invalid + }; + */ + + // todo: use this instead of the Effect enum -aj + /* + struct Effect + { + Effect() : m_Action(EffectAction_None), m_Type(EffectType_Invalid), m_fSecsIntoEffect(0), + m_fEffectDelta(0), m_fEffectRampUp(0.5f), m_fEffectHoldAtHalf(0), + m_fEffectRampDown(0.5f), m_fEffectHoldAtZero(0), m_fEffectOffset(0), + m_EffectClock(CLOCK_TIMER), m_vEffectMagnitude(RageVector3(0,0,10)), + m_effectColor1(RageColor(1,1,1,1)), m_effectColor2(RageColor(1,1,1,1)) + { } + + EffectAction m_Action; + EffectType m_Type; // diffuse, glow, or translate + float m_fSecsIntoEffect; + float m_fEffectDelta; + RageColor m_EffectColor1; + RageColor m_EffectColor2; + RageVector3 m_vEffectMagnitude; + EffectClock m_EffectClock; + // units depend on m_EffectClock + float m_fEffectRampUp; + float m_fEffectHoldAtHalf; + float m_fEffectRampDown; + float m_fEffectHoldAtZero; + float m_fEffectOffset; }; */ @@ -123,25 +200,16 @@ public: * * If 0, there is no fade. If 1, it's fully faded. */ RectF fade; + /** + * @brief Four values making up the diffuse in this TweenState. + * + * 0 = UpperLeft, 1 = UpperRight, 2 = LowerLeft, 3 = LowerRight */ RageColor diffuse[4]; + /** @brief The glow color for this TweenState. */ RageColor glow; float aux; }; - /** @brief Various values an Actor's effect can be tied to. */ - enum EffectClock - { - CLOCK_TIMER, - CLOCK_TIMER_GLOBAL, - CLOCK_BGM_TIME, - CLOCK_BGM_BEAT, - CLOCK_BGM_TIME_NO_OFFSET, - CLOCK_BGM_BEAT_NO_OFFSET, - CLOCK_LIGHT_1 = 1000, - CLOCK_LIGHT_LAST = 1100, - NUM_CLOCKS - }; - void Draw(); // calls, EarlyAbortDraw, BeginDraw, DrawPrimitives, EndDraw virtual bool EarlyAbortDraw() const { return false; } // return true to early abort drawing of this Actor virtual void BeginDraw(); // pushes transform onto world matrix stack @@ -308,7 +376,6 @@ public: void StretchTo( const RectF &rect ); - // Alignment settings. These need to be virtual for BitmapText virtual void SetHorizAlign( float f ) { m_fHorizAlign = f; } virtual void SetVertAlign( float f ) { m_fVertAlign = f; } @@ -488,7 +555,6 @@ protected: * Use the defined constant values for best effect. */ float m_fVertAlign; - // Stuff for effects #if defined(SSC_FUTURES) // be able to stack effects vector m_Effects; @@ -515,7 +581,6 @@ protected: RageColor m_effectColor2; RageVector3 m_vEffectMagnitude; - // other properties bool m_bVisible; bool m_bIsAnimating; diff --git a/src/Background.cpp b/src/Background.cpp index 1456936d65..0d3e398506 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -165,13 +165,13 @@ void BackgroundImpl::Init() m_bInitted = true; m_bDangerAllWasVisible = false; m_StaticBackgroundDef = BackgroundDef(); - + if( !USE_STATIC_BG ) { m_StaticBackgroundDef.m_sColor1 = "#00000000"; m_StaticBackgroundDef.m_sColor2 = "#00000000"; } - + // load transitions { ASSERT( m_mapNameToTransition.empty() ); @@ -204,7 +204,7 @@ void BackgroundImpl::Init() FOREACH_HumanPlayer( p ) { bOneOrMoreChars = true; - // Disable dancing characters if BH will be showing. + // Disable dancing characters if Beginner Helper will be showing. if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() && GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner ) bShowingBeginnerHelper = true; @@ -285,10 +285,11 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun continue; } - // Look for vsFileToResolve[i] in: - // - song's dir - // - RandomMovies dir - // - BGAnimations dir. + /* Look for vsFileToResolve[i] in: + * song's dir + * RandomMovies dir + * BGAnimations dir. + */ vector vsPaths, vsThrowAway; // Look for BGAnims in the song dir @@ -403,7 +404,7 @@ BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const R bd.m_sEffect = sEffect; map::const_iterator iter = m_BGAnimations.find( bd ); - + // create the background if it's not already created if( iter == m_BGAnimations.end() ) { @@ -517,7 +518,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) m_RandomBGAnimations.push_back( bd ); } } - + /* Song backgrounds (even just background stills) can get very big; never keep them * in memory. */ RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy(); @@ -594,12 +595,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) BackgroundUtil::SortBackgroundChangesArray( layer.m_aBGChanges ); } - Layer &mainlayer = m_Layer[0]; - - /* If the first BGAnimation isn't negative, add a lead-in image showing the song - * background. */ + /* If the first BGAnimation isn't negative, add a lead-in image showing + * the song background. */ if( mainlayer.m_aBGChanges.empty() || mainlayer.m_aBGChanges.front().m_fStartBeat >= 0 ) { BackgroundChange change; @@ -636,7 +635,6 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) } } - // Look for the random file marker, and replace the segment with LoadFromRandom. for( unsigned i=0; i=0; i-- ) @@ -689,7 +686,7 @@ int BackgroundImpl::Layer::FindBGSegmentForBeat( float fBeat ) const return i; } -/* If the BG segment has changed, move focus to it. Send Update() calls. */ +/* If the BG segment has changed, move focus to it. Send Update() calls. */ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ) { ASSERT( fCurrentTime != GameState::MUSIC_SECONDS_INVALID ); @@ -702,7 +699,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus int iThrowAway; pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway ); - /* Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it. */ + // Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it. const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; // Find the BGSegment we're in @@ -711,7 +708,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus float fDeltaTime = fCurrentTime - fLastMusicSeconds; if( i != -1 && i != m_iCurBGChangeIndex ) // we're changing backgrounds { -// LOG->Trace( "old bga %d -> new bga %d (%s), %f, %f", m_iCurBGChangeIndex, i, m_aBGChanges[i].GetTextDescription().c_str(), m_aBGChanges[i].m_fStartBeat, fBeat ); + //LOG->Trace( "old bga %d -> new bga %d (%s), %f, %f", m_iCurBGChangeIndex, i, m_aBGChanges[i].GetTextDescription().c_str(), m_aBGChanges[i].m_fStartBeat, fBeat ); BackgroundChange oldChange; if( m_iCurBGChangeIndex != -1 ) @@ -739,7 +736,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( m_pFadingBGA == m_pCurrentBGA ) { m_pFadingBGA = NULL; -// LOG->Trace( "bg didn't actually change. Ignoring." ); + //LOG->Trace( "bg didn't actually change. Ignoring." ); } else { @@ -819,11 +816,11 @@ void BackgroundImpl::DrawPrimitives() if( m_pDancingCharacters ) m_pDancingCharacters->m_bDrawDangerLight = true; } - - { + + { if( m_pDancingCharacters ) m_pDancingCharacters->m_bDrawDangerLight = false; - + FOREACH_BackgroundLayer( i ) { Layer &layer = m_Layer[i]; @@ -890,8 +887,8 @@ BrightnessOverlay::BrightnessOverlay() void BrightnessOverlay::Update( float fDeltaTime ) { ActorFrame::Update( fDeltaTime ); - /* If we're actually playing, then we're past fades, etc; update the background - * brightness to follow Cover. */ + /* If we're actually playing, then we're past fades, etc; update the + * background brightness to follow Cover. */ if( !GAMESTATE->m_bGameplayLeadIn ) SetActualBrightness(); } @@ -906,7 +903,7 @@ void BrightnessOverlay::SetActualBrightness() // HACK: Always show training in full brightness if( GAMESTATE->m_pCurSong && GAMESTATE->m_pCurSong->IsTutorial() ) fBaseBGBrightness = 1.0f; - + fLeftBrightness *= fBaseBGBrightness; fRightBrightness *= fBaseBGBrightness; @@ -939,8 +936,6 @@ void BrightnessOverlay::FadeToActualBrightness() SetActualBrightness(); } - - Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); } Background::~Background() { SAFE_DELETE( m_pImpl ); } void Background::Init() { m_pImpl->Init(); } @@ -951,7 +946,6 @@ void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBr DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); } void Background::GetLoadedBackgroundChanges( vector *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); } - /* * (c) 2001-2004 Chris Danford, Ben Nordstrom * All rights reserved. diff --git a/src/Background.h b/src/Background.h index b4a4622ca3..214c4b3936 100644 --- a/src/Background.h +++ b/src/Background.h @@ -23,8 +23,8 @@ public: virtual void Unload(); void FadeToActualBrightness(); - void SetBrightness( float fBrightness ); /* overrides pref and Cover */ - + void SetBrightness( float fBrightness ); // overrides pref and Cover + DancingCharacters* GetDancingCharacters(); void GetLoadedBackgroundChanges( vector **pBackgroundChangesOut ); @@ -33,7 +33,6 @@ protected: BackgroundImpl *m_pImpl; }; - #endif /* diff --git a/src/BitmapText.cpp b/src/BitmapText.cpp index a67f670aa4..22085add32 100644 --- a/src/BitmapText.cpp +++ b/src/BitmapText.cpp @@ -13,17 +13,17 @@ REGISTER_ACTOR_CLASS( BitmapText ); -/* XXX: Changing a whole array of diffuse colors every frame (several times) is - * a waste, when we're usually setting them all to the same value. Rainbow and - * fading are annoying to optimize, but rarely used. Iterating over every - * character in Draw() is dumb. */ - /* XXX: * We need some kind of font modifier string for metrics. For example, * "valign=top;spacing = x+5,y+2" * * Better, we could go all the way, drop all of the actor-specific font aliases, * and do "font=header2;valign=top;...". */ + + /* XXX: Changing a whole array of diffuse colors every frame (several times) is + * a waste, when we're usually setting them all to the same value. Rainbow and + * fading are annoying to optimize, but rarely used. Iterating over every + * character in Draw() is dumb. */ #define NUM_RAINBOW_COLORS THEME->GetMetricI("BitmapText","NumRainbowColors") #define RAINBOW_COLOR(n) THEME->GetMetricC("BitmapText",ssprintf("RainbowColor%i", n+1)) diff --git a/src/DancingCharacters.cpp b/src/DancingCharacters.cpp index 265691d18b..ff4ba85776 100644 --- a/src/DancingCharacters.cpp +++ b/src/DancingCharacters.cpp @@ -14,6 +14,15 @@ #define DC_X( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterXP%d",choice+1)) #define DC_Y( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterYP%d",choice+1)) +/* + * TODO: + * - Metrics/Lua for lighting and camera sweeping. + * - Ability to load secondary elements i.e. stages. + * - Remove support for 2D characters (Lua can do it). + * - Cleanup! + * + * -- Colby + */ const float CAMERA_REST_DISTANCE = 32.f; const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f; @@ -34,7 +43,6 @@ const float MODEL_X_ONE_PLAYER = 0; const float MODEL_X_TWO_PLAYERS[NUM_PLAYERS] = { +8, -8 }; const float MODEL_ROTATIONY_TWO_PLAYERS[NUM_PLAYERS] = { -90, 90 }; - DancingCharacters::DancingCharacters() { m_bDrawDangerLight = false; @@ -59,28 +67,28 @@ DancingCharacters::DancingCharacters() { m_bgIdle[p].Load( sCurrentAnim ); m_bgIdle[p]->SetXY(DC_X(p),DC_Y(p)); - } + } sCurrentAnim = sCharacterDirectory + "2DMiss"; if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bgMiss[p].Load( sCurrentAnim ); m_bgMiss[p]->SetXY(DC_X(p),DC_Y(p)); - } + } sCurrentAnim = sCharacterDirectory + "2DGood"; if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bgGood[p].Load( sCurrentAnim ); m_bgGood[p]->SetXY(DC_X(p),DC_Y(p)); - } + } sCurrentAnim = sCharacterDirectory + "2DGreat"; if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bgGreat[p].Load( sCurrentAnim ); m_bgGreat[p]->SetXY(DC_X(p),DC_Y(p)); - } + } sCurrentAnim = sCharacterDirectory + "2DFever"; if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists @@ -112,12 +120,12 @@ DancingCharacters::DancingCharacters() if( pChar->GetModelPath().empty() ) continue; - + if( GAMESTATE->GetNumPlayersEnabled()==2 ) m_pCharacter[p]->SetX( MODEL_X_TWO_PLAYERS[p] ); else m_pCharacter[p]->SetX( MODEL_X_ONE_PLAYER ); - + switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_BATTLE: @@ -156,7 +164,7 @@ void DancingCharacters::LoadNextSong() ASSERT( GAMESTATE->m_pCurSong ); m_fThisCameraEndBeat = GAMESTATE->m_pCurSong->m_fFirstBeat; - + FOREACH_PlayerNumber( p ) if( GAMESTATE->IsPlayerEnabled(p) ) m_pCharacter[p]->PlayAnimation( "rest" ); @@ -168,7 +176,7 @@ void DancingCharacters::Update( float fDelta ) { if( GAMESTATE->m_bFreeze || GAMESTATE->m_bDelay ) { - // spin the camera Matrix style + // spin the camera Matrix-style m_CameraPanYStart += fDelta*40; m_CameraPanYEnd += fDelta*40; } @@ -200,7 +208,6 @@ void DancingCharacters::Update( float fDelta ) } bWasGameplayStarting = bGameplayStarting; - static float fLastBeat = GAMESTATE->m_fSongBeat; float fThisBeat = GAMESTATE->m_fSongBeat; if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat && @@ -211,7 +218,6 @@ void DancingCharacters::Update( float fDelta ) } fLastBeat = fThisBeat; - // time for a new sweep? if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat ) { @@ -221,7 +227,7 @@ void DancingCharacters::Update( float fDelta ) m_CameraDistance = CAMERA_SWEEP_DISTANCE + RandomInt(-1,1) * CAMERA_SWEEP_DISTANCE_VARIANCE; m_CameraPanYStart = m_CameraPanYEnd = RandomInt(-1,1) * CAMERA_SWEEP_PAN_Y_RANGE_DEGREES; m_fCameraHeightStart = m_fCameraHeightEnd = CAMERA_STILL_LOOK_AT_HEIGHT; - + m_CameraPanYEnd += RandomInt(-1,1) * CAMERA_SWEEP_PAN_Y_VARIANCE_DEGREES; m_fCameraHeightStart = m_fCameraHeightEnd = m_fCameraHeightStart + RandomInt(-1,1) * CAMERA_SWEEP_HEIGHT_VARIANCE; @@ -247,7 +253,8 @@ void DancingCharacters::Update( float fDelta ) m_fThisCameraStartBeat = (float) iCurBeat; m_fThisCameraEndBeat = float(iCurBeat + 8); } - + /* + // is there any of this still around? This block of code is _ugly_. -Colby // update any 2D stuff FOREACH_PlayerNumber( p ) { @@ -286,6 +293,7 @@ void DancingCharacters::Update( float fDelta ) } } } + */ } void DancingCharacters::Change2DAnimState( PlayerNumber pn, int iState ) @@ -326,6 +334,7 @@ void DancingCharacters::DrawPrimitives() bool bDanger = m_bDrawDangerLight; DISPLAY->SetLighting( true ); + RageColor ambient = bFailed ? RageColor(0.2f,0.1f,0.1f,1) : (bDanger ? RageColor(0.4f,0.1f,0.1f,1) : RageColor(0.4f,0.4f,0.4f,1)); RageColor diffuse = bFailed ? RageColor(0.4f,0.1f,0.1f,1) : (bDanger ? RageColor(0.8f,0.1f,0.1f,1) : RageColor(1,0.95f,0.925f,1)); RageColor specular = RageColor(0.8f,0.8f,0.8f,1); @@ -351,8 +360,10 @@ void DancingCharacters::DrawPrimitives() DISPLAY->SetLighting( false ); } - DISPLAY->CameraPopMatrix(); + + /* + // Ugly! -Colby // now draw any potential 2D stuff FOREACH_PlayerNumber( p ) { @@ -373,6 +384,7 @@ void DancingCharacters::DrawPrimitives() if(m_bgFail[p].IsLoaded() && m_i2DAnimState[p] == AS2D_FAIL) m_bgFail[p]->Draw(); } + */ } /* diff --git a/src/DancingCharacters.h b/src/DancingCharacters.h index 64b1fbe06b..d7d67dfc41 100644 --- a/src/DancingCharacters.h +++ b/src/DancingCharacters.h @@ -1,4 +1,3 @@ -/* DancingCharacters - Characters that react to how the players are doing. */ #ifndef DancingCharacters_H #define DancingCharacters_H @@ -9,20 +8,22 @@ #include "AutoActor.h" class Model; +/** @brief The different animation states for the dancer. */ enum ANIM_STATES_2D { - AS2D_IDLE = 0, - AS2D_MISS, - AS2D_GOOD, - AS2D_GREAT, - AS2D_FEVER, - AS2D_FAIL, - AS2D_WIN, - AS2D_WINFEVER, - AS2D_IGNORE, // special case -- so that we can timer to idle again. - AS2D_MAXSTATES // leave at end + AS2D_IDLE = 0, /**< The dancer is idle. */ + AS2D_MISS, /**< The dancer just missed a note. */ + AS2D_GOOD, /**< The dancer is doing a good job. */ + AS2D_GREAT, /**< The dancer is doing a great job. */ + AS2D_FEVER, /**< The dancer is on fire! */ + AS2D_FAIL, /**< The dancer has failed. */ + AS2D_WIN, /**< The dancer has won. */ + AS2D_WINFEVER, /**< The dancer has won while on fire. */ + AS2D_IGNORE, /**< This is a special case -- so that we can timer to idle again. */ + AS2D_MAXSTATES /**< A count of the maximum number of states. */ }; +/** @brief Characters that react to how the players are doing. */ class DancingCharacters : public ActorFrame { public: @@ -39,6 +40,7 @@ protected: Model *m_pCharacter[NUM_PLAYERS]; + /** @brief How far away is the camera from the dancer? */ float m_CameraDistance; float m_CameraPanYStart; float m_CameraPanYEnd; @@ -65,8 +67,10 @@ protected: #endif -/* - * (c) 2003-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2003-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/DualScrollBar.h b/src/DualScrollBar.h index 4ff41149c3..fd362f56cc 100644 --- a/src/DualScrollBar.h +++ b/src/DualScrollBar.h @@ -1,12 +1,10 @@ -/* DualScrollBar - a scrollbar with two independent thumbs. */ - #ifndef DUAL_SCROLLBAR_H #define DUAL_SCROLLBAR_H #include "ActorFrame.h" #include "AutoActor.h" #include "PlayerNumber.h" - +/** @brief A scrollbar with two independent thumbs. */ class DualScrollBar: public ActorFrame { public: @@ -19,6 +17,7 @@ public: void EnablePlayer( PlayerNumber pn, bool on ); private: + /** @brief The height of the scrollbar. */ float m_fBarHeight; float m_fBarTime; @@ -28,8 +27,10 @@ private: #endif -/* - * (c) 2001-2004 Glenn Maynard, Chris Danford +/** + * @file + * @author Glenn Maynard, Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/EditMenu.h b/src/EditMenu.h index 6d641cbdec..ac5d58be80 100644 --- a/src/EditMenu.h +++ b/src/EditMenu.h @@ -26,15 +26,17 @@ enum EditMenuRow const RString& EditMenuRowToString( EditMenuRow r ); const RString& EditMenuRowToLocalizedString( EditMenuRow r ); +/** @brief The different actions one can take on a step. */ enum EditMenuAction { - EditMenuAction_Edit, - EditMenuAction_Delete, - EditMenuAction_Create, - EditMenuAction_Practice, - NUM_EditMenuAction, + EditMenuAction_Edit, /**< Modify the current step for the Song. */ + EditMenuAction_Delete, /**< Remove the current step from the Song. */ + EditMenuAction_Create, /**< Create a new step for the Song. */ + EditMenuAction_Practice, /**< Practice the current step for the Song. */ + NUM_EditMenuAction, /**< The number of MenuActions available to choose from. */ EditMenuAction_Invalid }; +/** @brief Loop through each EditMenuAction. */ #define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, ema ) const RString& EditMenuActionToString( EditMenuAction ema ); const RString& EditMenuActionToLocalizedString( EditMenuAction ema ); @@ -65,7 +67,13 @@ public: void RefreshAll(); - RString GetSelectedGroup() const { if( !SHOW_GROUPS.GetValue() ) return GROUP_ALL; ASSERT(m_iSelection[ROW_GROUP] < (int)m_sGroups.size()); return m_sGroups[m_iSelection[ROW_GROUP]]; } + RString GetSelectedGroup() const + { + if( !SHOW_GROUPS.GetValue() ) return GROUP_ALL; + ASSERT_M((int)m_iSelection[ROW_GROUP] < (int)m_sGroups.size(), + ssprintf("Group selection %d < Number of groups %d", m_iSelection[ROW_GROUP], (int)m_sGroups.size())); + return m_sGroups[m_iSelection[ROW_GROUP]]; + } Song* GetSelectedSong() const { ASSERT(m_iSelection[ROW_SONG] < (int)m_pSongs.size()); return m_pSongs[m_iSelection[ROW_SONG]]; } StepsType GetSelectedStepsType() const { ASSERT(m_iSelection[ROW_STEPS_TYPE] < (int)m_StepsTypes.size()); return m_StepsTypes[m_iSelection[ROW_STEPS_TYPE]]; } Steps* GetSelectedSteps() const { ASSERT(m_iSelection[ROW_STEPS] < (int)m_vpSteps.size()); return m_vpSteps[m_iSelection[ROW_STEPS]].pSteps; } @@ -94,7 +102,9 @@ private: BitmapText m_textLabel[NUM_EditMenuRow]; BitmapText m_textValue[NUM_EditMenuRow]; + /** @brief The group's banner. */ FadingBanner m_GroupBanner; + /** @brief The Song's banner. */ FadingBanner m_SongBanner; TextBanner m_SongTextBanner; StepsDisplay m_StepsDisplay; @@ -107,7 +117,9 @@ private: Difficulty dc; }; + /** @brief The list of groups. */ vector m_sGroups; + /** @brief The list of Songs in a group. */ vector m_pSongs; vector m_StepsTypes; vector m_vpSteps; @@ -120,6 +132,7 @@ private: RageSound m_soundChangeRow; RageSound m_soundChangeValue; + /** @brief A metric to determine if groups are shown. */ ThemeMetric SHOW_GROUPS; ThemeMetric1D ARROWS_X; ThemeMetric ARROWS_ENABLED_COMMAND; @@ -132,8 +145,10 @@ public: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Foreground.cpp b/src/Foreground.cpp index c04d29cfcb..84caac9025 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -25,7 +25,7 @@ void Foreground::Unload() void Foreground::LoadFromSong( const Song *pSong ) { - /* Song graphics can get very big; never keep them in memory. */ + // Song graphics can get very big; never keep them in memory. RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy(); TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE ); @@ -58,7 +58,7 @@ void Foreground::LoadFromSong( const Song *pSong ) void Foreground::Update( float fDeltaTime ) { - /* Calls to Update() should *not* be scaled by music rate. Undo it. */ + // Calls to Update() should *not* be scaled by music rate. Undo it. const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; for( unsigned i=0; i < m_BGAnimations.size(); ++i ) @@ -67,7 +67,7 @@ void Foreground::Update( float fDeltaTime ) if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat ) { - /* The animation hasn't started yet. */ + // The animation hasn't started yet. continue; } @@ -89,14 +89,14 @@ void Foreground::Update( float fDeltaTime ) fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; } - /* This shouldn't go down, but be safe: */ + // This shouldn't go down, but be safe: fDeltaTime = max( fDeltaTime, 0 ); bga.m_bga->Update( fDeltaTime / fRate ); if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) { - /* Finished. */ + // Finished. bga.m_bga->SetVisible( false ); bga.m_bFinished = true; continue; diff --git a/src/Foreground.h b/src/Foreground.h index 40e5ec1450..96f0f0a213 100644 --- a/src/Foreground.h +++ b/src/Foreground.h @@ -1,18 +1,15 @@ -/* Foreground - Foreground in front of notes while playing. */ #ifndef FOREGROUND_H #define FOREGROUND_H #include "ActorFrame.h" class Song; - +/** @brief Foreground in front of notes while playing. */ class Foreground: public ActorFrame { public: ~Foreground(); - void Unload(); - void LoadFromSong( const Song *pSong ); virtual void Update( float fDeltaTime ); diff --git a/src/Game.h b/src/Game.h index 18279a2ecb..536bb1f4fe 100644 --- a/src/Game.h +++ b/src/Game.h @@ -1,5 +1,3 @@ -/* Game - Holds information about a particular style of a game (e.g. "single", "double"). */ - #ifndef GAMEDEF_H #define GAMEDEF_H @@ -27,21 +25,29 @@ class Style; // have the flag FLAG_SECONDARY_MENU_*, they will function as MenuLeft and // MenuRight as long as "MenuLeft (optional)" and "MenuRight (optional)" are not mapped. +/** @brief Holds information about a particular style of a game (e.g. "single", "double"). */ class Game { public: const char * m_szName; const Style * const* m_apStyles; - bool m_bCountNotesSeparately; // Count multiple notes in a row as separate notes or as one note - bool m_bAllowHopos; // allow Hammer-ons and Pull-offs? Only useful for guitar type input. + /** @brief Do we count multiple notes in a row as separate notes, or as one note? */ + bool m_bCountNotesSeparately; + /** @brief Do we allow for hammer-ons and pull-offs? + * + * This is right now only useful for guitar type input. */ + bool m_bAllowHopos; InputScheme m_InputScheme; struct PerButtonInfo { GameButtonType m_gbt; }; - // Data for each Game-specific GameButton. This starts at GAME_BUTTON_NEXT. + /** + * @brief Data for each Game-specific GameButton. + * + * This starts at GAME_BUTTON_NEXT. */ PerButtonInfo m_PerButtonInfo[NUM_GameButton]; const PerButtonInfo *GetPerButtonInfo( GameButton gb ) const; @@ -58,8 +64,10 @@ public: #endif -/* - * (c) 2001-2002 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2002 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/GameCommand.h b/src/GameCommand.h index 53affd897c..0566d9d458 100644 --- a/src/GameCommand.h +++ b/src/GameCommand.h @@ -73,7 +73,11 @@ public: SortOrder m_SortOrder; RString m_sSoundPath; // "" for no sound vector m_vsScreensToPrepare; - int m_iWeightPounds; // -1 == none specified + /** + * @brief What is the player's weight in pounds? + * + * If this value is -1, then no weight was specified. */ + int m_iWeightPounds; int m_iGoalCalories; // -1 == none specified GoalType m_GoalType; RString m_sProfileID; diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index 24fd0fc8f1..ddd6bd2e91 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -146,31 +146,31 @@ LuaDeclareType( PlayMode ); enum SortOrder { // song sorts - SORT_PREFERRED, - SORT_GROUP, - SORT_TITLE, - SORT_BPM, - SORT_POPULARITY, - SORT_TOP_GRADES, - SORT_ARTIST, - SORT_GENRE, - SORT_BEGINNER_METER, - SORT_EASY_METER, - SORT_MEDIUM_METER, - SORT_HARD_METER, - SORT_CHALLENGE_METER, - SORT_DOUBLE_EASY_METER, - SORT_DOUBLE_MEDIUM_METER, - SORT_DOUBLE_HARD_METER, - SORT_DOUBLE_CHALLENGE_METER, + SORT_PREFERRED, /**< Sort by the user's preferred settings. */ + SORT_GROUP, /**< Sort by the groups the Songs are in. */ + SORT_TITLE, /**< Sort by the Song's title. */ + SORT_BPM, /**< Sort by the Song's BPM. */ + SORT_POPULARITY, /**< Sort by how popular the Song is. */ + SORT_TOP_GRADES, /**< Sort by the highest grades earned on a Song. */ + SORT_ARTIST, /**< Sort by the name of the artist of the Song. */ + SORT_GENRE, /**< Sort by the Song's genre. */ + SORT_BEGINNER_METER, /**< Sort by the difficulty of the single beginner meter. */ + SORT_EASY_METER, /**< Sort by the difficulty of the single easy meter. */ + SORT_MEDIUM_METER, /**< Sort by the difficulty of the single medium meter. */ + SORT_HARD_METER, /**< Sort by the difficulty of the single hard meter. */ + SORT_CHALLENGE_METER, /**< Sort by the difficulty of the single challenge meter. */ + SORT_DOUBLE_EASY_METER, /**< Sort by the difficulty of the double easy meter. */ + SORT_DOUBLE_MEDIUM_METER, /**< Sort by the difficulty of the double medium meter. */ + SORT_DOUBLE_HARD_METER, /**< Sort by the difficulty of the double hard meter. */ + SORT_DOUBLE_CHALLENGE_METER, /**< Sort by the difficulty of the double challenge meter. */ // - SORT_MODE_MENU, + SORT_MODE_MENU, /**< Have access to the menu for choosing the sort. */ // course sorts - SORT_ALL_COURSES, - SORT_NONSTOP_COURSES, - SORT_ONI_COURSES, - SORT_ENDLESS_COURSES, - SORT_LENGTH, + SORT_ALL_COURSES, /**< Sort with all courses available. */ + SORT_NONSTOP_COURSES, /**< View only the nonstop courses. */ + SORT_ONI_COURSES, /**< View only the oni/survival courses. */ + SORT_ENDLESS_COURSES, /**< View only the endless courses. */ + SORT_LENGTH, /**< Sort the courses by how long they would last. */ SORT_ROULETTE, SORT_RECENT, NUM_SortOrder, @@ -409,6 +409,7 @@ enum StageResult // Battle stuff +/** @brief The number of inventory slots available for attacks. */ const int NUM_INVENTORY_SLOTS = 3; enum AttackLevel { @@ -452,13 +453,13 @@ LuaDeclareType( Premium ); /** @brief The various stage awards that can be given based on excellent play. */ enum StageAward { - StageAward_FullComboW3, - StageAward_SingleDigitW3, - StageAward_OneW3, - StageAward_FullComboW2, - StageAward_SingleDigitW2, - StageAward_OneW2, - StageAward_FullComboW1, + StageAward_FullComboW3, /**< A full great combo (or equivalent) was earned. */ + StageAward_SingleDigitW3, /**< A single digit great combo (or equivalent) was earned. */ + StageAward_OneW3, /**< Only one great (or equivalent) was earned. */ + StageAward_FullComboW2, /**< A full excellent combo (or equivalent) was earned. */ + StageAward_SingleDigitW2, /**< A single digit excellent combo (or equivalent) was earned. */ + StageAward_OneW2, /**< Only one excellent (or equivalent) was earned. */ + StageAward_FullComboW1, /**< All fantastics (or equivalent) were earned. */ StageAward_80PercentW3, StageAward_90PercentW3, StageAward_100PercentW3, @@ -623,9 +624,9 @@ const RString& StageToLocalizedString( Stage i ); /** @brief The different possibilities of earning an extra stage. */ enum EarnedExtraStage { - EarnedExtraStage_No, - EarnedExtraStage_Extra1, - EarnedExtraStage_Extra2, + EarnedExtraStage_No, /**< No extra stage was earned. */ + EarnedExtraStage_Extra1, /**< The first extra stage was earned. */ + EarnedExtraStage_Extra2, /**< The second extra stage (or encore extra stage) was earned. */ NUM_EarnedExtraStage, EarnedExtraStage_Invalid }; @@ -671,8 +672,10 @@ LuaDeclareType( CourseType ); #endif -/* - * (c) 2001-2004 Chris Danford, Chris Gomez +/** + * @file + * @author Chris Danford, Chris Gomez (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/InputFilter.cpp b/src/InputFilter.cpp index e919b0f390..a3d35d0ee2 100644 --- a/src/InputFilter.cpp +++ b/src/InputFilter.cpp @@ -423,16 +423,18 @@ void InputFilter::UpdateCursorLocation(float _fX, float _fY) class LunaInputFilter: public Luna { public: + // todo: Should the input be locked to the theme's width/height instead of + // the window's width/height? -aj static int GetMouseX( T* p, lua_State *L ){ float fX = p->GetCursorX(); - // scale input + // Scale input to the theme's dimensions fX = SCALE( fX, 0, (PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio), SCREEN_LEFT, SCREEN_RIGHT ); lua_pushnumber( L, fX ); return 1; } static int GetMouseY( T* p, lua_State *L ){ float fY = p->GetCursorY(); - // scale input + // Scale input to the theme's dimensions fY = SCALE( fY, 0, PREFSMAN->m_iDisplayHeight, SCREEN_TOP, SCREEN_BOTTOM ); lua_pushnumber( L, fY ); return 1; diff --git a/src/LuaReference.h b/src/LuaReference.h index 0cdfae5adc..4a3306bca3 100644 --- a/src/LuaReference.h +++ b/src/LuaReference.h @@ -1,5 +1,3 @@ -/* LuaReference - a self-cleaning Lua reference. */ - #ifndef LUA_REFERENCE_H #define LUA_REFERENCE_H @@ -8,7 +6,7 @@ struct lua_State; typedef lua_State Lua; - +/** @brief A self-cleaning Lua reference. */ class LuaReference { public: @@ -29,14 +27,21 @@ public: * On success, return true. On error, set to nil and return false. */ bool SetFromExpression( const RString &sExpression ); - /* Deep-copy tables, detaching this reference from any others. */ + /** @brief Deep-copy tables, detaching this reference from any others. */ void DeepCopy(); /* Push the referenced object onto the stack. If not set (or set to nil), push nil. */ virtual void PushSelf( Lua *L ) const; - /* Return true if set. (SetFromNil() counts as being set.) */ + /** + * @brief Determine if the reference is set. + * + * SetFromNil() counts as being set. + * @return true if it's set. */ bool IsSet() const; + /** + * @brief Determine if the reference is nil. + * @return true if it's nil. */ bool IsNil() const; void Unset() { Unregister(); } @@ -91,8 +96,10 @@ public: #endif -/* - * (c) 2005 Glenn Maynard, Chris Danford +/** + * @file + * @author Glenn Maynard, Chris Danford (c) 2005 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/MessageManager.cpp b/src/MessageManager.cpp index 5907cb945e..5856bf3e0c 100644 --- a/src/MessageManager.cpp +++ b/src/MessageManager.cpp @@ -81,7 +81,6 @@ static const char *MessageIDNames[] = { "LifeMeterChangedP1", "LifeMeterChangedP2", "UpdateScreenHeader", - // should these be here? -aj "LeftClick", "RightClick", "MiddleClick", diff --git a/src/MessageManager.h b/src/MessageManager.h index e00a47e378..e1101ff800 100644 --- a/src/MessageManager.h +++ b/src/MessageManager.h @@ -78,7 +78,6 @@ enum MessageID Message_LifeMeterChangedP1, Message_LifeMeterChangedP2, Message_UpdateScreenHeader, - // should these be here? -aj Message_LeftClick, Message_RightClick, Message_MiddleClick, diff --git a/src/Model.cpp b/src/Model.cpp index b285611649..df8685f404 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -65,6 +65,7 @@ void Model::Load( const RString &sFile ) #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) +// TODO: Move MS3D loading into its own class. - Colby void Model::LoadMilkshapeAscii( const RString &sPath ) { LoadPieces( sPath, sPath, sPath ); @@ -287,19 +288,18 @@ bool Model::EarlyAbortDraw() const void Model::DrawCelShaded() { - this->SetGlow(RageColor(0,0,0,1)); - this->SetDiffuseAlpha(0); - DISPLAY->SetPolygonMode( POLYGON_LINE ); - DISPLAY->SetLineWidth( 3 ); - this->SetZWrite( false ); - this->Draw(); - this->SetDiffuseAlpha(1); - this->SetGlow(RageColor(1,1,1,0)); - DISPLAY->SetPolygonMode( POLYGON_FILL ); + // TODO: use shell shader for outline. this->SetZWrite( true ); - DISPLAY->SetCelShaded( true ); + + // First pass: outline/shell +// DISPLAY->SetCelShaded(1); this->Draw(); - DISPLAY->SetCelShaded( false ); + + // Second pass: normal shading +// DISPLAY->SetCelShaded(2); +// this->Draw(); + +// DISPLAY->SetCelShaded(0) } void Model::DrawPrimitives() @@ -374,7 +374,7 @@ void Model::DrawPrimitives() } // go - DrawMesh( i ); + DrawMesh(i); // Turn off environment mapping on tex unit 0. DISPLAY->SetSphereEnvironmentMapping( TextureUnit_1, false ); diff --git a/src/MusicWheelItem.h b/src/MusicWheelItem.h index 28c07d301e..34d5f14eed 100644 --- a/src/MusicWheelItem.h +++ b/src/MusicWheelItem.h @@ -1,5 +1,3 @@ -/* MusicWheelItem - An item on the MusicWheel. */ - #ifndef MUSIC_WHEEL_ITEM_H #define MUSIC_WHEEL_ITEM_H @@ -33,7 +31,7 @@ enum MusicWheelItemType MusicWheelItemType_Invalid, }; const RString& MusicWheelItemTypeToString( MusicWheelItemType i ); - +/** @brief An item on the MusicWheel. */ class MusicWheelItem : public WheelItemBase { public: @@ -80,8 +78,10 @@ struct MusicWheelItemData : public WheelItemBaseData #endif -/* - * (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard +/** + * @file + * @author Chris Danford, Chris Gomez, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index 873f8fb00e..0ad0957959 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -8,23 +8,23 @@ struct MenuRowDef; class OptionRow; struct ConfOption; - +/** @brief How many options can be selected on this row? */ enum SelectType { - SELECT_ONE, - SELECT_MULTIPLE, - SELECT_NONE, + SELECT_ONE, /**< Only one option can be chosen on this row. */ + SELECT_MULTIPLE, /**< Multiple options can be chosen on this row. */ + SELECT_NONE, /**< No options can be chosen on this row. */ NUM_SelectType, SelectType_Invalid }; const RString& SelectTypeToString( SelectType pm ); SelectType StringToSelectType( const RString& s ); LuaDeclareType( SelectType ); - +/** @brief How many items are shown on the row? */ enum LayoutType { - LAYOUT_SHOW_ALL_IN_ROW, - LAYOUT_SHOW_ONE_IN_ROW, + LAYOUT_SHOW_ALL_IN_ROW, /**< All of the options are shown at once. */ + LAYOUT_SHOW_ONE_IN_ROW, /**< Only one option is shown at a time. */ NUM_LayoutType, LayoutType_Invalid }; @@ -32,10 +32,14 @@ const RString& LayoutTypeToString( LayoutType pm ); LayoutType StringToLayoutType( const RString& s ); LuaDeclareType( LayoutType ); +/** @brief Define the purpose of the OptionRow. */ struct OptionRowDefinition { + /** @brief the name of the option row. */ RString m_sName; + /** @brief an explanation of the row's purpose. */ RString m_sExplanationName; + /** @brief Do all players have to share one option from the row? */ bool m_bOneChoiceForAllPlayers; SelectType m_selectType; LayoutType m_layoutType; @@ -43,11 +47,29 @@ struct OptionRowDefinition set m_vEnabledForPlayers; // only players in this set may change focus to this row int m_iDefault; bool m_bExportOnChange; - bool m_bAllowThemeItems; // Should be true for dynamic strings. - bool m_bAllowThemeTitle; // Should be true for dynamic strings. - bool m_bAllowExplanation; // if false, ignores ScreenOptions::SHOW_EXPLANATIONS. Should be true for dynamic strings. + /** + * @brief Are theme items allowed here? + * + * This should be true for dynamic strings. */ + bool m_bAllowThemeItems; + /** + * @brief Are theme titles allowed here? + * + * This should be true for dynamic strings. */ + bool m_bAllowThemeTitle; + /** + * @brief Are explanations allowed for this row? + * + * If this is false, it will ignore the ScreenOptions::SHOW_EXPLANATIONS metric. + * + * This should be true for dynamic strings. */ + bool m_bAllowExplanation; bool m_bShowChoicesListOnSelect; // (currently unused) + /** + * @brief Is this option enabled for the Player? + * @param pn the Player the PlayerNumber represents. + * @return true if the option is enabled, false otherwise. */ bool IsEnabledForPlayer( PlayerNumber pn ) const { return m_vEnabledForPlayers.find(pn) != m_vEnabledForPlayers.end(); @@ -154,8 +176,10 @@ inline void VerifySelected( SelectType st, const vector &vbSelected, const #endif -/* - * (c) 2002-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2002-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/PaneDisplay.h b/src/PaneDisplay.h index 9d4c862b20..aa5fa102d3 100644 --- a/src/PaneDisplay.h +++ b/src/PaneDisplay.h @@ -1,5 +1,3 @@ -/* PaneDisplay - An Actor that displays song information. */ - #ifndef PANE_DISPLAY_H #define PANE_DISPLAY_H @@ -30,7 +28,7 @@ enum PaneCategory NUM_PaneCategory, PaneCategory_Invalid, }; - +/** @brief An Actor that displays Song information. */ class PaneDisplay: public ActorFrame { public: @@ -60,8 +58,10 @@ private: #endif -/* - * (c) 2003 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2003 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/PrefsManager.h b/src/PrefsManager.h index ebec3fb8f5..a65136fb8d 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -18,11 +18,12 @@ enum MusicWheelUsesSections NUM_MusicWheelUsesSections, MusicWheelUsesSections_Invalid }; +/** @brief The options for allowing the W1 timing. */ enum AllowW1 { - ALLOW_W1_NEVER, - ALLOW_W1_COURSES_ONLY, - ALLOW_W1_EVERYWHERE, + ALLOW_W1_NEVER, /**< The W1 timing is not used. */ + ALLOW_W1_COURSES_ONLY, /**< The W1 timing is used for courses only. */ + ALLOW_W1_EVERYWHERE, /**< The W1 timing is used for all modes. */ NUM_AllowW1, AllowW1_Invalid }; @@ -290,7 +291,8 @@ public: Preference m_sMachineName; Preference m_sCoursesToShowRanking; - Preference m_bQuirksMode; // enable quirky behavior desired by users of microsoft stepmania explorer 6.9 + /** @brief Enable some quirky behavior used by some older versions of StepMania. */ + Preference m_bQuirksMode; // Preference m_sDefaultFailType; // XXX: Fix fail bug? // Debug: @@ -335,8 +337,10 @@ extern PrefsManager* PREFSMAN; // global and accessable from anywhere in our pro #endif -/* - * (c) 2001-2004 Chris Danford, Chris Gomez +/** + * @file + * @author Chris Danford, Chris Gomez (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/RageFileDriverZip.h b/src/RageFileDriverZip.h index 5f0edd96f9..aafbcef39c 100644 --- a/src/RageFileDriverZip.h +++ b/src/RageFileDriverZip.h @@ -1,11 +1,9 @@ -/* RageFileDriverZip - A read-only file driver for ZIPs. */ - #ifndef RAGE_FILE_DRIVER_ZIP_H #define RAGE_FILE_DRIVER_ZIP_H #include "RageFileDriver.h" #include "RageThreads.h" - +/** @brief A read-only file driver for ZIPs. */ class RageFileDriverZip: public RageFileDriver { public: diff --git a/src/RageSoundReader_Merge.h b/src/RageSoundReader_Merge.h index df9fba3f15..d374ae67bd 100644 --- a/src/RageSoundReader_Merge.h +++ b/src/RageSoundReader_Merge.h @@ -1,10 +1,8 @@ -/* RageSoundReader_Merge - Chain sounds together */ - #ifndef RAGE_SOUND_READER_MERGE #define RAGE_SOUND_READER_MERGE #include "RageSoundReader.h" - +/** @brief Chain different sounds together. */ class RageSoundReader_Merge: public RageSoundReader { public: @@ -26,7 +24,9 @@ public: void AddSound( RageSoundReader *pSound ); - /* Finish adding sounds. */ + /** + * @brief Finish adding sounds. + * @param iPreferredSampleRate the sample rate for the sounds. */ void Finish( int iPreferredSampleRate ); private: @@ -44,8 +44,10 @@ private: #endif -/* - * Copyright (c) 2004-2006 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2004-2006 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/RageThreads.h b/src/RageThreads.h index 210e949c90..3de42782d1 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -1,10 +1,9 @@ -/* RageThread - Thread, mutex, semaphore and event classes. */ - #ifndef RAGE_THREADS_H #define RAGE_THREADS_H struct ThreadSlot; class RageTimer; +/** @brief Thread, mutex, semaphore, and event classes. */ class RageThread { public: @@ -49,7 +48,10 @@ private: static bool s_bIsShowingDialog; }; -/* Register a thread created outside of RageThread. This gives it a name for RageThread::GetCurrentThreadName, +/** + * @brief Register a thread created outside of RageThread. + * + * This gives it a name for RageThread::GetCurrentThreadName, * and allocates a slot for checkpoints. */ class RageThreadRegister { @@ -102,8 +104,10 @@ protected: void MarkLockedMutex(); }; -/* Lock a mutex on construction, unlock it on destruction. Helps for functions - * with more than one return path. */ +/** + * @brief Lock a mutex on construction, unlock it on destruction. + * + * Helps for functions with more than one return path. */ class LockMutex { RageMutex &mutex; @@ -119,8 +123,10 @@ public: ~LockMutex(); LockMutex(LockMutex &cpy): mutex(cpy.mutex), file(NULL), line(-1), locked_at(cpy.locked_at), locked(true) { mutex.Lock(); } - /* Unlock the mutex (before this would normally go out of scope). This can - * only be called once. */ + /** + * @brief Unlock the mutex (before this would normally go out of scope). + * + * This can only be called once. */ void Unlock(); }; @@ -168,8 +174,10 @@ private: #endif -/* - * Copyright (c) 2001-2004 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/RageUtil_FileDB.h b/src/RageUtil_FileDB.h index bf15b005a9..4a6504da89 100644 --- a/src/RageUtil_FileDB.h +++ b/src/RageUtil_FileDB.h @@ -1,5 +1,3 @@ -/* FilenameDB - A container for a file listing. */ - #ifndef RAGE_UTIL_FILEDB #define RAGE_UTIL_FILEDB @@ -54,7 +52,7 @@ struct File } }; -/* This represents a directory. */ +/** @brief This represents a directory. */ struct FileSet { set files; @@ -78,7 +76,7 @@ struct FileSet int GetFileSize( const RString &sPath ) const; int GetFileHash( const RString &sPath ) const; }; - +/** @brief A container for a file listing. */ class FilenameDB { public: @@ -141,8 +139,10 @@ public: #endif -/* - * Copyright (c) 2003-2004 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2003-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ReceptorArrow.h b/src/ReceptorArrow.h index 28df584ca6..37833b8c28 100644 --- a/src/ReceptorArrow.h +++ b/src/ReceptorArrow.h @@ -1,5 +1,3 @@ -/* ReceptorArrow - A gray arrow that "receives" the note arrows. */ - #ifndef RECEPTOR_ARROW_H #define RECEPTOR_ARROW_H @@ -9,7 +7,7 @@ #include "GameConstantsAndTypes.h" class PlayerState; - +/** @brief A gray arrow that "receives" the note arrows. */ class ReceptorArrow : public ActorFrame { public: @@ -35,8 +33,10 @@ private: #endif -/* - * (c) 2001-2004 Ben Nordstrom, Chris Danford +/** + * @file + * @author Ben Nordstrom, Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/SampleHistory.h b/src/SampleHistory.h index 2472e8328b..1674d3e848 100644 --- a/src/SampleHistory.h +++ b/src/SampleHistory.h @@ -1,8 +1,6 @@ -/* SampleHistory - Store a trailing history of values, and retrieve values with interpolation. */ - #ifndef SAMPLE_HISTORY_H #define SAMPLE_HISTORY_H - +/** @brief Store a trailing history of values, and retrieve values with interpolation. */ class SampleHistory { public: @@ -22,8 +20,10 @@ private: #endif -/* - * (c) 2006-2007 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2006-2007 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Screen.cpp b/src/Screen.cpp index e9d38f9efc..ef2d2ddf7f 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -195,7 +195,7 @@ void Screen::Input( const InputEventPlus &input ) return; // don't care } - // Always broadcast clicks -aj + // Always broadcast mouse input so themers can grab it. -aj if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_LEFT ) ) MESSAGEMAN->Broadcast( (MessageID)(Message_LeftClick) ); if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_RIGHT ) ) diff --git a/src/Screen.h b/src/Screen.h index 8b87e3afe8..1df37d1db5 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -126,14 +126,20 @@ public: RString GetPrevScreen() const; // let subclass override if they want - virtual void MenuUp( const InputEventPlus &input ) { } - virtual void MenuDown( const InputEventPlus &input ) { } - virtual void MenuLeft( const InputEventPlus &input ) { } - virtual void MenuRight( const InputEventPlus &input ) { } - virtual void MenuStart( const InputEventPlus &input ) { } - virtual void MenuSelect( const InputEventPlus &input ) { } - virtual void MenuBack( const InputEventPlus &input ) { } - virtual void MenuCoin( const InputEventPlus &input ) { } + virtual void MenuUp(const InputEventPlus &input) { } + virtual void MenuDown(const InputEventPlus &input) { } + virtual void MenuLeft(const InputEventPlus &input) { } + virtual void MenuRight(const InputEventPlus &input) { } + virtual void MenuStart(const InputEventPlus &input) { } + virtual void MenuSelect(const InputEventPlus &input) { } + virtual void MenuBack(const InputEventPlus &input) { } + virtual void MenuCoin(const InputEventPlus &input) { } + // todo? -aj + //virtual void LeftClick(const InputEventPlus &input) { } + //virtual void RightClick(const InputEventPlus &input) { } + //virtual void MiddleClick(const InputEventPlus &input) { } + //virtual void MouseWheelUp(const InputEventPlus &input) { } + //virtual void MouseWheelDown(const InputEventPlus &input) { } }; #endif diff --git a/src/ScreenEnding.h b/src/ScreenEnding.h index 7ccfcf5922..b4276f6407 100644 --- a/src/ScreenEnding.h +++ b/src/ScreenEnding.h @@ -1,12 +1,10 @@ -/* ScreenEnding - Ending screen that shows stats. */ - #ifndef SCREEN_ENDING_H #define SCREEN_ENDING_H #include "BitmapText.h" #include "ScreenAttract.h" #include "Sprite.h" - +/** @brief Ending screen that shows stats. */ class ScreenEnding : public ScreenAttract { public: @@ -20,8 +18,10 @@ private: #endif -/* - * (c) 2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 251c73aa1d..6d37d74d3a 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -1210,13 +1210,11 @@ void ScreenGameplay::LoadNextSong() if( m_pCombinedLifeMeter ) m_pCombinedLifeMeter->OnLoadSong(); - if( m_pSongForeground ) m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong ); m_fTimeSinceLastDancingComment = 0; - /* m_soundMusic and m_pSongBackground take a very long time to load, * so cap fDelta at 0 so m_NextSong will show up on screen. * -Chris */ diff --git a/src/ScreenGameplaySyncMachine.h b/src/ScreenGameplaySyncMachine.h index 9076832612..bc3b51a234 100644 --- a/src/ScreenGameplaySyncMachine.h +++ b/src/ScreenGameplaySyncMachine.h @@ -1,11 +1,9 @@ -/* ScreenGameplaySyncMachine - A gameplay screen used for syncing the machine's timing */ - #ifndef ScreenGameplaySyncMachine_H #define ScreenGameplaySyncMachine_H #include "ScreenGameplayNormal.h" #include "Song.h" - +/** @brief A gameplay screen used for syncing the machine's timing. */ class ScreenGameplaySyncMachine : public ScreenGameplayNormal { public: @@ -22,7 +20,9 @@ protected: virtual bool UseSongBackgroundAndForeground() const { return false; } void RefreshText(); + /** @brief the Song used for this screen. */ Song m_Song; + /** @brief the Steps used for this screen. */ const Steps *m_pSteps; BitmapText m_textSyncInfo; @@ -30,8 +30,10 @@ protected: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenMapControllers.cpp b/src/ScreenMapControllers.cpp index e01bc8da0b..9acafa558c 100644 --- a/src/ScreenMapControllers.cpp +++ b/src/ScreenMapControllers.cpp @@ -262,21 +262,19 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) } #endif - // - // TRICKY: Some adapters map the PlayStation digital d-pad to both axes and - // buttons. We want buttons to be used for any mappings where possible because - // presses of buttons aren't mutually exclusive and presses of axes are (e.g. - // can't read presses of both Left and Right simultaneously). So, when the user - // presses a button, we'll wait until the next Update before adding a mapping so - // that we get a chance to see all input events the user's press of a panel. - // Prefer non-axis events over axis events. - // + /* TRICKY: Some adapters map the PlayStation digital d-pad to both axes and + * buttons. We want buttons to be used for any mappings where possible + * because presses of buttons aren't mutually exclusive and presses of axes + * are (e.g. can't read presses of both Left and Right simultaneously). So, + * when the user presses a button, we'll wait until the next Update before + * adding a mapping so that we get a chance to see all input events the + * user's press of a panel. Prefer non-axis events over axis events. */ if( !m_WaitingForPress.IsZero() ) { if( input.type != IET_FIRST_PRESS ) return; - /* Don't allow function keys to be mapped. */ + // Don't allow function keys to be mapped. if( input.DeviceI.device == DEVICE_KEYBOARD && (input.DeviceI.button >= KEY_F1 && input.DeviceI.button <= KEY_F12) ) { SCREENMAN->SystemMessage( INVALID_BUTTON ); @@ -303,9 +301,8 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) { switch( button ) { - /* We only advertise space as doing this, but most games - * use either backspace or delete, and I find them more - * intuitive, so allow them, too. -gm */ + /* We only advertise space as doing this, but most games use either delete + * or backspace, and I find them more intuitive, so allow them, too. -gm */ /* XXX: For some reason that eludes me, this function gets sent an * KEY_SPACE button press every time the JOY_HAT_UP button is pressed. @@ -315,7 +312,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) case KEY_DEL: #ifndef _XBOX case KEY_SPACE: - case KEY_BACK: /* Clear the selected input mapping. */ + case KEY_BACK: // Clear the selected input mapping. #endif if( m_iCurButton == (int) m_KeysToMap.size() ) break; // on exit @@ -334,7 +331,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) INPUTMAPPER->SaveMappingsToDisk(); } break; - case KEY_LEFT: /* Move the selection left, wrapping up. */ + case KEY_LEFT: // Move the selection left, wrapping up. if( m_iCurButton == (int) m_KeysToMap.size() ) break; // on exit if( m_iCurSlot == 0 && m_iCurController == 0 ) @@ -349,7 +346,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) AfterChangeFocus(); m_soundChange.Play(); break; - case KEY_RIGHT: /* Move the selection right, wrapping down. */ + case KEY_RIGHT: // Move the selection right, wrapping down. if( m_iCurButton == (int) m_KeysToMap.size() ) break; // on exit if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == NUM_GameController-1 ) @@ -364,7 +361,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) AfterChangeFocus(); m_soundChange.Play(); break; - case KEY_UP: /* Move the selection up. */ + case KEY_UP: // Move the selection up. if( m_iCurButton == 0 ) break; // can't go up any more BeforeChangeFocus(); @@ -372,7 +369,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) AfterChangeFocus(); m_soundChange.Play(); break; - case KEY_DOWN: /* Move the selection down. */ + case KEY_DOWN: // Move the selection down. if( m_iCurButton == (int) m_KeysToMap.size() ) break; // can't go down any more BeforeChangeFocus(); @@ -380,16 +377,16 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) AfterChangeFocus(); m_soundChange.Play(); break; - case KEY_ESC: /* Quit the screen. */ + case KEY_ESC: // Quit the screen. SCREENMAN->PlayStartSound(); - StartTransitioningScreen( SM_GoToNextScreen ); + StartTransitioningScreen( SM_GoToNextScreen ); break; - case KEY_ENTER: /* Change the selection. */ + case KEY_ENTER: // Change the selection. case KEY_KP_ENTER: if( m_iCurButton == (int) m_KeysToMap.size() ) { SCREENMAN->PlayStartSound(); - StartTransitioningScreen( SM_GoToNextScreen ); + StartTransitioningScreen( SM_GoToNextScreen ); break; } @@ -436,7 +433,7 @@ void ScreenMapControllers::AfterChangeFocus() void ScreenMapControllers::Refresh() { FOREACH_ENUM( GameController, p ) - { + { for( unsigned b=0; b MAX_RANKING_NAME_LENGTH; wstring m_sSelection[NUM_PLAYERS]; @@ -38,8 +36,10 @@ public: #endif -/* - * (c) 2001-2007 Glenn Maynard, Chris Danford +/** + * @file + * @author Glenn Maynard, Chris Danford (c) 2001-2007 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenSMOnlineLogin.cpp b/src/ScreenSMOnlineLogin.cpp index bca827b014..d748d60a0d 100644 --- a/src/ScreenSMOnlineLogin.cpp +++ b/src/ScreenSMOnlineLogin.cpp @@ -116,7 +116,16 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM) else if( SM == SM_SMOnlinePack ) { LOG->Trace("[ScreenSMOnlineLogin::HandleScreenMessage] SMOnlinePack"); - sLoginQuestion = YOU_ARE_LOGGING_ON_AS.GetValue() + "\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n" + ENTER_YOUR_PASSWORD.GetValue(); + if(!GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer)) + { + LOG->Warn("Invalid player number: %i", m_iPlayer); + return; + } + + // This can cause problems in certain situations -aj + sLoginQuestion = YOU_ARE_LOGGING_ON_AS.GetValue() + "\n" + + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n" + + ENTER_YOUR_PASSWORD.GetValue(); int ResponseCode = NSMAN->m_SMOnlinePacket.Read1(); if (ResponseCode == 0) { diff --git a/src/ScreenSelect.h b/src/ScreenSelect.h index af2cb62f63..31d51af9eb 100644 --- a/src/ScreenSelect.h +++ b/src/ScreenSelect.h @@ -1,12 +1,10 @@ -/** @brief ScreenSelect - Base class for Style, Difficulty, and Mode selection screens. */ - #ifndef SCREEN_SELECT_H #define SCREEN_SELECT_H #include "ScreenWithMenuElements.h" #include "GameCommand.h" #include "ThemeMetric.h" - +/** @brief Base class for Style, Difficulty, and Mode selection screens. */ class ScreenSelect : public ScreenWithMenuElements { public: diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 3fbb770efb..ff6780ff10 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -420,8 +420,6 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) } } - // todo: use mousewheel to scroll MusicWheel -aj - // debugging? // I just like being able to see untransliterated titles occasionally. if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 ) @@ -491,6 +489,8 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) m_bStepsChosen[input.pn] ) return; // ignore + // todo: use mousewheel to scroll MusicWheel -aj + if( USE_PLAYER_SELECT_MENU ) { if( input.type == IET_RELEASE && input.MenuI == GAME_BUTTON_SELECT ) diff --git a/src/ScreenSelectMusic.h b/src/ScreenSelectMusic.h index 89ab2aec16..30939ab4b7 100644 --- a/src/ScreenSelectMusic.h +++ b/src/ScreenSelectMusic.h @@ -121,14 +121,14 @@ protected: RString m_sLoopMusicPath; RString m_sFallbackCDTitlePath; - FadingBanner m_Banner; + FadingBanner m_Banner; Sprite m_sprCDTitleFront, m_sprCDTitleBack; Sprite m_sprHighScoreFrame[NUM_PLAYERS]; BitmapText m_textHighScore[NUM_PLAYERS]; MusicWheel m_MusicWheel; OptionsList m_OptionsList[NUM_PLAYERS]; - SelectionState m_SelectionState; + SelectionState m_SelectionState; bool m_bStepsChosen[NUM_PLAYERS]; // only used in SelectionState_SelectingSteps bool m_bGoToOptions; RString m_sSampleMusicToPlay; diff --git a/src/ScreenSyncOverlay.h b/src/ScreenSyncOverlay.h index 6ddac23dc8..71e786f13a 100644 --- a/src/ScreenSyncOverlay.h +++ b/src/ScreenSyncOverlay.h @@ -1,12 +1,10 @@ -/* ScreenSyncOverlay - credits and statistics drawn on top of everything else. */ - #ifndef ScreenSyncOverlay_H #define ScreenSyncOverlay_H #include "Screen.h" #include "BitmapText.h" #include "Quad.h" - +/** @brief Credits and statistics drawn on top of everything else. */ class ScreenSyncOverlay : public Screen { public: @@ -31,8 +29,10 @@ private: #endif -/* - * (c) 2001-2005 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2005 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenTextEntry.cpp b/src/ScreenTextEntry.cpp index cf351429e9..4ff6c5856f 100644 --- a/src/ScreenTextEntry.cpp +++ b/src/ScreenTextEntry.cpp @@ -132,6 +132,7 @@ void ScreenTextEntry::Init() this->AddChild( &m_textAnswer ); m_bShowAnswerCaret = false; + //m_iCaretLocation = 0; m_sndType.Load( THEME->GetPathS(m_sName,"type"), true ); m_sndBackspace.Load( THEME->GetPathS(m_sName,"backspace"), true ); @@ -165,6 +166,8 @@ void ScreenTextEntry::UpdateAnswerText() if( g_pFormatAnswerForDisplay ) s = g_pFormatAnswerForDisplay( s ); + // Handle caret drawing + //m_iCaretLocation = s.length() if( m_bShowAnswerCaret && !bAnswerFull ) s += ANSWER_CARET; // was '_' else diff --git a/src/ScreenTextEntry.h b/src/ScreenTextEntry.h index 0bebcee94d..e5e4745389 100644 --- a/src/ScreenTextEntry.h +++ b/src/ScreenTextEntry.h @@ -121,6 +121,8 @@ private: wstring m_sAnswer; bool m_bShowAnswerCaret; + // todo: allow Left/Right to change caret location -aj + //int m_iCaretLocation; BitmapText m_textQuestion; BitmapText m_textAnswer; diff --git a/src/SnapDisplay.h b/src/SnapDisplay.h index a7918873cc..46294db024 100644 --- a/src/SnapDisplay.h +++ b/src/SnapDisplay.h @@ -1,5 +1,3 @@ -/* SnapDisplay - Graphics on ends of receptors on Edit screen that show the current snap type. */ - #ifndef SNAPDISPLAY_H #define SNAPDISPLAY_H @@ -12,7 +10,7 @@ * Convert m_sprIndicators to AutoActors * ThemeMetric for deciding to load one or two indicators? -aj */ - +/** @brief Graphics on ends of receptors on Edit screen that show the current snap type. */ class SnapDisplay : public ActorFrame { public: @@ -30,15 +28,18 @@ protected: void SnapModeChanged(); - NoteType m_NoteType; // snap to this note type + /** @brief the NoteType to snap to. */ + NoteType m_NoteType; Sprite m_sprIndicators[2]; // left and right side }; #endif -/* - * (c) 2001-2002 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2002 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Song.h b/src/Song.h index 215e583d64..7def778ee5 100644 --- a/src/Song.h +++ b/src/Song.h @@ -62,12 +62,12 @@ class Song public: void SetSongDir( const RString sDir ) { m_sSongDir = sDir; } - /** @brief When should this song should be displayed in the music wheel? */ + /** @brief When should this song be displayed in the music wheel? */ enum SelectionDisplay { SHOW_ALWAYS, /**< always show on the wheel. */ SHOW_NEVER /**< never show on the wheel (unless song hiding is turned off). */ - } m_SelectionDisplay; + } /** @brief When should this song be displayed in the music wheel? */ m_SelectionDisplay; Song(); ~Song(); @@ -141,14 +141,23 @@ public: * this will point to a generated .SSC filename. */ RString m_sSongFileName; + /** @brief The group this Song is in. */ RString m_sGroupName; ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if not loaded from a profile + /** @brief Is the song file itself a symlink to another file? */ bool m_bIsSymLink; bool m_bEnabled; - RString m_sMainTitle, m_sSubTitle, m_sArtist; - RString m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit; + /** @brief The title of the Song. */ + RString m_sMainTitle; + /** @brief The subtitle of the Song, if it exists. */ + RString m_sSubTitle; + /** @brief The artist of the Song, if it exists. */ + RString m_sArtist; + RString m_sMainTitleTranslit; + RString m_sSubTitleTranslit; + RString m_sArtistTranslit; /* If PREFSMAN->m_bShowNative is off, these are the same as GetTranslit* * below. Otherwise, they return the main titles. */ @@ -167,7 +176,7 @@ public: /** @brief The version of the song/file. */ float m_fVersion; - + /** @brief The genre of the song/file. */ RString m_sGenre; /** @@ -216,7 +225,13 @@ public: bool HasMusic() const; bool HasInstrumentTrack( InstrumentTrack it ) const; + /** + * @brief Does this song have a banner? + * @return true if it does, false otherwise. */ bool HasBanner() const; + /** + * @brief Does this song have a background? + * @return true if it does, false otherwise. */ bool HasBackground() const; //bool HasJacket() const; //bool HasCDImage() const; @@ -229,6 +244,7 @@ public: bool Matches(RString sGroup, RString sSong) const; + /** @brief The Song's TimingData. */ TimingData m_Timing; typedef vector VBackgroundChange; diff --git a/src/SoundEffectControl.h b/src/SoundEffectControl.h index 8bbd9e678f..02deb6d156 100644 --- a/src/SoundEffectControl.h +++ b/src/SoundEffectControl.h @@ -1,5 +1,3 @@ -/* SoundEffectControl - Control a sound property through user input. */ - #ifndef SOUND_EFFECT_CONTROL_H #define SOUND_EFFECT_CONTROL_H @@ -8,7 +6,7 @@ class RageSoundReader; class PlayerState; class NoteData; - +/** @brief Control a sound property through user input. */ class SoundEffectControl { public: @@ -42,8 +40,10 @@ private: #endif -/* - * (c) 2006-2007 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2006-2007 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 8e91a5e6b6..bc9837ac17 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -396,13 +396,13 @@ static void AdjustForChangedSystemCapabilities() // is this assumption outdated? -aj /* Let's consider 128-meg systems low-memory, and 256-meg systems high-memory. - * Cut off at 192. This is somewhat conservative; many 128-meg systems can + * Cut off at 192. This is pretty conservative; many 128-meg systems can * deal with higher memory profile settings, but some can't. * * Actually, Windows lops off a meg or two; cut off a little lower to treat * 192-meg systems as high-memory. */ const bool HighMemory = (Memory >= 190); - const bool LowMemory = (Memory < 100); /* 64 and 96-meg systems */ + const bool LowMemory = (Memory < 100); // 64 and 96-meg systems /* Two memory-consuming features that we can disable are texture caching and * preloaded banners. Texture caching can use a lot of memory; disable it for @@ -1306,13 +1306,13 @@ bool HandleGlobalInputs( const InputEventPlus &input ) return false; // Attract needs to know because it goes to TitleMenu on > 1 credit } - // re-added for StepMania 3.9 veterans, plus it's just plain old faster - // than the debug menu. However, this is without the LShift capability - // that was in 3.9; if we get enough requests, we'll re-add it, but meh. -aj + /* Re-added for StepMania 3.9 theming veterans, plus it's just faster than + * the debug menu. However, in sm-ssc, the Shift button only reloads the + * metrics, unlike in 3.9 (where it saved bookkeeping and machine profile). -aj */ bool bIsShiftHeld = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT), &input.InputList) || INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT), &input.InputList); bool bIsCtrlHeld = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL), &input.InputList) || - INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL), &input.InputList); + INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL), &input.InputList); if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_F2) ) { if( bIsShiftHeld && !bIsCtrlHeld ) @@ -1387,7 +1387,6 @@ bool HandleGlobalInputs( const InputEventPlus &input ) ( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_F12) && (INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LMETA), &input.InputList) || INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RMETA), &input.InputList)) ); - #else /* The default Windows message handler will capture the desktop window upon * pressing PrntScrn, or will capture the foreground with focus upon pressing @@ -1407,7 +1406,7 @@ bool HandleGlobalInputs( const InputEventPlus &input ) RageTimer timer; StepMania::SaveScreenshot( "Screenshots/", bSaveCompressed, false, -1 ); LOG->Trace( "Screenshot took %f seconds.", timer.GetDeltaTime() ); - return true; // handled + return true; // handled } if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_ENTER) && @@ -1415,11 +1414,11 @@ bool HandleGlobalInputs( const InputEventPlus &input ) INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LALT), &input.InputList)) ) { // alt-enter - /* In OS X, this is a menu item and will be handled as such. This will happen - * first and then the lower priority GUI thread will happen second causing the - * window to toggle twice. Another solution would be to put a timer in - * ArchHooks::SetToggleWindowed() and just not set the bool it if it's been less - * than, say, half a second. */ + /* In OS X, this is a menu item and will be handled as such. This will + * happen first and then the lower priority GUI thread will happen second, + * causing the window to toggle twice. Another solution would be to put + * a timer in ArchHooks::SetToggleWindowed() and just not set the bool + * it if it's been less than, say, half a second. */ #if !defined(MACOSX) ArchHooks::SetToggleWindowed(); #endif @@ -1433,10 +1432,11 @@ void HandleInputEvents(float fDeltaTime) { INPUTFILTER->Update( fDeltaTime ); - /* Hack: If the topmost screen hasn't been updated yet, don't process input, since - * we must not send inputs to a screen that hasn't at least had one update yet. (The - * first Update should be the very first thing a screen gets.) We'll process it next - * time. Do call Update above, so the inputs are read and timestamped. */ + /* Hack: If the topmost screen hasn't been updated yet, don't process input, + * since we must not send inputs to a screen that hasn't at least had one + * update yet. (The first Update should be the very first thing a screen gets.) + * We'll process it next time. Call Update above, so the inputs are + * read and timestamped. */ if( SCREENMAN->GetTopScreen()->IsFirstUpdate() ) return; diff --git a/src/Steps.cpp b/src/Steps.cpp index ff6ef6ce04..838d55704f 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -411,6 +411,7 @@ public: DEFINE_METHOD( GetStepsType, m_StepsType ) DEFINE_METHOD( GetDifficulty, GetDifficulty() ) DEFINE_METHOD( GetDescription, GetDescription() ) + DEFINE_METHOD( GetChartStyle, GetChartStyle() ) DEFINE_METHOD( GetAuthorCredit, GetCredit() ) DEFINE_METHOD( GetMeter, GetMeter() ) DEFINE_METHOD( GetFilename, GetFilename() ) @@ -439,18 +440,19 @@ public: LunaSteps() { - ADD_METHOD( GetStepsType ); - ADD_METHOD( GetDifficulty ); - ADD_METHOD( GetDescription ); ADD_METHOD( GetAuthorCredit ); - ADD_METHOD( GetMeter ); + ADD_METHOD( GetChartStyle ); + ADD_METHOD( GetDescription ); + ADD_METHOD( GetDifficulty ); ADD_METHOD( GetFilename ); - ADD_METHOD( GetRadarValues ); - ADD_METHOD( IsAutogen ); - ADD_METHOD( IsAnEdit ); - ADD_METHOD( IsAPlayerEdit ); ADD_METHOD( GetHash ); + ADD_METHOD( GetMeter ); + ADD_METHOD( GetRadarValues ); //ADD_METHOD( GetSMNoteData ); + ADD_METHOD( GetStepsType ); + ADD_METHOD( IsAnEdit ); + ADD_METHOD( IsAutogen ); + ADD_METHOD( IsAPlayerEdit ); } }; diff --git a/src/WheelNotifyIcon.h b/src/WheelNotifyIcon.h index 8a8f6608d3..63f5802922 100644 --- a/src/WheelNotifyIcon.h +++ b/src/WheelNotifyIcon.h @@ -1,10 +1,8 @@ -/* WheelNotifyIcon - A little graphic to the side of the song's text banner in the MusicWheel. */ - #ifndef WHEEL_NOTIFY_ICON_H #define WHEEL_NOTIFY_ICON_H #include "Sprite.h" - +/** @brief A little graphic to the side of the song's text banner in the MusicWheel. */ class WheelNotifyIcon : public Sprite { public: @@ -25,15 +23,29 @@ public: virtual bool EarlyAbortDraw() const; protected: - enum Icons { training=0, best1, best2, best3, edits, long_ver, marathon, empty }; + /** @brief What types of icons are available for the Song? */ + enum Icons + { + training=0, /**< This song is used for training new Players. */ + best1, /**< This is the most popular Song to play. */ + best2, /**< This is the second most popular Song to play. */ + best3, /**< This is the third most popular Song to play. */ + edits, /**< This Song has edits available. */ + long_ver, /**< This Song is a long version, and will take 2 Songs in most modes. */ + marathon, /**< This Song is a marathon version, and will take 3 Songs in most modes. */ + empty /**< There is no icon meant for this Song. */ + }; + /** @brief the list of Icons to show. */ vector m_vIconsToShow; }; #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index a96ef97a63..941bfde39d 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -377,6 +377,7 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) } break; case device.MOUSE: + // Not 100% perfect (or tested much) yet. -aj DIMOUSESTATE state; HRESULT hr = GetDeviceState(device.Device, sizeof(state), &state); @@ -411,21 +412,20 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) val = state.lY; break; case DIMOFS_Z: - neg = MOUSE_WHEELUP; pos = MOUSE_WHEELDOWN; - val = state.lZ; + { + neg = MOUSE_WHEELUP; pos = MOUSE_WHEELDOWN; + val = state.lZ; + + float l = SCALE( int(val), -120.0f, 120.0f, 0.0f, 1.0f ); + ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) ); + ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) ); + } break; default: LOG->MapLog( "unknown input", "Mouse '%s' is returning an unknown mouse offset, %i", device.m_sName.c_str(), in.ofs ); continue; } - - if( neg != DeviceButton_Invalid ) - { - float l = SCALE( int(val), 0.0f, 100.0f, 0.0f, 1.0f ); - ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) ); - ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) ); - } break; } } diff --git a/src/arch/InputHandler/InputHandler_Linux_tty.h b/src/arch/InputHandler/InputHandler_Linux_tty.h index f7a0d3964a..e08ce6f8a9 100644 --- a/src/arch/InputHandler/InputHandler_Linux_tty.h +++ b/src/arch/InputHandler/InputHandler_Linux_tty.h @@ -7,7 +7,7 @@ class InputHandler_Linux_tty: public InputHandler { int fd; static void OnCrash(int); - + public: void Update(); InputHandler_Linux_tty(); diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index 163a688766..dd8b9dc9ab 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -6,6 +6,7 @@ #include "InputFilter.h" #include "archutils/Darwin/DarwinThreadHelpers.h" #include "archutils/Darwin/KeyboardDevice.h" +#include "archutils/Darwin/MouseDevice.h" #include "archutils/Darwin/JoystickDevice.h" #include "archutils/Darwin/PumpDevice.h" @@ -63,8 +64,8 @@ int InputHandler_MacOSX_HID::Run( void *data ) } // Add an observer for the start of the run loop { - /* The function copies the information out of the structure, so the memory pointed - * to by context does not need to persist beyond the function call. */ + /* The function copies the information out of the structure, so the memory + * pointed to by context does not need to persist beyond the function call. */ CFRunLoopObserverContext context = { 0, &This->m_Sem, NULL, NULL, NULL }; CFRunLoopObserverRef o = CFRunLoopObserverCreate( kCFAllocatorDefault, kCFRunLoopEntry, false, 0, RunLoopStarted, &context); @@ -72,11 +73,13 @@ int InputHandler_MacOSX_HID::Run( void *data ) } /* Add a source for ending the run loop. This serves two purposes: - * 1. it provides a way to terminate the run loop when IH_MacOSX_HID exists, and - * 2. it ensures that CFRunLoopRun() doesn't return immediately if there are no other sources. */ + * 1. it provides a way to terminate the run loop when IH_MacOSX_HID exists, + * and 2. it ensures that CFRunLoopRun() doesn't return immediately if + * there are no other sources. */ { - /* Being a little tricky here, the perform callback takes a void* and returns nothing. - * CFRunLoopStop takes a CFRunLoopRef (a pointer) so cast the function and pass the loop ref. */ + /* Being a little tricky here, the perform callback takes a void* and + * returns nothing. CFRunLoopStop takes a CFRunLoopRef (a pointer) so + * cast the function and pass the loop ref. */ void *info = This->m_LoopRef; void (*perform)(void *) = (void (*)(void *))CFRunLoopStop; // { version, info, retain, release, copyDescription, equal, hash, schedule, cancel, perform } @@ -170,6 +173,10 @@ static HIDDevice *MakeDevice( InputDevice id ) { if( id == DEVICE_KEYBOARD ) return new KeyboardDevice; + /* + if( id == DEVICE_MOUSE ) + return new MouseDevice; + */ if( IsJoystick(id) ) return new JoystickDevice; if( IsPump(id) ) @@ -215,9 +222,12 @@ void InputHandler_MacOSX_HID::AddDevices( int usagePage, int usage, InputDevice enum_add( id, num ); m_vDevices.push_back( dev ); - - ret = IOServiceAddInterestNotification( m_NotifyPort, device, kIOGeneralInterest, - InputHandler_MacOSX_HID::DeviceChanged, this, &i ); + + ret = IOServiceAddInterestNotification( + m_NotifyPort, device, kIOGeneralInterest, + InputHandler_MacOSX_HID::DeviceChanged, + this, &i + ); if( ret == KERN_SUCCESS ) m_vIters.push_back( i ); @@ -237,6 +247,10 @@ InputHandler_MacOSX_HID::InputHandler_MacOSX_HID() : m_Sem( "Input thread starte // Add devices. LOG->Trace( "Finding keyboards" ); AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard, id ); + /* + LOG->Trace( "Finding mice" ); + AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse, id ); + */ LOG->Trace( "Finding joysticks" ); id = DEVICE_JOY1; AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick, id ); @@ -431,7 +445,7 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b } wchar_t ch = utf8_get_char( utf8InputString ); - + CFRelease( inputString ); return ch == INVALID_CHAR ? L'\0' : ch; @@ -457,7 +471,6 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b return InputHandler::DeviceButtonToChar( button, bUseCurrentKeyModifiers ); } - /* * (c) 2005, 2006 Steve Checkoway * All rights reserved. diff --git a/src/arch/Lights/LightsDriver.h b/src/arch/Lights/LightsDriver.h index 3f49ed3a20..55879568b2 100644 --- a/src/arch/Lights/LightsDriver.h +++ b/src/arch/Lights/LightsDriver.h @@ -1,5 +1,3 @@ -/* LightsDriver - Controls lights */ - #ifndef LightsDriver_H #define LightsDriver_H @@ -7,7 +5,7 @@ #include "arch/RageDriver.h" struct LightsState; - +/** @brief Controls the lights. */ class LightsDriver: public RageDriver { public: @@ -26,8 +24,10 @@ public: #endif -/* - * (c) 2003-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2003-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/arch/LoadingWindow/LoadingWindow.h b/src/arch/LoadingWindow/LoadingWindow.h index 77a0b8269d..68759b9881 100644 --- a/src/arch/LoadingWindow/LoadingWindow.h +++ b/src/arch/LoadingWindow/LoadingWindow.h @@ -1,9 +1,8 @@ -/* LoadingWindow - opens and displays the loading banner. */ - #ifndef LOADING_WINDOW_H #define LOADING_WINDOW_H struct RageSurface; +/** @brief Opens and displays the loading banner. */ class LoadingWindow { public: @@ -19,8 +18,10 @@ public: #endif -/* - * (c) 2002-2004 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2002-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/archutils/Darwin/HIDDevice.cpp b/src/archutils/Darwin/HIDDevice.cpp index 69a696286b..2c40c27616 100644 --- a/src/archutils/Darwin/HIDDevice.cpp +++ b/src/archutils/Darwin/HIDDevice.cpp @@ -11,7 +11,7 @@ HIDDevice::~HIDDevice() if( m_Queue ) { CFRunLoopSourceRef runLoopSource; - + if( m_bRunning ) { CALL( m_Queue, stop ); @@ -19,7 +19,7 @@ HIDDevice::~HIDDevice() CFRunLoopSourceInvalidate( runLoopSource ); CFRelease( runLoopSource ); } - + CALL( m_Queue, dispose ); CALL( m_Queue, Release ); } @@ -36,20 +36,20 @@ bool HIDDevice::Open( io_object_t device ) CFMutableDictionaryRef properties; kern_return_t result; CFTypeRef object; - + result = IORegistryEntryCreateCFProperties( device, &properties, kCFAllocatorDefault, kNilOptions ); if( result != KERN_SUCCESS || !properties ) { LOG->Warn( "Couldn't get properties." ); return false; } - + object = CFDictionaryGetValue( properties, CFSTR(kIOHIDProductKey) ); - + CFTypeRef vidRef = CFDictionaryGetValue( properties, CFSTR(kIOHIDVendorIDKey) ); CFTypeRef pidRef = CFDictionaryGetValue( properties, CFSTR(kIOHIDProductIDKey) ); int vid, pid; - + if( !IntValue(vidRef, vid) ) vid = 0; if( !IntValue(pidRef, pid) ) @@ -60,7 +60,7 @@ bool HIDDevice::Open( io_object_t device ) CFRelease( properties ); return false; } - + if( object && CFGetTypeID(object) == CFStringGetTypeID() ) { const char *str = CFStringGetCStringPtr( CFStringRef(object), CFStringGetSystemEncoding() ); @@ -69,7 +69,7 @@ bool HIDDevice::Open( io_object_t device ) if( m_sDescription == "" ) m_sDescription = ssprintf( "%04x:%04x", vid, pid ); LOG->Trace( "\t\tDevice description: %s", m_sDescription.c_str() ); - + object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementKey) ); if ( !object || CFGetTypeID(object) != CFArrayGetTypeID() ) { @@ -77,19 +77,19 @@ bool HIDDevice::Open( io_object_t device ) CFRelease( properties ); return false; } - + CFArrayRef logicalDevices = CFArrayRef( object ); CFRange r = { 0, CFArrayGetCount(logicalDevices) }; - + CFArrayApplyFunction( logicalDevices, r, HIDDevice::AddLogicalDevice, this ); - + CFRelease( properties ); - + // Create the interface IOCFPlugInInterface **plugInInterface; HRESULT hresult; SInt32 score; - + ret = IOCreatePlugInInterfaceForService( device, kIOHIDDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score ); if( ret != kIOReturnSuccess ) @@ -97,21 +97,21 @@ bool HIDDevice::Open( io_object_t device ) PrintIOErr( ret, "Failed to create plugin interface." ); return false; } - + // Call a method of the plugin to create the device interface CFUUIDBytes bytes = CFUUIDGetUUIDBytes( kIOHIDDeviceInterfaceID ); - + hresult = CALL( plugInInterface, QueryInterface, bytes, (void **)&m_Interface ); - + CALL( plugInInterface, Release ); - + if( hresult != S_OK ) { LOG->Warn( "Couldn't get device interface from plugin interface." ); m_Interface = NULL; return false; } - + // open the interface if( (ret = CALL(m_Interface, open, 0)) != kIOReturnSuccess ) { @@ -120,7 +120,7 @@ bool HIDDevice::Open( io_object_t device ) m_Interface = NULL; return false; } - + // alloc/create queue m_Queue = CALL( m_Interface, allocQueue ); if( !m_Queue ) @@ -128,7 +128,7 @@ bool HIDDevice::Open( io_object_t device ) LOG->Warn( "Couldn't allocate a queue." ); return false; } - + if( (ret = CALL(m_Queue, create, 0, 32)) != kIOReturnSuccess ) { PrintIOErr( ret, "Failed to create the queue." ); @@ -138,7 +138,7 @@ bool HIDDevice::Open( io_object_t device ) m_Interface = NULL; return false; } - + Open(); LOG->Trace( "\t\tDevice open" ); return true; @@ -149,32 +149,32 @@ void HIDDevice::StartQueue( CFRunLoopRef loopRef, IOHIDCallbackFunction callback CFRunLoopSourceRef runLoopSource; // This creates a run loop source. It is released in the dtor. IOReturn ret = CALL( m_Queue, createAsyncEventSource, &runLoopSource ); - + if( ret != kIOReturnSuccess ) { PrintIOErr( ret, "Failed to create async event source." ); return; } - + if( !CFRunLoopContainsSource(loopRef, runLoopSource, kCFRunLoopDefaultMode) ) CFRunLoopAddSource( loopRef, runLoopSource, kCFRunLoopDefaultMode ); - + ret = CALL( m_Queue, setEventCallout, callback, target, (void *)refCon ); - + if( ret != kIOReturnSuccess ) { PrintIOErr( ret, "Failed to set the call back." ); return; } - + // start the queue ret = CALL( m_Queue, start ); - + if( ret != kIOReturnSuccess ) { CFRunLoopSourceInvalidate( runLoopSource ); CFRelease( runLoopSource ); - + PrintIOErr( ret, "Failed to start the queue." ); return; } @@ -185,32 +185,32 @@ void HIDDevice::AddLogicalDevice( const void *value, void *context ) { if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() ) return; - + CFDictionaryRef properties = CFDictionaryRef( value ); HIDDevice *This = (HIDDevice *)context; CFTypeRef object; int usage, usagePage; - + // Get usage page object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) ); if( !IntValue(object, usagePage) ) return; - + // Get usage object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) ); if( !IntValue(object, usage) ) return; - + object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementKey) ); if( !object || CFGetTypeID(object) != CFArrayGetTypeID() ) return; - + if( !This->AddLogicalDevice(usagePage, usage) ) return; - + CFArrayRef elements = CFArrayRef( object ); CFRange r = { 0, CFArrayGetCount(elements) }; - + CFArrayApplyFunction( elements, r, HIDDevice::AddElement, This ); } @@ -218,34 +218,33 @@ void HIDDevice::AddElement( const void *value, void *context ) { if( CFGetTypeID(CFTypeRef(value)) != CFDictionaryGetTypeID() ) return; - + CFDictionaryRef properties = CFDictionaryRef( value ); HIDDevice *This = (HIDDevice *)context; CFTypeRef object; int usage, usagePage; long cookie; - + // Recursively add elements object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementKey) ); if( object && CFGetTypeID(object) == CFArrayGetTypeID() ) { CFArrayRef elements = CFArrayRef( object ); CFRange r = { 0, CFArrayGetCount(elements) }; - + CFArrayApplyFunction( elements, r, AddElement, context ); } - + // Get usage page object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsagePageKey) ); if( !IntValue(object, usagePage) ) return; - + // Get usage object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementUsageKey) ); if( !IntValue(object, usage) ) return; - - + // Get cookie object = CFDictionaryGetValue( properties, CFSTR(kIOHIDElementCookieKey) ); if( !LongValue(object, cookie) ) diff --git a/src/archutils/Darwin/HIDDevice.h b/src/archutils/Darwin/HIDDevice.h index 510d0fb03e..05c1a48166 100644 --- a/src/archutils/Darwin/HIDDevice.h +++ b/src/archutils/Darwin/HIDDevice.h @@ -55,9 +55,8 @@ namespace __gnu_cxx }; } -/* - * This is just awful, these aren't objects, treating them as such leads - * to: (*object)->function(object [, argument]...) +/* This is just awful, these aren't objects, treating them as such + * leads to: (*object)->function(object [, argument]...) * Instead, do: CALL(object, function [, argument]...) */ #define CALL(o,f,...) (*(o))->f((o), ## __VA_ARGS__) @@ -69,34 +68,26 @@ private: IOHIDQueueInterface **m_Queue; bool m_bRunning; RString m_sDescription; - + static void AddLogicalDevice( const void *value, void *context ); static void AddElement( const void *value, void *context ); - + protected: - /* - * Each physical device has zero or more logical devices. If this device allows - * a logical device of type (usagePage, usage), then allocate storage as necessary - * and return true, otherwise, return false. - */ + /* Each physical device has zero or more logical devices. If this device + * allows a logical device of type (usagePage, usage), then allocate storage + * as necessary and return true, otherwise, return false. */ virtual bool AddLogicalDevice( int usagePage, int usage ) = 0; - - /* - * If the most recently added logical device cares about the state of an element of type - * (usagePage, usage), store the cookie. - */ + + /* If the most recently added logical device cares about the state of an + * element of type (usagePage, usage), store the cookie. */ virtual void AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ) = 0; - - /* - * Add any elements to the queue by calling AddElementToQueue() with the stored cookies. - */ + + // Add any elements to the queue by calling AddElementToQueue() with the stored cookies. virtual void Open() = 0; - - /* - * Optional. Subclasses can initialize the device, if required. - */ + + // Optional. Subclasses can initialize the device, if required. virtual bool InitDevice( int vid, int pid ) { return true; } - + // This adds the element with the given cookie to the queue to be notified of state changes. inline void AddElementToQueue( IOHIDElementCookie cookie ) { @@ -104,7 +95,7 @@ protected: if( ret != KERN_SUCCESS ) LOG->Warn( "Failed to add HID element with cookie %p to queue: %u", cookie, ret ); } - + // Perform a synchronous set report on the HID interface. inline IOReturn SetReport( IOHIDReportType type, UInt32 reportID, void *buffer, UInt32 size, UInt32 timeoutMS ) { @@ -113,31 +104,27 @@ protected: public: HIDDevice(); virtual ~HIDDevice(); - + bool Open( io_object_t device ); void StartQueue( CFRunLoopRef loopRef, IOHIDCallbackFunction callback, void *target, int refCon ); inline const RString& GetDescription() const { return m_sDescription; } - - - /* - * Add button presses (or releases) to vPresses for the given cookie. More than one DeviceInput - * can be added at a time. For example, Two axes presses may be generated by a single element. - * The value of the element is passed to determine if this is a push or a release. The time - * is provided as an optimization. - */ + + /* Add button presses (or releases) to vPresses for the given cookie. More + * than one DeviceInput can be added at a time. For example, Two axes + * presses may be generated by a single element. The value of the element is + * passed to determine if this is a push or a release. The time is provided + * as an optimization. */ virtual void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const = 0; - - /* - * Returns the number of IDs assigned starting from startID. This is not meaningful for devices like - * keyboards that all share the same InputDevice id. If a particular device has multiple logical - * devices, then it must ensure that AssignIDs does not assign an ID outside of its range. Return - * -1 to indicate that the device does not share the same InputDevice and none could be assigned. - */ + + /* Returns the number of IDs assigned starting from startID. This is not + * meaningful for devices like keyboards that all share the same InputDevice + * id. If a particular device has multiple logical devices, then it must + * ensure that AssignIDs does not assign an ID outside of its range. + * Return -1 to indicate that the device does not share the same InputDevice + * and none could be assigned. */ virtual int AssignIDs( InputDevice startID ) { return 0; } - - /* - * Add a device and a description for each logical device. - */ + + //Add a device and a description for each logical device. virtual void GetDevicesAndDescriptions( vector& vDevices ) const = 0; }; diff --git a/src/archutils/Darwin/JoystickDevice.cpp b/src/archutils/Darwin/JoystickDevice.cpp index 8b8e7b97f0..86e356d1c5 100644 --- a/src/archutils/Darwin/JoystickDevice.cpp +++ b/src/archutils/Darwin/JoystickDevice.cpp @@ -16,7 +16,6 @@ Joystick::Joystick() : id( InputDevice_Invalid ), { } - bool JoystickDevice::AddLogicalDevice( int usagePage, int usage ) { if( usagePage != kHIDPage_GenericDesktop ) @@ -113,7 +112,7 @@ void JoystickDevice::AddElement( int usagePage, int usage, IOHIDElementCookie co case kHIDPage_Button: { const DeviceButton buttonID = enum_add2( JOY_BUTTON_1, usage - kHIDUsage_Button_1 ); - + if( buttonID <= JOY_BUTTON_32 ) js.mapping[cookie] = buttonID; else @@ -136,7 +135,7 @@ void JoystickDevice::Open() ADD( x_axis ); ADD( y_axis ); ADD( z_axis ); ADD( x_rot ); ADD( y_rot ); ADD( z_rot ); ADD( hat ); -#undef ADD +#undef ADD for( hash_map::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j ) AddElementToQueue( j->first ); } @@ -146,10 +145,10 @@ bool JoystickDevice::InitDevice( int vid, int pid ) { if( vid != 0x0507 || pid != 0x0011 ) return true; - // It's a Para controller so try to power it on. + // It's a Para controller, so try to power it on. uint8_t powerOn = 1; IOReturn ret = SetReport( kIOHIDReportTypeFeature, 0, &powerOn, 1, 10 ); - + if( ret ) LOG->Warn( "Failed to power on the Para controller: %#08x", ret ); return ret == kIOReturnSuccess; @@ -160,11 +159,11 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme FOREACH_CONST( Joystick, m_vSticks, i ) { const Joystick& js = *i; - + if( js.x_axis == cookie ) { float level = SCALE( value, js.x_min, js.x_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_LEFT, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_RIGHT, max(level, 0.0f), now) ); break; @@ -172,7 +171,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.y_axis == cookie ) { float level = SCALE( value, js.y_min, js.y_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_UP, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_DOWN, max(level, 0.0f), now) ); break; @@ -180,7 +179,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.z_axis == cookie ) { float level = SCALE( value, js.z_min, js.z_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_Z_UP, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_Z_DOWN, max(level, 0.0f), now) ); break; @@ -188,7 +187,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.x_rot == cookie ) { float level = SCALE( value, js.rx_min, js.rx_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_ROT_LEFT, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_ROT_RIGHT, max(level, 0.0f), now) ); break; @@ -196,7 +195,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.y_rot == cookie ) { float level = SCALE( value, js.ry_min, js.ry_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_ROT_UP, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_ROT_DOWN, max(level, 0.0f), now) ); break; @@ -204,7 +203,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.z_rot == cookie ) { float level = SCALE( value, js.rz_min, js.rz_max, -1.0f, 1.0f ); - + vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_UP, max(-level, 0.0f), now) ); vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_DOWN, max(level, 0.0f), now) ); break; @@ -212,20 +211,20 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else if( js.hat == cookie ) { float levelUp = 0.f, levelRight = 0.f, levelDown = 0.f, levelLeft = 0.f; - + value -= js.hat_min; // Probably just subtracting 0. if( js.hat_max - js.hat_min == 3 ) value *= 2; switch( value ) { - case 0: levelUp = 1.f; break; // U + case 0: levelUp = 1.f; break; // U case 1: levelUp = 1.f; levelRight = 1.f; break; // UR - case 2: levelRight = 1.f; break; // R + case 2: levelRight = 1.f; break; // R case 3: levelDown = 1.f; levelRight = 1.f; break; // DR - case 4: levelDown = 1.f; break; // D + case 4: levelDown = 1.f; break; // D case 5: levelDown = 1.f; levelLeft = 1.f; break; // DL - case 6: levelLeft = 1.f; break; // L - case 7: levelUp = 1.f; levelLeft = 1.f; break; // UL + case 6: levelLeft = 1.f; break; // L + case 7: levelUp = 1.f; levelLeft = 1.f; break; // UL } vPresses.push_back( DeviceInput(js.id, JOY_HAT_UP, levelUp, now) ); vPresses.push_back( DeviceInput(js.id, JOY_HAT_RIGHT, levelRight, now) ); @@ -237,7 +236,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme { // hash_map::operator[] is not const hash_map::const_iterator iter; - + iter = js.mapping.find( cookie ); if( iter != js.mapping.end() ) { diff --git a/src/archutils/Darwin/JoystickDevice.h b/src/archutils/Darwin/JoystickDevice.h index 108791262d..ae5de046ce 100644 --- a/src/archutils/Darwin/JoystickDevice.h +++ b/src/archutils/Darwin/JoystickDevice.h @@ -16,7 +16,7 @@ struct Joystick int ry_min, ry_max; int rz_min, rz_max; int hat_min, hat_max; - + Joystick(); }; @@ -24,20 +24,19 @@ class JoystickDevice : public HIDDevice { private: vector m_vSticks; - + protected: bool AddLogicalDevice( int usagePage, int usage ); void AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ); void Open(); bool InitDevice( int vid, int pid ); - + public: void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; int AssignIDs( InputDevice startID ); void GetDevicesAndDescriptions( vector& vDevices ) const; }; - #endif /* diff --git a/src/archutils/Darwin/KeyboardDevice.cpp b/src/archutils/Darwin/KeyboardDevice.cpp index 6978b9b9d1..5066438589 100644 --- a/src/archutils/Darwin/KeyboardDevice.cpp +++ b/src/archutils/Darwin/KeyboardDevice.cpp @@ -11,75 +11,75 @@ bool KeyboardDevice::AddLogicalDevice( int usagePage, int usage ) static bool UsbKeyToDeviceButton( UInt8 iUsbKey, DeviceButton &buttonOut ) { UInt8 usage = iUsbKey; - + if( usage < kHIDUsage_KeyboardA ) return false; - + if( usage <= kHIDUsage_KeyboardZ ) { buttonOut = enum_add2( KEY_Ca, usage - kHIDUsage_KeyboardA ); return true; } - + // KEY_C0 = KEY_C1 - 1, kHIDUsage_Keyboard0 = kHIDUsage_Keyboard9 + 1 if( usage <= kHIDUsage_Keyboard9 ) { buttonOut = enum_add2( KEY_C1, usage - kHIDUsage_Keyboard1 ); return true; } - + if( usage >= kHIDUsage_KeyboardF1 && usage <= kHIDUsage_KeyboardF12 ) { buttonOut = enum_add2( KEY_F1, usage - kHIDUsage_KeyboardF1 ); return true; } - + if( usage >= kHIDUsage_KeyboardF13 && usage <= kHIDUsage_KeyboardF16 ) { buttonOut = enum_add2( KEY_F13, usage - kHIDUsage_KeyboardF13 ); return true; } - + // keypad 0 is again backward if( usage >= kHIDUsage_Keypad1 && usage <= kHIDUsage_Keypad9 ) { buttonOut = enum_add2( KEY_KP_C1, usage - kHIDUsage_Keypad1 ); return true; } - + #define OTHER(n) (enum_add2(KEY_OTHER_0, (n))) - + // [0, 8] if( usage >= kHIDUsage_KeyboardF17 && usage <= kHIDUsage_KeyboardExecute ) { buttonOut = OTHER( 0 + usage - kHIDUsage_KeyboardF17 ); return true; } - + // [9, 19] if( usage >= kHIDUsage_KeyboardSelect && usage <= kHIDUsage_KeyboardVolumeDown ) { buttonOut = OTHER( 9 + usage - kHIDUsage_KeyboardSelect ); return true; } - + // [20, 41] if( usage >= kHIDUsage_KeypadEqualSignAS400 && usage <= kHIDUsage_KeyboardCancel ) { buttonOut = OTHER( 20 + usage - kHIDUsage_KeypadEqualSignAS400 ); return true; } - - // [42, 47] + + // [42, 47] // XXX kHIDUsage_KeyboardClearOrAgain if( usage >= kHIDUsage_KeyboardSeparator && usage <= kHIDUsage_KeyboardExSel ) { buttonOut = OTHER( 32 + usage - kHIDUsage_KeyboardSeparator ); return true; } - + #define X(x,y) case x: buttonOut = y; return true - + // Time for the special cases switch( usage ) { @@ -146,7 +146,7 @@ static bool UsbKeyToDeviceButton( UInt8 iUsbKey, DeviceButton &buttonOut ) } #undef X #undef OTHER - + return false; } @@ -154,7 +154,7 @@ void KeyboardDevice::AddElement( int usagePage, int usage, IOHIDElementCookie co { if( usagePage != kHIDPage_KeyboardOrKeypad ) return; - + DeviceButton button; if( UsbKeyToDeviceButton(usage,button) ) m_Mapping[cookie] = button; @@ -172,14 +172,14 @@ void KeyboardDevice::Open() void KeyboardDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const { hash_map::const_iterator iter = m_Mapping.find( cookie ); - + if( iter != m_Mapping.end() ) { //LOG->Trace( "Pushed %s", DeviceButtonToString(iter->second).c_str() ); vPresses.push_back( DeviceInput(DEVICE_KEYBOARD, iter->second, value, now) ); } } - + void KeyboardDevice::GetDevicesAndDescriptions( vector& vDevices ) const { if( vDevices.size() && vDevices[0].id == DEVICE_KEYBOARD ) @@ -187,283 +187,282 @@ void KeyboardDevice::GetDevicesAndDescriptions( vector& vDevice vDevices.insert( vDevices.begin(), InputDeviceInfo(DEVICE_KEYBOARD, "Keyboard") ); } - // http://lists.apple.com/archives/carbon-dev/2005/Feb/msg00071.html // index represents USB keyboard usage value, content is Mac virtual keycode -static UInt8 g_iUsbKeyToMacVirtualKey[256] = -{ - 0xFF, /* 00 no event */ - 0xFF, /* 01 ErrorRollOver */ - 0xFF, /* 02 POSTFail */ - 0xFF, /* 03 ErrorUndefined */ - 0x00, /* 04 A */ - 0x0B, /* 05 B */ - 0x08, /* 06 C */ - 0x02, /* 07 D */ - 0x0E, /* 08 E */ - 0x03, /* 09 F */ - 0x05, /* 0A G */ - 0x04, /* 0B H */ - 0x22, /* 0C I */ - 0x26, /* 0D J */ - 0x28, /* 0E K */ - 0x25, /* 0F L */ +static UInt8 g_iUsbKeyToMacVirtualKey[256] = +{ + 0xFF, // 00 no event + 0xFF, // 01 ErrorRollOver + 0xFF, // 02 POSTFail + 0xFF, // 03 ErrorUndefined + 0x00, // 04 A + 0x0B, // 05 B + 0x08, // 06 C + 0x02, // 07 D + 0x0E, // 08 E + 0x03, // 09 F + 0x05, // 0A G + 0x04, // 0B H + 0x22, // 0C I + 0x26, // 0D J + 0x28, // 0E K + 0x25, // 0F L - 0x2E, /* 10 M */ - 0x2D, /* 11 N */ - 0x1F, /* 12 O */ - 0x23, /* 13 P */ - 0x0C, /* 14 Q */ - 0x0F, /* 15 R */ - 0x01, /* 16 S */ - 0x11, /* 17 T */ - 0x20, /* 18 U */ - 0x09, /* 19 V */ - 0x0D, /* 1A W */ - 0x07, /* 1B X */ - 0x10, /* 1C Y */ - 0x06, /* 1D Z */ - 0x12, /* 1E 1/! */ - 0x13, /* 1F 2/@ */ + 0x2E, // 10 M + 0x2D, // 11 N + 0x1F, // 12 O + 0x23, // 13 P + 0x0C, // 14 Q + 0x0F, // 15 R + 0x01, // 16 S + 0x11, // 17 T + 0x20, // 18 U + 0x09, // 19 V + 0x0D, // 1A W + 0x07, // 1B X + 0x10, // 1C Y + 0x06, // 1D Z + 0x12, // 1E 1/! + 0x13, // 1F 2/@ - 0x14, /* 20 3 # */ - 0x15, /* 21 4 $ */ - 0x17, /* 22 5 % */ - 0x16, /* 23 6 ^ */ - 0x1A, /* 24 7 & */ - 0x1C, /* 25 8 * */ - 0x19, /* 26 9 ( */ - 0x1D, /* 27 0 ) */ - 0x24, /* 28 Return (Enter) */ - 0x35, /* 29 ESC */ - 0x33, /* 2A Delete (Backspace) */ - 0x30, /* 2B Tab */ - 0x31, /* 2C Spacebar */ - 0x1B, /* 2D - _ */ - 0x18, /* 2E = + */ - 0x21, /* 2F [ { */ + 0x14, // 20 3 # + 0x15, // 21 4 $ + 0x17, // 22 5 % + 0x16, // 23 6 ^ + 0x1A, // 24 7 & + 0x1C, // 25 8 * + 0x19, // 26 9 ( + 0x1D, // 27 0 ) + 0x24, // 28 Return (Enter) + 0x35, // 29 ESC + 0x33, // 2A Delete (Backspace) + 0x30, // 2B Tab + 0x31, // 2C Spacebar + 0x1B, // 2D - _ + 0x18, // 2E = + + 0x21, // 2F [ { - 0x1E, /* 30 ] } */ - 0x2A, /* 31 \ | */ - 0xFF, /* 32 Non-US # and ~ (what?!!!) */ - 0x29, /* 33 ; : */ - 0x27, /* 34 ' " */ - 0x32, /* 35 ` ~ */ - 0x2B, /* 36 , < */ - 0x2F, /* 37 . > */ - 0x2C, /* 38 / ? */ - 0x39, /* 39 Caps Lock */ - 0x7A, /* 3A F1 */ - 0x78, /* 3B F2 */ - 0x63, /* 3C F3 */ - 0x76, /* 3D F4 */ - 0x60, /* 3E F5 */ - 0x61, /* 3F F6 */ + 0x1E, // 30 ] } + 0x2A, // 31 \ | + 0xFF, // 32 Non-US # and ~ (what?!!!) + 0x29, // 33 ; : + 0x27, // 34 ' " + 0x32, // 35 ` ~ + 0x2B, // 36 , < + 0x2F, // 37 . > + 0x2C, // 38 / ? + 0x39, // 39 Caps Lock + 0x7A, // 3A F1 + 0x78, // 3B F2 + 0x63, // 3C F3 + 0x76, // 3D F4 + 0x60, // 3E F5 + 0x61, // 3F F6 - 0x62, /* 40 F7 */ - 0x64, /* 41 F8 */ - 0x65, /* 42 F9 */ - 0x6D, /* 43 F10 */ - 0x67, /* 44 F11 */ - 0x6F, /* 45 F12 */ - 0x69, /* 46 F13/PrintScreen */ - 0x6B, /* 47 F14/ScrollLock */ - 0x71, /* 48 F15/Pause */ - 0x72, /* 49 Insert */ - 0x73, /* 4A Home */ - 0x74, /* 4B PageUp */ - 0x75, /* 4C Delete Forward */ - 0x77, /* 4D End */ - 0x79, /* 4E PageDown */ - 0x7C, /* 4F RightArrow */ + 0x62, // 40 F7 + 0x64, // 41 F8 + 0x65, // 42 F9 + 0x6D, // 43 F10 + 0x67, // 44 F11 + 0x6F, // 45 F12 + 0x69, // 46 F13/PrintScreen + 0x6B, // 47 F14/ScrollLock + 0x71, // 48 F15/Pause + 0x72, // 49 Insert + 0x73, // 4A Home + 0x74, // 4B PageUp + 0x75, // 4C Delete Forward + 0x77, // 4D End + 0x79, // 4E PageDown + 0x7C, // 4F RightArrow - 0x7B, /* 50 LeftArrow */ - 0x7D, /* 51 DownArrow */ - 0x7E, /* 52 UpArrow */ - 0x47, /* 53 NumLock/Clear */ - 0x4B, /* 54 Keypad / */ - 0x43, /* 55 Keypad * */ - 0x4E, /* 56 Keypad - */ - 0x45, /* 57 Keypad + */ - 0x4C, /* 58 Keypad Enter */ - 0x53, /* 59 Keypad 1 */ - 0x54, /* 5A Keypad 2 */ - 0x55, /* 5B Keypad 3 */ - 0x56, /* 5C Keypad 4 */ - 0x57, /* 5D Keypad 5 */ - 0x58, /* 5E Keypad 6 */ - 0x59, /* 5F Keypad 7 */ + 0x7B, // 50 LeftArrow + 0x7D, // 51 DownArrow + 0x7E, // 52 UpArrow + 0x47, // 53 NumLock/Clear + 0x4B, // 54 Keypad / + 0x43, // 55 Keypad * + 0x4E, // 56 Keypad - + 0x45, // 57 Keypad + + 0x4C, // 58 Keypad Enter + 0x53, // 59 Keypad 1 + 0x54, // 5A Keypad 2 + 0x55, // 5B Keypad 3 + 0x56, // 5C Keypad 4 + 0x57, // 5D Keypad 5 + 0x58, // 5E Keypad 6 + 0x59, // 5F Keypad 7 - 0x5B, /* 60 Keypad 8 */ - 0x5C, /* 61 Keypad 9 */ - 0x52, /* 62 Keypad 0 */ - 0x41, /* 63 Keypad . */ - 0xFF, /* 64 Non-US \ and | (what ??!!) */ - 0x6E, /* 65 ApplicationKey (not on a mac!)*/ - 0x7F, /* 66 PowerKey */ - 0x51, /* 67 Keypad = */ - 0x69, /* 68 F13 */ - 0x6B, /* 69 F14 */ - 0x71, /* 6A F15 */ - 0xFF, /* 6B F16 */ - 0xFF, /* 6C F17 */ - 0xFF, /* 6D F18 */ - 0xFF, /* 6E F19 */ - 0xFF, /* 6F F20 */ + 0x5B, // 60 Keypad 8 + 0x5C, // 61 Keypad 9 + 0x52, // 62 Keypad 0 + 0x41, // 63 Keypad . + 0xFF, // 64 Non-US \ and | (what ??!!) + 0x6E, // 65 ApplicationKey (not on Apple keyboards) + 0x7F, // 66 PowerKey + 0x51, // 67 Keypad = + 0x69, // 68 F13 + 0x6B, // 69 F14 + 0x71, // 6A F15 + 0xFF, // 6B F16 + 0xFF, // 6C F17 + 0xFF, // 6D F18 + 0xFF, // 6E F19 + 0xFF, // 6F F20 - 0x5B, /* 70 F21 */ - 0x5C, /* 71 F22 */ - 0x52, /* 72 F23 */ - 0x41, /* 73 F24 */ - 0xFF, /* 74 Execute */ - 0xFF, /* 75 Help */ - 0x7F, /* 76 Menu */ - 0x4C, /* 77 Select */ - 0x69, /* 78 Stop */ - 0x6B, /* 79 Again */ - 0x71, /* 7A Undo */ - 0xFF, /* 7B Cut */ - 0xFF, /* 7C Copy */ - 0xFF, /* 7D Paste */ - 0xFF, /* 7E Find */ - 0xFF, /* 7F Mute */ - - 0xFF, /* 80 no event */ - 0xFF, /* 81 no event */ - 0xFF, /* 82 no event */ - 0xFF, /* 83 no event */ - 0xFF, /* 84 no event */ - 0xFF, /* 85 no event */ - 0xFF, /* 86 no event */ - 0xFF, /* 87 no event */ - 0xFF, /* 88 no event */ - 0xFF, /* 89 no event */ - 0xFF, /* 8A no event */ - 0xFF, /* 8B no event */ - 0xFF, /* 8C no event */ - 0xFF, /* 8D no event */ - 0xFF, /* 8E no event */ - 0xFF, /* 8F no event */ + 0x5B, // 70 F21 + 0x5C, // 71 F22 + 0x52, // 72 F23 + 0x41, // 73 F24 + 0xFF, // 74 Execute + 0xFF, // 75 Help + 0x7F, // 76 Menu + 0x4C, // 77 Select + 0x69, // 78 Stop + 0x6B, // 79 Again + 0x71, // 7A Undo + 0xFF, // 7B Cut + 0xFF, // 7C Copy + 0xFF, // 7D Paste + 0xFF, // 7E Find + 0xFF, // 7F Mute - 0xFF, /* 90 no event */ - 0xFF, /* 91 no event */ - 0xFF, /* 92 no event */ - 0xFF, /* 93 no event */ - 0xFF, /* 94 no event */ - 0xFF, /* 95 no event */ - 0xFF, /* 96 no event */ - 0xFF, /* 97 no event */ - 0xFF, /* 98 no event */ - 0xFF, /* 99 no event */ - 0xFF, /* 9A no event */ - 0xFF, /* 9B no event */ - 0xFF, /* 9C no event */ - 0xFF, /* 9D no event */ - 0xFF, /* 9E no event */ - 0xFF, /* 9F no event */ + 0xFF, // 80 no event + 0xFF, // 81 no event + 0xFF, // 82 no event + 0xFF, // 83 no event + 0xFF, // 84 no event + 0xFF, // 85 no event + 0xFF, // 86 no event + 0xFF, // 87 no event + 0xFF, // 88 no event + 0xFF, // 89 no event + 0xFF, // 8A no event + 0xFF, // 8B no event + 0xFF, // 8C no event + 0xFF, // 8D no event + 0xFF, // 8E no event + 0xFF, // 8F no event - 0xFF, /* A0 no event */ - 0xFF, /* A1 no event */ - 0xFF, /* A2 no event */ - 0xFF, /* A3 no event */ - 0xFF, /* A4 no event */ - 0xFF, /* A5 no event */ - 0xFF, /* A6 no event */ - 0xFF, /* A7 no event */ - 0xFF, /* A8 no event */ - 0xFF, /* A9 no event */ - 0xFF, /* AA no event */ - 0xFF, /* AB no event */ - 0xFF, /* AC no event */ - 0xFF, /* AD no event */ - 0xFF, /* AE no event */ - 0xFF, /* AF no event */ + 0xFF, // 90 no event + 0xFF, // 91 no event + 0xFF, // 92 no event + 0xFF, // 93 no event + 0xFF, // 94 no event + 0xFF, // 95 no event + 0xFF, // 96 no event + 0xFF, // 97 no event + 0xFF, // 98 no event + 0xFF, // 99 no event + 0xFF, // 9A no event + 0xFF, // 9B no event + 0xFF, // 9C no event + 0xFF, // 9D no event + 0xFF, // 9E no event + 0xFF, // 9F no event - 0xFF, /* B0 no event */ - 0xFF, /* B1 no event */ - 0xFF, /* B2 no event */ - 0xFF, /* B3 no event */ - 0xFF, /* B4 no event */ - 0xFF, /* B5 no event */ - 0xFF, /* B6 no event */ - 0xFF, /* B7 no event */ - 0xFF, /* B8 no event */ - 0xFF, /* B9 no event */ - 0xFF, /* BA no event */ - 0xFF, /* BB no event */ - 0xFF, /* BC no event */ - 0xFF, /* BD no event */ - 0xFF, /* BE no event */ - 0xFF, /* BF no event */ + 0xFF, // A0 no event + 0xFF, // A1 no event + 0xFF, // A2 no event + 0xFF, // A3 no event + 0xFF, // A4 no event + 0xFF, // A5 no event + 0xFF, // A6 no event + 0xFF, // A7 no event + 0xFF, // A8 no event + 0xFF, // A9 no event + 0xFF, // AA no event + 0xFF, // AB no event + 0xFF, // AC no event + 0xFF, // AD no event + 0xFF, // AE no event + 0xFF, // AF no event - 0xFF, /* C0 no event */ - 0xFF, /* C1 no event */ - 0xFF, /* C2 no event */ - 0xFF, /* C3 no event */ - 0xFF, /* C4 no event */ - 0xFF, /* C5 no event */ - 0xFF, /* C6 no event */ - 0xFF, /* C7 no event */ - 0xFF, /* C8 no event */ - 0xFF, /* C9 no event */ - 0xFF, /* CA no event */ - 0xFF, /* CB no event */ - 0xFF, /* CC no event */ - 0xFF, /* CD no event */ - 0xFF, /* CE no event */ - 0xFF, /* CF no event */ + 0xFF, // B0 no event + 0xFF, // B1 no event + 0xFF, // B2 no event + 0xFF, // B3 no event + 0xFF, // B4 no event + 0xFF, // B5 no event + 0xFF, // B6 no event + 0xFF, // B7 no event + 0xFF, // B8 no event + 0xFF, // B9 no event + 0xFF, // BA no event + 0xFF, // BB no event + 0xFF, // BC no event + 0xFF, // BD no event + 0xFF, // BE no event + 0xFF, // BF no event - 0xFF, /* D0 no event */ - 0xFF, /* D1 no event */ - 0xFF, /* D2 no event */ - 0xFF, /* D3 no event */ - 0xFF, /* D4 no event */ - 0xFF, /* D5 no event */ - 0xFF, /* D6 no event */ - 0xFF, /* D7 no event */ - 0xFF, /* D8 no event */ - 0xFF, /* D9 no event */ - 0xFF, /* DA no event */ - 0xFF, /* DB no event */ - 0xFF, /* DC no event */ - 0xFF, /* DD no event */ - 0xFF, /* DE no event */ - 0xFF, /* DF no event */ + 0xFF, // C0 no event + 0xFF, // C1 no event + 0xFF, // C2 no event + 0xFF, // C3 no event + 0xFF, // C4 no event + 0xFF, // C5 no event + 0xFF, // C6 no event + 0xFF, // C7 no event + 0xFF, // C8 no event + 0xFF, // C9 no event + 0xFF, // CA no event + 0xFF, // CB no event + 0xFF, // CC no event + 0xFF, // CD no event + 0xFF, // CE no event + 0xFF, // CF no event - 0x3B, /* E0 left control key */ - 0x38, /* E1 left shift key key */ - 0x3A, /* E2 left alt/option key */ - 0x37, /* E3 left GUI (windows/cmd) key */ - - 0x3B, /* E4 right control key */ - 0x38, /* E5 right shift key key */ - 0x3A, /* E6 right alt/option key */ - 0x37, /* E7 right GUI (windows/cmd) key */ - 0xFF, /* E8 no event */ - 0xFF, /* E9 no event */ - 0xFF, /* EA no event */ - 0xFF, /* EB no event */ - 0xFF, /* EC no event */ - 0xFF, /* ED no event */ - 0xFF, /* EE no event */ - 0xFF, /* EF no event */ - - 0xFF, /* F0 no event */ - 0xFF, /* F1 no event */ - 0xFF, /* F2 no event */ - 0xFF, /* F3 no event */ - 0xFF, /* F4 no event */ - 0xFF, /* F5 no event */ - 0xFF, /* F6 no event */ - 0xFF, /* F7 no event */ - 0xFF, /* F8 no event */ - 0xFF, /* F9 no event */ - 0xFF, /* FA no event */ - 0xFF, /* FB no event */ - 0xFF, /* FC no event */ - 0xFF, /* FD no event */ - 0xFF, /* FE no event */ - 0xFF, /* FF no event */ + 0xFF, // D0 no event + 0xFF, // D1 no event + 0xFF, // D2 no event + 0xFF, // D3 no event + 0xFF, // D4 no event + 0xFF, // D5 no event + 0xFF, // D6 no event + 0xFF, // D7 no event + 0xFF, // D8 no event + 0xFF, // D9 no event + 0xFF, // DA no event + 0xFF, // DB no event + 0xFF, // DC no event + 0xFF, // DD no event + 0xFF, // DE no event + 0xFF, // DF no event + + 0x3B, // E0 left control key + 0x38, // E1 left shift key key + 0x3A, // E2 left alt/option key + 0x37, // E3 left GUI (windows/cmd) key + + 0x3B, // E4 right control key + 0x38, // E5 right shift key key + 0x3A, // E6 right alt/option key + 0x37, // E7 right GUI (windows/cmd) key + 0xFF, // E8 no event + 0xFF, // E9 no event + 0xFF, // EA no event + 0xFF, // EB no event + 0xFF, // EC no event + 0xFF, // ED no event + 0xFF, // EE no event + 0xFF, // EF no event + + 0xFF, // F0 no event + 0xFF, // F1 no event + 0xFF, // F2 no event + 0xFF, // F3 no event + 0xFF, // F4 no event + 0xFF, // F5 no event + 0xFF, // F6 no event + 0xFF, // F7 no event + 0xFF, // F8 no event + 0xFF, // F9 no event + 0xFF, // FA no event + 0xFF, // FB no event + 0xFF, // FC no event + 0xFF, // FD no event + 0xFF, // FE no event + 0xFF, // FF no event }; static UInt8 g_iDeviceButtonToMacVirtualKey[KEY_OTHER_0]; @@ -471,7 +470,7 @@ static UInt8 g_iDeviceButtonToMacVirtualKey[KEY_OTHER_0]; bool KeyboardDevice::DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iMacVKOut ) { static bool bInited = false; - + if( !bInited ) { memset( g_iDeviceButtonToMacVirtualKey, 0xFF, sizeof(g_iDeviceButtonToMacVirtualKey) ); @@ -487,11 +486,11 @@ bool KeyboardDevice::DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iM return iMacVKOut != 0xFF; } - + /* * (c) 2005-2006 Steve Checkoway * All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -501,7 +500,7 @@ bool KeyboardDevice::DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iM * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF diff --git a/src/archutils/Darwin/KeyboardDevice.h b/src/archutils/Darwin/KeyboardDevice.h index 1c2a71f64e..d5c4d561b2 100644 --- a/src/archutils/Darwin/KeyboardDevice.h +++ b/src/archutils/Darwin/KeyboardDevice.h @@ -7,7 +7,7 @@ class KeyboardDevice : public HIDDevice { private: __gnu_cxx::hash_map m_Mapping; - + protected: bool AddLogicalDevice( int usagePage, int usage ); void AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ); @@ -16,11 +16,10 @@ protected: public: void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; void GetDevicesAndDescriptions( vector& vDevices ) const; - + static bool DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iMacVKOut ); }; - #endif /* diff --git a/src/archutils/Darwin/MouseDevice.cpp b/src/archutils/Darwin/MouseDevice.cpp new file mode 100644 index 0000000000..7980771389 --- /dev/null +++ b/src/archutils/Darwin/MouseDevice.cpp @@ -0,0 +1,130 @@ +#include "global.h" +#include "MouseDevice.h" + +using __gnu_cxx::hash_map; + +Mouse::Mouse() : id( InputDevice_Invalid ), + x_axis( 0 ), x_min( 0 ), x_max( 0 ), + y_axis( 0 ), y_min( 0 ), y_max( 0 ), + z_axis( 0 ), z_min( 0 ), z_max( 0 ) +{ +} + +bool MouseDevice::AddLogicalDevice( int usagePage, int usage ) +{ + if( usagePage != kHIDPage_GenericDesktop ) + return false; + + switch( usage ) + { + // Mice can either be kHIDUsage_GD_Mouse or kHIDUsage_GD_Pointer... + // Let's just go with kHIDUsage_GD_Mouse for now. -aj + case kHIDUsage_GD_Mouse: + //case kHIDUsage_GD_Pointer: + break; + default: + return false; + } + // Init only a single mouse for now. + m_Mouse = Mouse(); + return true; +} + +void MouseDevice::AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ) +{ + if( usagePage >= kHIDPage_VendorDefinedStart ) + return; + + Mouse& m = m_Mouse; + + switch( usagePage ) + { + case kHIDPage_GenericDesktop: + { // ease scope + int iMin = 0; + IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMinKey)), iMin ); + int iMax = 0; + IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMaxKey)), iMax ); + + // based on usage + switch( usage ) + { + case kHIDUsage_GD_X: + m.x_axis = cookie; + m.x_min = iMin; + m.x_max = iMax; + break; + case kHIDUsage_GD_Y: + m.y_axis = cookie; + m.y_min = iMin; + m.y_max = iMax; + break; + case kHIDUsage_GD_Z: + m.z_axis = cookie; + m.z_min = iMin; + m.z_max = iMax; + break; + default: + //LOG->Warn( "Unknown usagePage usage pair: (kHIDPage_GenericDesktop, %d).", usage ); + break; + } + } + break; + case kHIDPage_Button: + { + const DeviceButton buttonID = enum_add2( MOUSE_LEFT, usage - kHIDUsage_Button_1 ); + + if( buttonID <= MOUSE_MIDDLE ) + m_Mapping[cookie] = buttonID; + else + LOG->Warn( "Button id too large: %d.", int(buttonID) ); + break; + } + break; + default: + //LOG->Warn( "Unknown usagePage usage pair: (%d, %d).", usagePage, usage ); + break; + } + +} + +void MouseDevice::Open() +{ + const Mouse& m = m_Mouse; +#define ADD(x) if( m.x ) AddElementToQueue( m.x ) + ADD( x_axis ); ADD( y_axis ); ADD( z_axis ); +#undef ADD + for( hash_map::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i ) + AddElementToQueue( i->first ); +} + +void MouseDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const +{ + // todo: add mouse axis stuff -aj + const Mouse& m = m_Mouse; + if( m.x_axis == cookie ) + { +// INPUTFILTER->UpdateCursorLocation(m.x_axis,m.y_axis); + } + else if( m.y_axis == cookie ) + { +// INPUTFILTER->UpdateCursorLocation((float)m.x_axis,(float)m.y_axis); + } + else if( m.z_axis == cookie ) + { + float level = SCALE( value, m.z_min, m.z_max, -1.0f, 1.0f ); + INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELUP, max(-level,0), now) ); + INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELDOWN, max(+level,0), now) ); + } + else + { + hash_map::const_iterator iter = m_Mapping.find( cookie ); + if( iter != m_Mapping.end() ) + vPresses.push_back( DeviceInput(DEVICE_MOUSE, iter->second, value, now) ); + } +} + +void MouseDevice::GetDevicesAndDescriptions( vector& vDevices ) const +{ + vDevices.push_back( InputDeviceInfo(DEVICE_MOUSE, "Mouse") ); +} diff --git a/src/archutils/Darwin/MouseDevice.h b/src/archutils/Darwin/MouseDevice.h new file mode 100644 index 0000000000..73f371fb04 --- /dev/null +++ b/src/archutils/Darwin/MouseDevice.h @@ -0,0 +1,63 @@ +#ifndef MOUSE_DEVICE_H +#define MOUSE_DEVICE_H + +#include "HIDDevice.h" +#include "InputFilter.h" + +struct Mouse +{ + InputDevice id; + IOHIDElementCookie x_axis, y_axis, z_axis; + int x_min, x_max; + int y_min, y_max; + int z_min, z_max; + + Mouse(); +}; + +class MouseDevice : public HIDDevice +{ +private: + __gnu_cxx::hash_map m_Mapping; + Mouse m_Mouse; + +protected: + bool AddLogicalDevice( int usagePage, int usage ); + void AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ); + void Open(); + + // just in case -aj + Mouse GetMouse(){ return m_Mouse; } + +public: + void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; + void GetDevicesAndDescriptions( vector& vDevices ) const; +}; + +#endif + +/* + * (c) 2011 AJ Kelly + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + diff --git a/src/archutils/Win32/AppInstance.cpp b/src/archutils/Win32/AppInstance.cpp index 9df9b741ca..cda1ed092a 100644 --- a/src/archutils/Win32/AppInstance.cpp +++ b/src/archutils/Win32/AppInstance.cpp @@ -3,11 +3,11 @@ AppInstance::AppInstance() { - /* Little trick to get an HINSTANCE of ourself without having access to the hwnd ... */ + // Little trick to get an HINSTANCE of ourself without having access to the hwnd. TCHAR szFullAppPath[MAX_PATH]; GetModuleFileName(NULL, szFullAppPath, MAX_PATH); h = LoadLibrary(szFullAppPath); - /* h will be NULL if this fails. Most operations that take an HINSTANCE + /* h will be NULL if this fails. Most operations that take an HINSTANCE * will still work without one (but may be missing graphics); that's OK. */ } diff --git a/src/archutils/Win32/AppInstance.h b/src/archutils/Win32/AppInstance.h index d129ac091d..de098f8342 100644 --- a/src/archutils/Win32/AppInstance.h +++ b/src/archutils/Win32/AppInstance.h @@ -1,5 +1,3 @@ -/* AppInstance - get an HINSTANCE for starting dialog boxes. */ - #ifndef APP_INSTANCE_H #define APP_INSTANCE_H @@ -7,6 +5,7 @@ # include "windows.h" #endif +/** @brief get an HINSTANCE for starting dialog boxes. */ class AppInstance { public: diff --git a/src/archutils/Win32/CommandLine.cpp b/src/archutils/Win32/CommandLine.cpp index d22e8fbfa5..bb63085eda 100644 --- a/src/archutils/Win32/CommandLine.cpp +++ b/src/archutils/Win32/CommandLine.cpp @@ -2,9 +2,9 @@ #include "CommandLine.h" #include -/* Ugh. Windows doesn't give us the argv[] parser; all it gives is CommandLineToArgvW, - * which is NT-only, so we have to do this ourself. Don't be fancy; only handle double - * quotes. */ +/* Ugh. Windows doesn't give us the argv[] parser; all it gives is + * CommandLineToArgvW, which is NT-only, so we have to do this ourself. Don't + * be fancy; only handle double quotes. */ int GetWin32CmdLine( char** &argv ) { char *pCmdLine = GetCommandLine(); @@ -18,19 +18,19 @@ int GetWin32CmdLine( char** &argv ) argv[argc] = pCmdLine+i; ++argc; - /* Skip to the end of this argument. */ + // Skip to the end of this argument. while( pCmdLine[i] && pCmdLine[i] != ' ' ) { if( pCmdLine[i] == '"' ) { - /* Erase the quote. */ + // Erase the quote. memmove( pCmdLine+i, pCmdLine+i+1, strlen(pCmdLine+i+1)+1 ); - /* Skip to the close quote. */ + // Skip to the close quote. while( pCmdLine[i] && pCmdLine[i] != '"' ) ++i; - /* Erase the close quote. */ + // Erase the close quote. if( pCmdLine[i] == '"' ) memmove( pCmdLine+i, pCmdLine+i+1, strlen(pCmdLine+i+1)+1 ); } diff --git a/src/archutils/Win32/CommandLine.h b/src/archutils/Win32/CommandLine.h index 1590c335f3..79ccdc6391 100644 --- a/src/archutils/Win32/CommandLine.h +++ b/src/archutils/Win32/CommandLine.h @@ -1,8 +1,7 @@ -/* Helper to simulate standard argv[] semantics with WinMain. */ - #ifndef CommandLine_H #define CommandLine_H +/** @brief Helper to simulate standard argv[] semantics with WinMain. */ int GetWin32CmdLine( char** &argv ); #endif diff --git a/src/archutils/Win32/Crash.cpp b/src/archutils/Win32/Crash.cpp index a35143f231..9e5351a67c 100644 --- a/src/archutils/Win32/Crash.cpp +++ b/src/archutils/Win32/Crash.cpp @@ -8,9 +8,9 @@ #include "arch/Threads/Threads_Win32.h" #include "crash.h" #include "CrashHandlerInternal.h" -#include "RageLog.h" /* for RageLog::GetAdditionalLog and Flush */ -#include "RageThreads.h" /* for GetCheckpointLogs */ -#include "PrefsManager.h" /* for g_bAutoRestart */ +#include "RageLog.h" // for RageLog::GetAdditionalLog and Flush +#include "RageThreads.h" // for GetCheckpointLogs +#include "PrefsManager.h" // for g_bAutoRestart #include "RestartProgram.h" // WARNING: This is called from crash-time conditions! No malloc() or new!!! @@ -18,7 +18,6 @@ #define malloc not_allowed_here #define new not_allowed_here - static void SpliceProgramPath(char *buf, int bufsiz, const char *fn) { char tbuf[MAX_PATH]; char *pszFile; @@ -91,7 +90,7 @@ void WriteToChild( HANDLE hPipe, const void *pData, size_t iSize ) } } -/* Execute the child process. Return a handle to the process, a writable handle +/* Execute the child process. Return a handle to the process, a writable handle * to its stdin, and a readable handle to its stdout. */ bool StartChild( HANDLE &hProcess, HANDLE &hToStdin, HANDLE &hFromStdout ) { @@ -186,7 +185,8 @@ void RunChild() HANDLE hProcess, hToStdin, hFromStdout; StartChild( hProcess, hToStdin, hFromStdout ); - /* 0. Send a handle of this process to the crash handling process, which it can use to handle symbol lookups. */ + // 0. Send a handle of this process to the crash handling process, which it + // can use to handle symbol lookups. { HANDLE hTargetHandle; DuplicateHandle( @@ -202,54 +202,54 @@ void RunChild() WriteToChild( hToStdin, &hTargetHandle, sizeof(hTargetHandle) ); } - /* 1. Write the CrashData. */ + // 1. Write the CrashData. WriteToChild( hToStdin, &g_CrashInfo, sizeof(g_CrashInfo) ); - /* 2. Write info. */ - const char *p = RageLog::GetInfo(); - int iSize = strlen( p ); - WriteToChild( hToStdin, &iSize, sizeof(iSize) ); - WriteToChild( hToStdin, p, iSize ); + // 2. Write info. + const char *p = RageLog::GetInfo(); + int iSize = strlen( p ); + WriteToChild( hToStdin, &iSize, sizeof(iSize) ); + WriteToChild( hToStdin, p, iSize ); - /* 3. Write AdditionalLog. */ - p = RageLog::GetAdditionalLog(); - iSize = strlen( p ); - WriteToChild( hToStdin, &iSize, sizeof(iSize) ); - WriteToChild( hToStdin, p, iSize ); + // 3. Write AdditionalLog. + p = RageLog::GetAdditionalLog(); + iSize = strlen( p ); + WriteToChild( hToStdin, &iSize, sizeof(iSize) ); + WriteToChild( hToStdin, p, iSize ); - /* 4. Write RecentLogs. */ - int cnt = 0; - const char *ps[1024]; - while( cnt < 1024 && (ps[cnt] = RageLog::GetRecentLog( cnt )) != NULL ) - ++cnt; + // 4. Write RecentLogs. + int cnt = 0; + const char *ps[1024]; + while( cnt < 1024 && (ps[cnt] = RageLog::GetRecentLog( cnt )) != NULL ) + ++cnt; - WriteToChild(hToStdin, &cnt, sizeof(cnt)); - for( int i = 0; i < cnt; ++i ) - { - iSize = strlen(ps[i])+1; - WriteToChild( hToStdin, &iSize, sizeof(iSize) ); - WriteToChild( hToStdin, ps[i], iSize ); - } + WriteToChild(hToStdin, &cnt, sizeof(cnt)); + for( int i = 0; i < cnt; ++i ) + { + iSize = strlen(ps[i])+1; + WriteToChild( hToStdin, &iSize, sizeof(iSize) ); + WriteToChild( hToStdin, ps[i], iSize ); + } - /* 5. Write CHECKPOINTs. */ - static char buf[1024*32]; - Checkpoints::GetLogs( buf, sizeof(buf), "$$" ); - iSize = strlen( buf )+1; - WriteToChild( hToStdin, &iSize, sizeof(iSize) ); - WriteToChild( hToStdin, buf, iSize ); + // 5. Write CHECKPOINTs. + static char buf[1024*32]; + Checkpoints::GetLogs( buf, sizeof(buf), "$$" ); + iSize = strlen( buf )+1; + WriteToChild( hToStdin, &iSize, sizeof(iSize) ); + WriteToChild( hToStdin, buf, iSize ); - /* 6. Write the crashed thread's name. */ - p = RageThread::GetCurrentThreadName(); - iSize = strlen( p )+1; - WriteToChild( hToStdin, &iSize, sizeof(iSize) ); - WriteToChild( hToStdin, p, iSize ); + // 6. Write the crashed thread's name. + p = RageThread::GetCurrentThreadName(); + iSize = strlen( p )+1; + WriteToChild( hToStdin, &iSize, sizeof(iSize) ); + WriteToChild( hToStdin, p, iSize ); - /* The parent process needs to access this process briefly. When it's done, it'll - * close the handle. Wait until we see that before exiting. */ + /* The parent process needs to access this process briefly. When it's done, + * it'll close the handle. Wait until we see that before exiting. */ while(1) { /* Ugly: the new process can't execute GetModuleFileName on this process, - * since GetModuleFileNameEx might not be available. Run the requests here. */ + * since GetModuleFileNameEx might not be available. Run the requests here. */ HMODULE hMod; DWORD iActual; if( !ReadFile( hFromStdout, &hMod, sizeof(hMod), &iActual, NULL) ) @@ -266,23 +266,21 @@ void RunChild() static long MainExceptionHandler( EXCEPTION_POINTERS *pExc ) { - /* Flush the log it isn't cut off at the end. */ + // Flush the log so it isn't cut off at the end. /* 1. We can't do regular file access in the crash handler. - * 2. We can't access LOG itself at all, since it may not be set up or the pointer might - * be munged. We must only ever use the RageLog:: methods that access static data, that - * we're being very careful to null-terminate as needed. - * - * Logs are rarely important, anyway. Only info.txt and crashinfo.txt are needed 99% - * of the time. */ + * 2. We can't access LOG itself at all, since it may not be set up or the + * pointer might be munged. We must only ever use the RageLog:: methods that + * access static data, that we're being very careful to null-terminate as needed. + * Logs are rarely important, anyway. Only info.txt and crashinfo.txt are + * needed 99% of the time. */ // LOG->Flush(); - /* We aren't supposed to receive these exceptions. For example, if you do - * a floating point divide by zero, you should receive a result of #INF. Only - * if the floating point exception for _EM_ZERODIVIDE is unmasked does this - * exception occur, and we never unmask it. - * + /* We aren't supposed to receive these exceptions. For example, if you do + * a floating point divide by zero, you should receive a result of #INF. + * Only if the floating point exception for _EM_ZERODIVIDE is unmasked + * does this exception occur, and we never unmask it. * However, once in a while some driver or library turns evil and unmasks an - * exception flag on us. If this happens, re-mask it and continue execution. */ + * exception flag on us. If this happens, re-mask it and continue execution. */ switch( pExc->ExceptionRecord->ExceptionCode ) { case EXCEPTION_FLT_INVALID_OPERATION: @@ -298,14 +296,14 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc ) static int InHere = 0; if( InHere > 0 ) { - /* If we get here, then we've been called recursively, which means we crashed. - * If InHere is greater than 1, then we crashed after writing the crash dump; - * say so. */ + /* If we get here, then we've been called recursively, which means we + * crashed. If InHere is greater than 1, then we crashed after writing + * the crash dump; say so. */ SetUnhandledExceptionFilter(NULL); MessageBox( NULL, InHere == 1? "The error reporting interface has crashed.\n": - "The error reporting interface has crashed. However, crashinfo.txt was" + "The error reporting interface has crashed. However, crashinfo.txt was" "written successfully to the program directory.\n", "Fatal Error", MB_OK ); #ifdef DEBUG @@ -330,17 +328,17 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc ) if( g_bAutoRestart ) Win32RestartProgram(); - /* Now things get more risky. If we're fullscreen, the window will obscure the - * crash dialog. Try to hide the window. Things might blow up here; do this - * after DoSave, so we always write a crash dump. */ + /* Now things get more risky. If we're fullscreen, the window will obscure + * the crash dialog. Try to hide the window. Things might blow up here; do + * this after DoSave, so we always write a crash dump. */ if( GetWindowThreadProcessId( g_hForegroundWnd, NULL ) == GetCurrentThreadId() ) { - /* The thread that crashed was the thread that created the main window. Hide - * the window. This will also restore the video mode, if necessary. */ + /* The thread that crashed was the thread that created the main window. + * Hide the window. This will also restore the video mode, if necessary. */ ShowWindow( g_hForegroundWnd, SW_HIDE ); } else { - /* A different thread crashed. Simply kill all other windows. We can't safely - * call ShowWindow; the main thread might be deadlocked. */ + /* A different thread crashed. Simply kill all other windows. We can't + * safely call ShowWindow; the main thread might be deadlocked. */ RageThread::HaltAllThreads( true ); ChangeDisplaySettings( NULL, 0 ); } @@ -349,8 +347,8 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc ) SetUnhandledExceptionFilter( NULL ); - /* Forcibly terminate; if we keep going, we'll try to shut down threads and do other - * things that may deadlock, which is confusing for users. */ + /* Forcibly terminate; if we keep going, we'll try to shut down threads and + * do other things that may deadlock, which is confusing for users. */ TerminateProcess( GetCurrentProcess(), 0 ); return EXCEPTION_EXECUTE_HANDLER; @@ -358,8 +356,9 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc ) long __stdcall CrashHandler::ExceptionHandler( EXCEPTION_POINTERS *pExc ) { - /* If the stack overflowed, we have a very limited amount of stack space. Allocate - * a new stack, and run the exception handler in it, to increase the chances of success. */ + /* If the stack overflowed, we have a very limited amount of stack space. + * Allocate a new stack, and run the exception handler in it, to increase + * the chances of success. */ int iSize = 1024*32; char *pStack = (char *) VirtualAlloc( NULL, iSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE ); pStack += iSize; @@ -419,15 +418,14 @@ static bool IsValidCall(char *buf, int len) static bool IsExecutableProtection(DWORD dwProtect) { MEMORY_BASIC_INFORMATION meminfo; - // Windows NT/2000 allows Execute permissions, but Win9x seems to - // rip it off. So we query the permissions on our own code block, - // and use it to determine if READONLY/READWRITE should be - // considered 'executable.' + // Windows NT/2000 allows Execute permissions, but Win9x seems to rip it + // off. So we query the permissions on our own code block, and use it to + // determine if READONLY/READWRITE should be considered 'executable.' VirtualQuery(IsExecutableProtection, &meminfo, sizeof meminfo); switch((unsigned char)dwProtect) { - case PAGE_READONLY: // *sigh* Win9x... + case PAGE_READONLY: // *sigh* Win9x... case PAGE_READWRITE: // *sigh* return meminfo.Protect==PAGE_READONLY || meminfo.Protect==PAGE_READWRITE; @@ -459,16 +457,17 @@ void CrashHandler::do_backtrace( const void **buf, size_t size, const void **pLast = buf + size - 1; bool bFirst = true; - /* The EIP of the position that crashed is normally on the stack, since the exception - * handler was called on the same stack. However, once in a while, due to stack corruption, - * we might not be able to get any frames from the stack. Pull it out of pContext->Eip, - * which is always valid, and then discard the first stack frame if it's the same. */ + /* The EIP of the position that crashed is normally on the stack, since the + * exception handler was called on the same stack. However, once in a while, + * due to stack corruption, we might not be able to get any frames from the + * stack. Pull it out of pContext->Eip, which is always valid, and then + * discard the first stack frame if it's the same. */ if( buf+1 != pLast && pContext->Eip != NULL ) { *buf = (void *) pContext->Eip; ++buf; } - + // Retrieve stack pointers. const char *pStackBase; { @@ -527,7 +526,7 @@ void CrashHandler::do_backtrace( const void **buf, size_t size, *buf = NULL; } -/* Trigger the crash handler. This works even in the debugger. */ +// Trigger the crash handler. This works even in the debugger. static void NORETURN debug_crash() { __try { @@ -539,26 +538,26 @@ static void NORETURN debug_crash() } } -/* Get a stack trace of the current thread and the specified thread. If - * iID == GetInvalidThreadId(), then output a stack trace for every thread. */ +/* Get a stack trace of the current thread and the specified thread. + * If iID == GetInvalidThreadId(), then output a stack trace for every thread. */ void CrashHandler::ForceDeadlock( RString reason, uint64_t iID ) { strncpy( g_CrashInfo.m_CrashReason, reason, sizeof(g_CrashInfo.m_CrashReason) ); g_CrashInfo.m_CrashReason[ sizeof(g_CrashInfo.m_CrashReason)-1 ] = 0; - /* Suspend the other thread we're going to backtrace. (We need to at least suspend - * hThread, for GetThreadContext to work.) */ + /* Suspend the other thread we're going to backtrace. (We need to at least + * suspend hThread, for GetThreadContext to work.) */ RageThread::HaltAllThreads( false ); if( iID == GetInvalidThreadId() ) { - /* Backtrace all threads. */ + // Backtrace all threads. int iCnt = 0; for( int i = 0; RageThread::EnumThreadIDs(i, iID); ++i ) { if( iID == GetInvalidThreadId() ) continue; - + if( iID == GetCurrentThreadId() ) continue; diff --git a/src/archutils/Win32/Crash.h b/src/archutils/Win32/Crash.h index 990c49090e..4903b41304 100644 --- a/src/archutils/Win32/Crash.h +++ b/src/archutils/Win32/Crash.h @@ -1,8 +1,7 @@ -/* Win32 crash handling. */ - #ifndef CRASH_H #define CRASH_H #include +/** @brief Win32 crash handling. */ namespace CrashHandler { extern long __stdcall ExceptionHandler(struct _EXCEPTION_POINTERS *ExceptionInfo); @@ -12,9 +11,9 @@ namespace CrashHandler void ForceCrash( const char *reason ); void ForceDeadlock( RString reason, uint64_t iID ); - /* Inform the crash handler of a foreground window that may be fullscreen. If - * set, the crash handler will attempt to hide the window or reset the video - * mode. */ + /* Inform the crash handler of a foreground window that may be fullscreen. + * If set, the crash handler will attempt to hide the window or reset the + * video mode. */ void SetForegroundWindow( HWND hWnd ); void CrashHandlerHandleArgs( int argc, char* argv[] ); diff --git a/src/archutils/Win32/CrashHandlerNetworking.cpp b/src/archutils/Win32/CrashHandlerNetworking.cpp index 981348650f..28b152b388 100644 --- a/src/archutils/Win32/CrashHandlerNetworking.cpp +++ b/src/archutils/Win32/CrashHandlerNetworking.cpp @@ -14,42 +14,39 @@ #pragma comment(lib, "ws2_32.lib") #endif -/* - * This has an arch-like abstraction layout, since it's intended to become one. - * It'll be moved out of here as things get polished further. The Winsock and +/* This has an arch-like abstraction layout, since it's intended to become one. + * It'll be moved out of here as things get polished further. The Winsock and * BSD implementations will be kept separate, since while they look similar, * they're different in the details, especially when you want to cleanly support * cancellation. * * Design notes: - * - * - Allow cancellation at any time. The only thing more annoying than a laggy - * network, is an application that won't immediately respond to cancelling. - * (This is even more important here, since we're using this after a crash.) - * - Assume some operations and/or some architectures are going to have problems - * doing everything nonblockingly, and do everything in a thread. This also allows - * more complex network interactions, since it doesn't need to maintain an equally - * complex state machine. - * - When an operation is cancelled or an error occurs, all operations until the - * next call to Close() become no-ops. This allows lenient error checking; it's - * guaranteed that further calls to Read or Write will not reset the error state. - * - The only function that may be called from another thread without serialization is - * Cancel(). + * - Allow cancellation at any time. The only thing more annoying than a laggy + * network, is an application that won't immediately respond to cancelling. + * (This is even more important here, since we're using this after a crash.) + * - Assume some operations and/or some architectures are going to have problems + * doing everything nonblockingly, and do everything in a thread. This also allows + * more complex network interactions, since it doesn't need to maintain an equally + * complex state machine. + * - When an operation is cancelled or an error occurs, all operations until the + * next call to Close() become no-ops. This allows lenient error checking; it's + * guaranteed that further calls to Read or Write will not reset the error state. + * - The only function that may be called from another thread without serialization is + * Cancel(). * * All calls are blocking, except for: * - * - Cancel(), which is always nonblocking. The operation in progress, if any, - * will be aborted immediately. (The only exception here is incomplete - * implementations, which may block); - * - Close(), if Shutdown() was called first, since the necessary blocking occurs - * during Shutdown; - * - Close(), if an error or cancellation occurred. + * - Cancel(), which is always nonblocking. The operation in progress, if any, + * will be aborted immediately. (The only exception here is incomplete + * implementations, which may block); + * - Close(), if Shutdown() was called first, since the necessary blocking occurs + * during Shutdown; + * - Close(), if an error or cancellation occurred. * * Accepting incoming TCP connections is beyond the immediate scope of this interface * (that would involve a second listener class, which would be a factory for NetworkStream). * UDP is probably within the scope of this class, but there are some outstanding design - * issues and it's beyond the work I'm doing right now. - */ + * issues and it's beyond the work I'm doing right now. */ class NetworkStream { @@ -62,58 +59,44 @@ public: NetworkStream() { } virtual ~NetworkStream() { } - /* - * Open a connection. Must be in STATE_IDLE. - */ + // Open a connection. Must be in STATE_IDLE. virtual void Open( const RString &sHost, int iPort, ConnectionType ct = CONN_TCP ) = 0; - /* - * Close down a connection. Returns to STATE_IDLE. - */ + // Close down a connection. Returns to STATE_IDLE. virtual void Close() = 0; - /* - * Wait for all sent data to be flushed, and shut down the connection. - */ + // Wait for all sent data to be flushed, and shut down the connection. virtual void Shutdown() = 0; - /* - * Read data. Block until any data is received, then return all data - * available. Return the number of bytes read. The return value will - * always be >= 0, unless an error or cancellation occured. - */ + /* Read data. Block until any data is received, then return all data + * available. Return the number of bytes read. The return value will always + * be >= 0, unless an error or cancellation occured. */ virtual int Read( void *pBuffer, size_t iSize ) = 0; - /* - * Write data to the socket. (Design note: we always write all of the - * data unless an error or cancellation occurs, and those states are checked - * with GetState(). If that happens, the number of bytes written is - * meaningless, since it may have simply been buffered and never sent. So, - * this function returns no value.) - */ + /* Write data to the socket. (Design note: we always write all of the data + * unless an error or cancellation occurs, and those states are checked + * with GetState(). If that happens, the number of bytes written is + * meaningless, since it may have simply been buffered and never sent. + * So, this function returns no value.) */ virtual void Write( const void *pBuffer, size_t iSize ) = 0; - /* - * Cancel the connection. This operation can clear an error state, aborts + /* Cancel the connection. This operation can clear an error state, aborts * any blocking calls, never fails, and will always result in the socket * being in STATE_CANCELLED. - * - * This is true even if the state was STATE_IDLE. For example, the user + * This is true even if the state was STATE_IDLE. For example, the user * thread may be closing one connection on this object and opening another, * and the UI thread may call Cancel() in between these operations. - * * This operation is threadsafe: a socket can be cancelled from any thread - * while another thread is reading or writing. This is the only function - * that can be called without serialization. - */ + * while another thread is reading or writing. This is the only function + * that can be called without serialization. */ virtual void Cancel() = 0; enum State { - /* The stream is closed, and is ready to be opened. */ + // The stream is closed, and is ready to be opened. STATE_IDLE, - /* The stream is connected and able to send and receive data. */ + // The stream is connected and able to send and receive data. STATE_CONNECTED, /* The stream has been shut down on either end (either an EOF from @@ -157,7 +140,7 @@ private: HANDLE m_hResolve; HWND m_hResolveHwnd; - /* This event is signalled on cancellation, to wake us up if we're blocking. */ + // This event is signalled on cancellation, to wake us up if we're blocking. HANDLE m_hCompletionEvent; RString m_sHost; @@ -181,7 +164,7 @@ NetworkStream *CreateNetworkStream() return new NetworkStream_Win32; } -/* WinSock implementation of NetworkStream. */ +/** @brief WinSock implementation of NetworkStream. */ NetworkStream_Win32::NetworkStream_Win32(): m_Mutex( "NetworkTCPSocket" ) { @@ -202,7 +185,7 @@ NetworkStream_Win32::~NetworkStream_Win32() } /* Wait for the specified network event to occur, or cancellation, whichever - * happens first. On cancellation, return -1; on error, return the error + * happens first. On cancellation, return -1; on error, return the error * code; on success, return 0. */ int NetworkStream_Win32::WaitForCompletionOrCancellation( int iEvent ) { @@ -214,11 +197,11 @@ int NetworkStream_Win32::WaitForCompletionOrCancellation( int iEvent ) m_Mutex.Lock(); - /* This will reset the event. Do this while we hold the lock. */ + // This will reset the event. Do this while we hold the lock. WSANETWORKEVENTS events; WSAEnumNetworkEvents( m_Socket, m_hCompletionEvent, &events ); - /* Was the event signalled due to cancellation? */ + // Was the event signalled due to cancellation? if( m_State == STATE_CANCELLED ) { m_Mutex.Unlock(); @@ -227,13 +210,13 @@ int NetworkStream_Win32::WaitForCompletionOrCancellation( int iEvent ) m_Mutex.Unlock(); - /* If the event didn't actually occur, keep waiting. */ + // If the event didn't actually occur, keep waiting. if( (events.lNetworkEvents & (1< 0 ) break; @@ -543,12 +526,12 @@ int NetworkStream_Win32::Read( void *pBuffer, size_t iSize ) continue; } - /* If the other side closed the connection, just return EOF. */ + // If the other side closed the connection, just return EOF. if( iError == WSAECONNRESET ) break; - /* If we're cancelled or hit an error while reading, do return the data we managed - * to get. Be sure not to overwrite CANCELLED with ERROR. */ + /* If we're cancelled or hit an error while reading, do return the data + * we managed to get. Be sure not to overwrite CANCELLED with ERROR. */ SetError( ssprintf("Error reading: %s", WinSockErrorToString(iError).c_str() ) ); break; } @@ -586,10 +569,7 @@ void NetworkStream_Win32::Write( const void *pBuffer, size_t iSize ) } } -/* - * Send a set of data over HTTP, as a POST form. - */ - +/** @brief Send a set of data over HTTP, as a POST form. */ NetworkPostData::NetworkPostData(): m_Mutex( "NetworkPostData" ) { @@ -601,10 +581,10 @@ NetworkPostData::~NetworkPostData() delete m_pStream; } -/* Create a MIME multipart data block from the given set of fields. */ +/** @brief Create a MIME multipart data block from the given set of fields. */ void NetworkPostData::CreateMimeData( const map &mapNameToData, RString &sOut, RString &sMimeBoundaryOut ) { - /* Find a non-conflicting mime boundary. */ + // Find a non-conflicting mime boundary. while(1) { sMimeBoundaryOut = ssprintf( "--%08i", rand() ); @@ -655,19 +635,17 @@ void NetworkPostData::HttpThread() sBuf += sData; /* The "progress" is currently faked; it shows when we've connected, and when - * we've received data. We send and receive too little data to do more. */ + * we've received data. We send and receive too little data to do more. */ SetProgress( 0 ); - /* - * Begin connecting. - */ + // Begin connecting. m_pStream->Open( m_sHost, m_iPort ); SetProgress( 0.25f ); - /* Send the form. */ + // Send the form. m_pStream->Write( sBuf.data(), sBuf.size() ); - /* Read the result. */ + // Read the result. RString sResult; while( m_pStream->GetState() == NetworkStream::STATE_CONNECTED ) { @@ -683,7 +661,7 @@ void NetworkPostData::HttpThread() SetProgress( 1.0f ); - /* Parse the results. */ + // Parse the results. int iStart = 0, iSize = -1; map mapHeaders; while( 1 ) diff --git a/src/archutils/Win32/CrashHandlerNetworking.h b/src/archutils/Win32/CrashHandlerNetworking.h index 57088c5adb..d36f196c8a 100644 --- a/src/archutils/Win32/CrashHandlerNetworking.h +++ b/src/archutils/Win32/CrashHandlerNetworking.h @@ -6,9 +6,7 @@ class NetworkStream; -/* - * Send a set of data over HTTP, as a POST form. - */ +// Send a set of data over HTTP, as a POST form. class NetworkPostData { public: @@ -17,13 +15,13 @@ public: void SetData( const RString &sKey, const RString &sData ); - /* For simplicity, we don't parse URLs here. */ + // For simplicity, we don't parse URLs here. void Start( const RString &sHost, int iPort, const RString &sPath ); - /* Cancel the running operation, and close the thread. */ + // Cancel the running operation, and close the thread. void Cancel(); - /* If the operation is unfinished, return false. Otherwise, close the thread and return true. */ + // If the operation is unfinished, return false. Otherwise, close the thread and return true. bool IsFinished(); RString GetStatus() const; @@ -43,7 +41,7 @@ private: RString m_sStatus; float m_fProgress; - /* When the thread exists, it owns the rest of the data, regardless of m_Mutex. */ + // When the thread exists, it owns the rest of the data, regardless of m_Mutex. map m_Data; bool m_bFinished; diff --git a/src/archutils/Win32/DebugInfoHunt.cpp b/src/archutils/Win32/DebugInfoHunt.cpp index 5ced16acb9..d7db9b0003 100644 --- a/src/archutils/Win32/DebugInfoHunt.cpp +++ b/src/archutils/Win32/DebugInfoHunt.cpp @@ -7,7 +7,6 @@ #include #include - static void LogVideoDriverInfo( VideoDriverInfo info ) { LOG->Info( "Video driver: %s [%s]", info.sDescription.c_str(), info.sProvider.c_str() ); @@ -200,7 +199,6 @@ static void GetWindowsVersionDebugInfo() return; } - RString Ver = ssprintf("Windows %i.%i (", ovi.dwMajorVersion, ovi.dwMinorVersion); if(ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { @@ -280,7 +278,6 @@ static void GetSoundDriverDebugInfo() } } - void SearchForDebugInfo() { GetWindowsVersionDebugInfo(); diff --git a/src/archutils/Win32/DebugInfoHunt.h b/src/archutils/Win32/DebugInfoHunt.h index 6041f931c1..4a865e0e9b 100644 --- a/src/archutils/Win32/DebugInfoHunt.h +++ b/src/archutils/Win32/DebugInfoHunt.h @@ -1,7 +1,7 @@ #ifndef DEBUG_INFO_HUNT_H #define DEBUG_INFO_HUNT_H -/* We want debug information; Windows makes us hunt for it. */ +/** @brief We want debug information; Windows makes us hunt for it. */ void SearchForDebugInfo(); #endif diff --git a/src/archutils/Win32/DialogUtil.cpp b/src/archutils/Win32/DialogUtil.cpp index 5971d8a23d..20f9b2a2c9 100644 --- a/src/archutils/Win32/DialogUtil.cpp +++ b/src/archutils/Win32/DialogUtil.cpp @@ -15,7 +15,7 @@ static HFONT CreatePointFontIndirect(const LOGFONT* lpLogFont) LOGFONT logFont = *lpLogFont; POINT pt; pt.y = ::GetDeviceCaps(hDC, LOGPIXELSY) * logFont.lfHeight; - pt.y /= 720; // 72 points/inch, 10 decipoints/point + pt.y /= 720; // 72 points/inch * 10 decipoints/point pt.x = 0; ::DPtoLP(hDC, &pt, 1); POINT ptOrg = { 0, 0 }; diff --git a/src/archutils/Win32/ErrorStrings.cpp b/src/archutils/Win32/ErrorStrings.cpp index c79ccd12f7..aa39bf3c44 100644 --- a/src/archutils/Win32/ErrorStrings.cpp +++ b/src/archutils/Win32/ErrorStrings.cpp @@ -14,11 +14,12 @@ RString werr_ssprintf( int err, const char *fmt, ... ) 0, err, 0, buf, sizeof(buf), NULL); #endif - /* Why is FormatMessage returning text ending with \r\n? */ + // Why is FormatMessage returning text ending with \r\n? (who? -aj) + // Perhaps it's because you're on Windows, where newlines are \r\n. -aj RString text = buf; text.Replace( "\n", "" ); - text.Replace( "\r", " " ); /* foo\r\nbar -> foo bar */ - TrimRight( text ); /* "foo\r\n" -> "foo" */ + text.Replace( "\r", " " ); // foo\r\nbar -> foo bar + TrimRight( text ); // "foo\r\n" -> "foo" va_list va; va_start(va, fmt); diff --git a/src/archutils/Win32/GetFileInformation.cpp b/src/archutils/Win32/GetFileInformation.cpp index 8c8167bc90..528aa208a7 100644 --- a/src/archutils/Win32/GetFileInformation.cpp +++ b/src/archutils/Win32/GetFileInformation.cpp @@ -14,14 +14,14 @@ bool GetFileVersion( RString sFile, RString &sOut ) { do { - /* Cast away const to work around header bug in VC6. */ + // Cast away const to work around header bug in VC6. DWORD ignore; DWORD iSize = GetFileVersionInfoSize( const_cast(sFile.c_str()), &ignore ); if( !iSize ) break; RString VersionBuffer( iSize, ' ' ); - /* Also VC6: */ + // Also VC6: if( !GetFileVersionInfo( const_cast(sFile.c_str()), NULL, iSize, VersionBuffer.GetBuffer() ) ) break; @@ -47,7 +47,7 @@ bool GetFileVersion( RString sFile, RString &sOut ) sOut = RString( str, len-1 ); } while(0); - /* Get the size and date. */ + // Get the size and date. struct stat st; if( stat( sFile, &st ) != -1 ) { @@ -87,11 +87,12 @@ RString FindSystemFile( RString sFile ) return RString(); } -/* Get the full path of the process running in iProcessID. On error, false is +/* Get the full path of the process running in iProcessID. On error, false is * returned and an error message is placed in sName. */ bool GetProcessFileName( uint32_t iProcessID, RString &sName ) { - /* This method works in everything except for NT4, and only uses kernel32.lib functions. */ + /* This method works in everything except for NT4, and only uses + * kernel32.lib functions. */ do { HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, iProcessID ); if( hSnap == NULL ) @@ -115,7 +116,7 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName ) sName = werr_ssprintf( GetLastError(), "Module32First" ); } while(0); - /* This method only works in NT/2K/XP. */ + // This method only works in NT/2K/XP. do { static HINSTANCE hPSApi = NULL; typedef DWORD (WINAPI* pfnGetProcessImageFileNameA)(HANDLE hProcess, LPSTR lpImageFileName, DWORD nSize); diff --git a/src/archutils/Win32/GotoURL.cpp b/src/archutils/Win32/GotoURL.cpp index 3d53d80a44..264c2ad22f 100644 --- a/src/archutils/Win32/GotoURL.cpp +++ b/src/archutils/Win32/GotoURL.cpp @@ -22,7 +22,6 @@ static LONG GetRegKey( HKEY key, RString subkey, LPTSTR retdata ) return ERROR_SUCCESS; } - bool GotoURL( RString sUrl ) { // First try ShellExecute() @@ -44,15 +43,15 @@ bool GotoURL( RString sUrl ) char *szPos = strstr( key, "\"%1\"" ); if( szPos == NULL ) { - // No quotes found. Check for %1 without quotes + // No quotes found. Check for %1 without quotes szPos = strstr( key, "%1" ); - if( szPos == NULL ) - szPos = key+lstrlen(key)-1; // No parameter. + if( szPos == NULL ) + szPos = key+lstrlen(key)-1; // No parameter. else - *szPos = '\0'; // Remove the parameter + *szPos = '\0'; // Remove the parameter } else - *szPos = '\0'; // Remove the parameter + *szPos = '\0'; // Remove the parameter strcat( szPos, " " ); strcat( szPos, sUrl ); @@ -63,7 +62,7 @@ bool GotoURL( RString sUrl ) /* * (c) 2002-2004 Chris Danford * All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -73,7 +72,7 @@ bool GotoURL( RString sUrl ) * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF diff --git a/src/archutils/Win32/GotoURL.h b/src/archutils/Win32/GotoURL.h index 99f0aec149..4c8f173d28 100644 --- a/src/archutils/Win32/GotoURL.h +++ b/src/archutils/Win32/GotoURL.h @@ -1,8 +1,7 @@ -/* Open URLs in a browser. */ - #ifndef GOTO_URL_H #define GOTO_URL_H +/** @brief Open URLs in a browser. */ bool GotoURL( RString sUrl ); #endif diff --git a/src/archutils/Win32/GraphicsWindow.cpp b/src/archutils/Win32/GraphicsWindow.cpp index bc7c906a7b..20c7a35b7e 100644 --- a/src/archutils/Win32/GraphicsWindow.cpp +++ b/src/archutils/Win32/GraphicsWindow.cpp @@ -53,7 +53,7 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar { CHECKPOINT_M( ssprintf("%p, %u, %08x, %08x", hWnd, msg, wParam, lParam) ); - /* Suppress autorun. */ + // Suppress autorun. if( msg == g_iQueryCancelAutoPlayMessage ) return true; @@ -80,8 +80,9 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar if( !g_bD3D && !g_CurrentParams.windowed && !g_bRecreatingVideoMode ) { - /* In OpenGL (not D3D), it's our job to unset and reset the full-screen video mode - * when we focus changes, and to hide and show the window. Hiding is done in WM_KILLFOCUS, + /* In OpenGL (not D3D), it's our job to unset and reset the + * full-screen video mode when we focus changes, and to hide + * and show the window. Hiding is done in WM_KILLFOCUS, * because that's where most other apps seem to do it. */ if( g_bHasFocus && !bHadFocus ) { @@ -101,7 +102,9 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar ShowWindow( g_hWndMain, SW_SHOWMINNOACTIVE ); break; - /* Is there any reason we should care what size the user resizes the window to? */ + /* Is there any reason we should care what size the user resizes + * the window to? (who? -aj) + * Short answer: yes. -aj */ // case WM_GETMINMAXINFO: case WM_SETCURSOR: @@ -115,9 +118,9 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar case WM_SYSCOMMAND: switch( wParam&0xFFF0 ) { - case SC_MONITORPOWER: - case SC_SCREENSAVE: - return 0; + case SC_MONITORPOWER: + case SC_SCREENSAVE: + return 0; } break; @@ -133,7 +136,7 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP: - /* We handle all input ourself, via DirectInput. */ + // We handle all input ourself, via DirectInput. return 0; case WM_CLOSE: @@ -143,8 +146,8 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar case WM_WINDOWPOSCHANGED: { - /* If we're fullscreen and don't have focus, our window is hidden, so GetClientRect - * isn't meaningful. */ + /* If we're fullscreen and don't have focus, our window is hidden, + * so GetClientRect isn't meaningful. */ if( !g_CurrentParams.windowed && !g_bHasFocus ) break; @@ -192,8 +195,7 @@ static void AdjustVideoModeParams( VideoModeParams &p ) return; } - /* - * On a nForce 2 IGP on Windows 98, dm.dmDisplayFrequency sometimes + /* On a nForce 2 IGP on Windows 98, dm.dmDisplayFrequency sometimes * (but not always) is 0. * * MSDN: When you call the EnumDisplaySettings function, the @@ -201,8 +203,7 @@ static void AdjustVideoModeParams( VideoModeParams &p ) * These values represent the display hardware's default refresh rate. * This default rate is typically set by switches on a display card or * computer motherboard, or by a configuration program that does not - * use Win32 display functions such as ChangeDisplaySettings. - */ + * use Win32 display functions such as ChangeDisplaySettings. */ if( !(dm.dmFields & DM_DISPLAYFREQUENCY) || dm.dmDisplayFrequency == 0 || dm.dmDisplayFrequency == 1 ) @@ -222,7 +223,7 @@ RString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) { if( p.windowed ) { - /* We're going windowed. If we were previously fullscreen, reset. */ + // We're going windowed. If we were previously fullscreen, reset. ChangeDisplaySettings( NULL, 0 ); return RString(); @@ -250,7 +251,7 @@ RString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) ret = ChangeDisplaySettings( &DevMode, CDS_FULLSCREEN ); } - /* XXX: append error */ + // XXX: append error if( ret != DISP_CHANGE_SUCCESSFUL ) return "Couldn't set screen mode"; @@ -285,12 +286,12 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce if( hWnd == NULL ) RageException::Throw( "%s", werr_ssprintf( GetLastError(), "CreateWindow" ).c_str() ); - /* If an old window exists, transfer focus to the new window before deleting - * it, or some other window may temporarily get focus, which can cause it - * to be resized. */ + /* If an old window exists, transfer focus to the new window before + * deleting it, or some other window may temporarily get focus, which + * can cause it to be resized. */ if( g_hWndMain != NULL ) { - /* While we change to the new window, don't do ChangeDisplaySettings in WM_ACTIVATE. */ + // While we change to the new window, don't do ChangeDisplaySettings in WM_ACTIVATE. g_bRecreatingVideoMode = true; SetForegroundWindow( hWnd ); g_bRecreatingVideoMode = false; @@ -327,7 +328,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce SetClassLong( g_hWndMain, GCL_HICON, (LONG) g_hIcon ); /* The window style may change as a result of switching to or from fullscreen; - * apply it. Don't change the WS_VISIBLE bit. */ + * apply it. Don't change the WS_VISIBLE bit. */ int iWindowStyle = GetWindowStyle( p.windowed ); if( GetWindowLong( g_hWndMain, GWL_STYLE ) & WS_VISIBLE ) iWindowStyle |= WS_VISIBLE; @@ -342,7 +343,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce const int iWidth = WindowRect.right - WindowRect.left; const int iHeight = WindowRect.bottom - WindowRect.top; - /* If windowed, center the window. */ + // If windowed, center the window. int x = 0, y = 0; if( p.windowed ) { @@ -350,8 +351,8 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce y = GetSystemMetrics(SM_CYSCREEN)/2-iHeight/2; } - /* Move and resize the window. SWP_FRAMECHANGED causes the above SetWindowLong - * to take effect. */ + /* Move and resize the window. SWP_FRAMECHANGED causes the above + * SetWindowLong to take effect. */ if( !SetWindowPos( g_hWndMain, HWND_NOTOPMOST, x, y, iWidth, iHeight, SWP_FRAMECHANGED|SWP_SHOWWINDOW ) ) LOG->Warn( "%s", werr_ssprintf( GetLastError(), "SetWindowPos" ).c_str() ); @@ -368,7 +369,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce } } -/* Shut down the window, but don't reset the video mode. */ +/** @brief Shut down the window, but don't reset the video mode. */ void GraphicsWindow::DestroyGraphicsWindow() { if( g_HDC != NULL ) @@ -410,7 +411,7 @@ void GraphicsWindow::DestroyGraphicsWindow() void GraphicsWindow::Initialize( bool bD3D ) { - /* A few things need to be handled differently for D3D. */ + // A few things need to be handled differently for D3D. g_bD3D = bD3D; AppInstance inst; @@ -461,13 +462,10 @@ void GraphicsWindow::Shutdown() { DestroyGraphicsWindow(); - /* - * Return to the desktop resolution, if needed. - * - * It'd be nice to not do this: Windows will do it when we quit, and if we're - * shutting down OpenGL to try D3D, this will cause extra mode switches. However, - * we need to do this before displaying dialogs. - */ + /* Return to the desktop resolution, if needed. + * It'd be nice to not do this: Windows will do it when we quit, and if + * we're shutting down OpenGL to try D3D, this will cause extra mode + * switches. However, we need to do this before displaying dialogs. */ ChangeDisplaySettings( NULL, 0 ); AppInstance inst; @@ -500,7 +498,7 @@ void GraphicsWindow::Update() { //LOG->Warn( "Changing resolution" ); - /* Let DISPLAY know that our resolution has changed. (Note that ResolutionChanged() + /* Let DISPLAY know that our resolution has changed. (Note that ResolutionChanged() * can come back here, so reset g_bResolutionChanged first.) */ g_bResolutionChanged = false; DISPLAY->ResolutionChanged(); @@ -528,7 +526,6 @@ void GraphicsWindow::GetDisplayResolutions( DisplayResolutions &out ) } } - /* * (c) 2004 Glenn Maynard * All rights reserved. diff --git a/src/archutils/Win32/GraphicsWindow.h b/src/archutils/Win32/GraphicsWindow.h index 93d09fe79a..8e2f646d6c 100644 --- a/src/archutils/Win32/GraphicsWindow.h +++ b/src/archutils/Win32/GraphicsWindow.h @@ -1,5 +1,3 @@ -/* GraphicsWindow - Sets up a window for OpenGL/D3D. */ - #ifndef GRAPHICS_WINDOW_H #define GRAPHICS_WINDOW_H @@ -8,19 +6,25 @@ class VideoModeParams; class DisplayResolution; +/** @brief Sets up a window for OpenGL/D3D. */ namespace GraphicsWindow { - /* Set up, and create a hidden window. This only needs to be called once. */ + /** @brief Set up, and create a hidden window. + * + * This only needs to be called once. */ void Initialize( bool bD3D ); - /* Shut down completely. */ + /** @brief Shut down completely. */ void Shutdown(); - /* Set the display mode. p will not be second-guessed, except to try disabling - * the refresh rate setting. */ + /** @brief Set the display mode. + * + * p will not be second-guessed, except to try disabling the refresh rate setting. */ RString SetScreenMode( const VideoModeParams &p ); - /* Create the window. This also updates VideoModeParams (returned by GetParams). */ + /** @brief Create the window. + * + * This also updates VideoModeParams (returned by GetParams). */ void CreateGraphicsWindow( const VideoModeParams &p, bool bForceRecreateWindow = false ); void DestroyGraphicsWindow(); diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index 60f574f053..a7e7062f40 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -29,14 +29,14 @@ #pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union (Windows headers do this) #pragma warning (disable : 4786) // turn off broken debugger warning #pragma warning (disable : 4512) // assignment operator could not be generated (so?) -/* "unreachable code". This warning crops up in incorrect places (end of do ... while(0) +/* "unreachable code". This warning crops up in incorrect places (end of do ... while(0) * blocks, try/catch blocks), and I've never found it to be useful. */ #pragma warning (disable : 4702) // assignment operator could not be generated (so?) -/* "unreferenced formal parameter"; we *want* that in many cases */ +// "unreferenced formal parameter"; we *want* that in many cases #pragma warning (disable : 4100) /* "case 'aaa' is not a valid value for switch of enum 'bbb' * Actually, this is a valid warning, but we do it all over the - * place, eg. with ScreenMessages. Those should be fixed, but later. XXX */ + * place, eg. with ScreenMessages. Those should be fixed, but later. XXX */ #pragma warning (disable : 4063) #pragma warning (disable : 4127) #pragma warning (disable : 4786) /* VC6: identifier was truncated to '255' characters in the debug information */ @@ -44,43 +44,43 @@ #pragma warning (disable : 4244) // converting of data = possible data loss. (This pragma should eventually go away) #pragma warning (disable : 4355) // 'this' : used in base member initializer list -/* Fix VC breakage. */ +// Fix VC breakage. #define PATH_MAX _MAX_PATH -/* Disable false deprecation warnings in VC2005. */ +// Disable false deprecation warnings in VC2005. #define _CRT_SECURE_NO_DEPRECATE #define _SCL_SECURE_NO_DEPRECATE -/* Disable false deprecation warnings in VC2008. */ +// Disable false deprecation warnings in VC2008. #define _CRT_NONSTDC_NO_WARNINGS #if defined(_MSC_VER) && _MSC_VER >= 1400 // this is needed in VC8 but breaks VC7 #define _HAS_EXCEPTIONS 0 #endif -/* Don't include windows.h everywhere; when we do eventually include it, use these: */ +// Don't include windows.h everywhere; when we do eventually include it, use these: #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN -/* Pull in NT-only definitions. Note that we support Win98 and WinME; you can make - * NT calls, but be sure to fall back on 9x if they're not supported. */ +/* Pull in NT-only definitions. Note that we support Win98 and WinME; you can + * make NT calls, but be sure to fall back on 9x if they're not supported. */ #define _WIN32_WINNT 0x0400 #define _WIN32_IE 0x0400 -/* If this isn't defined to 0, VC fails to define things like stat and alloca. */ +// If this isn't defined to 0, VC fails to define things like stat and alloca. #define __STDC__ 0 #endif -#include /* has stuff that should be in unistd.h */ -#include /* needs to be included before our fixes below */ +#include // has stuff that should be in unistd.h +#include // needs to be included before our fixes below #define lstat stat #define fsync _commit #define isnan _isnan #define isfinite _finite -/* mkdir is missing the mode arg */ +// mkdir is missing the mode arg #define mkdir(p,m) mkdir(p) typedef time_t time_t; @@ -92,9 +92,7 @@ struct tm *my_gmtime_r( const time_t *timep, struct tm *result ); void my_usleep( unsigned long usec ); #define usleep my_usleep - - -/* Missing stdint types: */ +// Missing stdint types: #if !defined(__MINGW32__) // MinGW headers define these for us typedef signed char int8_t; typedef signed short int16_t; @@ -116,9 +114,9 @@ static inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; } #undef min #undef max -#define NOMINMAX /* make sure Windows doesn't try to define this */ +#define NOMINMAX // make sure Windows doesn't try to define this -/* Windows is missing some basic math functions: */ +// Windows is missing some basic math functions: // But MinGW isn't. #if !defined(__MINGW32__) #define NEED_TRUNCF @@ -132,7 +130,7 @@ static inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; } inline long int lrintf( float f ) { int retval; - + _asm fld f; _asm fistp retval; @@ -140,11 +138,11 @@ inline long int lrintf( float f ) } #endif -/* For RageLog. */ +// For RageLog. #define HAVE_VERSION_INFO -/* We implement the crash handler interface (though that interface isn't completely - * uniform across platforms yet). */ +/* We implement the crash handler interface (though that interface isn't + * completely uniform across platforms yet). */ #if !defined(_XBOX) && !defined(SMPACKAGE) #define CRASH_HANDLER #endif @@ -165,7 +163,6 @@ inline long int lrintf( float f ) #include "ArchUtils/Xbox/arch_setup.h" #endif - #if defined(__GNUC__) // It might be MinGW or Cygwin(?) #include "archutils/Common/gcc_byte_swaps.h" #else // XXX: Should we test for MSVC? diff --git a/src/smpackage-net2003.vcproj b/src/smpackage-net2003.vcproj index 20e5db17a1..8bbe33e746 100644 --- a/src/smpackage-net2003.vcproj +++ b/src/smpackage-net2003.vcproj @@ -1,25 +1,51 @@ + Keyword="MFCProj" + TargetFrameworkVersion="131072" + > + Name="Win32" + /> + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + Name="VCManagedResourceCompilerTool" + /> + + + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> - - - + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="0" + /> + Name="VCManagedResourceCompilerTool" + /> + + + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> - - - + Name="VCPostBuildEventTool" + /> @@ -151,661 +212,861 @@ + > + RelativePath=".\smpackage\ChangeGameSettings.cpp" + > + RelativePath=".\smpackage\ChangeGameSettings.h" + > + RelativePath=".\smpackage\CreateLanguageDlg.cpp" + > + RelativePath=".\smpackage\CreateLanguageDlg.h" + > + RelativePath=".\smpackage\EditInsallations.cpp" + > + RelativePath=".\smpackage\EditInsallations.h" + > + RelativePath=".\smpackage\EnterComment.cpp" + > + RelativePath=".\smpackage\EnterComment.h" + > + RelativePath=".\smpackage\EnterName.cpp" + > + RelativePath=".\smpackage\EnterName.h" + > + RelativePath=".\smpackage\LanguagesDlg.cpp" + > + RelativePath=".\smpackage\LanguagesDlg.h" + > + RelativePath=".\smpackage\MainMenuDlg.cpp" + > + RelativePath=".\smpackage\MainMenuDlg.h" + > + RelativePath=".\smpackage\ShowComment.cpp" + > + RelativePath=".\smpackage\ShowComment.h" + > + RelativePath=".\smpackage\smpackage.cpp" + > + RelativePath=".\smpackage\smpackage.h" + > + RelativePath=".\smpackage\SmpackageExportDlg.cpp" + > + RelativePath=".\smpackage\SmpackageExportDlg.h" + > + RelativePath=".\smpackage\SMPackageInstallDlg.cpp" + > + RelativePath=".\smpackage\SMPackageInstallDlg.h" + > + RelativePath=".\smpackage\SMPackageUtil.cpp" + > + RelativePath=".\smpackage\smpackageUtil.h" + > + RelativePath=".\smpackage\StdAfx.h" + > + RelativePath=".\smpackage\TreeCtrlEx.cpp" + > + RelativePath=".\smpackage\TreeCtrlEx.h" + > + RelativePath=".\smpackage\UninstallOld.cpp" + > + RelativePath=".\smpackage\UninstallOld.h" + > + > + RelativePath=".\smpackage\resource.h" + > + RelativePath="smpackage.ICO" + > + RelativePath="res\smpackage.ico" + > + RelativePath=".\smpackage\smpackage.rc" + > + RelativePath="res\StepMania.ICO" + > + > + RelativePath=".\global.cpp" + > + RelativePath=".\global.h" + > + RelativePath=".\ProductInfo.h" + > + RelativePath=".\SpecialFiles.cpp" + > + RelativePath=".\SpecialFiles.h" + > + RelativePath=".\StdString.h" + > + Name="system" + > + RelativePath=".\archutils\Win32\AppInstance.cpp" + > + RelativePath=".\archutils\Win32\AppInstance.h" + > + RelativePath=".\archutils\Win32\arch_setup.h" + > + RelativePath=".\archutils\Win32\arch_time.cpp" + > + RelativePath=".\archutils\Win32\CommandLine.cpp" + > + RelativePath=".\archutils\Win32\CommandLine.h" + > + RelativePath=".\archutils\Win32\DialogUtil.cpp" + > + RelativePath=".\archutils\Win32\DialogUtil.h" + > + RelativePath=".\archutils\Win32\ErrorStrings.cpp" + > + RelativePath=".\archutils\Win32\ErrorStrings.h" + > + RelativePath=".\archutils\Win32\GotoURL.cpp" + > + RelativePath=".\archutils\Win32\GotoURL.h" + > + RelativePath=".\archutils\Win32\RegistryAccess.cpp" + > + RelativePath=".\archutils\Win32\RegistryAccess.h" + > + RelativePath=".\archutils\Win32\SpecialDirs.cpp" + > + RelativePath=".\archutils\Win32\SpecialDirs.h" + > + > + > + RelativePath=".\arch\Threads\Threads.h" + > + RelativePath=".\arch\Threads\Threads_Win32.cpp" + > + RelativePath=".\arch\Threads\Threads_Win32.h" + > + > + RelativePath=".\arch\ArchHooks\ArchHooks.h" + > + RelativePath=".\arch\ArchHooks\ArchHooks_Win32.h" + > + RelativePath=".\arch\ArchHooks\ArchHooks_Win32Static.cpp" + > + RelativePath=".\arch\ArchHooks\ArchHooksUtil.cpp" + > + > + RelativePath=".\arch\Dialog\Dialog.cpp" + > + RelativePath=".\arch\Dialog\Dialog.h" + > + RelativePath=".\arch\Dialog\DialogDriver.cpp" + > + RelativePath=".\arch\Dialog\DialogDriver.h" + > + RelativePath=".\arch\Dialog\DialogDriver_Win32.cpp" + > + RelativePath=".\arch\Dialog\DialogDriver_Win32.h" + > + RelativePath=".\arch\Dialog\Selector_Dialog.h" + > + > + RelativePath=".\RageException.cpp" + > + RelativePath=".\RageException.h" + > + RelativePath=".\RageFile.cpp" + > + RelativePath=".\RageFile.h" + > + RelativePath=".\RageFileBasic.cpp" + > + RelativePath=".\RageFileBasic.h" + > + RelativePath=".\RageFileDriver.cpp" + > + RelativePath=".\RageFileDriver.h" + > + RelativePath=".\RageFileDriverDeflate.cpp" + > + RelativePath=".\RageFileDriverDeflate.h" + > + RelativePath=".\RageFileDriverDirect.cpp" + > + RelativePath=".\RageFileDriverDirect.h" + > + RelativePath=".\RageFileDriverDirectHelpers.cpp" + > + RelativePath=".\RageFileDriverDirectHelpers.h" + > + RelativePath=".\RageFileDriverMemory.cpp" + > + RelativePath=".\RageFileDriverMemory.h" + > + RelativePath=".\RageFileDriverSlice.cpp" + > + RelativePath=".\RageFileDriverSlice.h" + > + RelativePath=".\RageFileDriverTimeout.cpp" + > + RelativePath=".\RageFileDriverTimeout.h" + > + RelativePath=".\RageFileDriverZip.cpp" + > + RelativePath=".\RageFileDriverZip.h" + > + RelativePath=".\RageFileManager.cpp" + > + RelativePath=".\RageFileManager.h" + > + RelativePath=".\RageLog.cpp" + > + RelativePath=".\RageLog.h" + > + RelativePath=".\RageThreads.cpp" + > + RelativePath=".\RageThreads.h" + > + RelativePath=".\RageTimer.cpp" + > + RelativePath=".\RageTimer.h" + > + RelativePath=".\RageTypes.cpp" + > + RelativePath=".\RageTypes.h" + > + RelativePath=".\RageUtil.cpp" + > + RelativePath=".\RageUtil.h" + > + RelativePath=".\RageUtil_FileDB.cpp" + > + RelativePath=".\RageUtil_FileDB.h" + > + RelativePath=".\RageUtil_WorkerThread.cpp" + > + RelativePath=".\RageUtil_WorkerThread.h" + > + > + > + RelativePath=".\pcre\get.c" + > + RelativePath=".\pcre\internal.h" + > + RelativePath=".\pcre\maketables.c" + > + RelativePath=".\pcre\pcre.c" + > + RelativePath=".\pcre\pcre.h" + > + RelativePath=".\pcre\study.c" + > + > + RelativePath=".\lua-5.1\src\lapi.c" + > + RelativePath=".\lua-5.1\src\lapi.h" + > + RelativePath=".\lua-5.1\src\lauxlib.c" + > + RelativePath=".\lua-5.1\src\lauxlib.h" + > + RelativePath=".\lua-5.1\src\lbaselib.c" + > + RelativePath=".\lua-5.1\src\lcode.c" + > + RelativePath=".\lua-5.1\src\lcode.h" + > + RelativePath=".\lua-5.1\src\ldblib.c" + > + RelativePath=".\lua-5.1\src\ldebug.c" + > + RelativePath=".\lua-5.1\src\ldebug.h" + > + RelativePath=".\lua-5.1\src\ldo.c" + > + RelativePath=".\lua-5.1\src\ldo.h" + > + RelativePath=".\lua-5.1\src\ldump.c" + > + RelativePath=".\lua-5.1\src\lfunc.c" + > + RelativePath=".\lua-5.1\src\lfunc.h" + > + RelativePath=".\lua-5.1\src\lgc.c" + > + RelativePath=".\lua-5.1\src\lgc.h" + > + RelativePath=".\lua-5.1\src\linit.c" + > + RelativePath=".\lua-5.1\src\liolib.c" + > + RelativePath=".\lua-5.1\src\llex.c" + > + RelativePath=".\lua-5.1\src\llex.h" + > + RelativePath=".\lua-5.1\src\llimits.h" + > + RelativePath=".\lua-5.1\src\lmathlib.c" + > + RelativePath=".\lua-5.1\src\lmem.c" + > + RelativePath=".\lua-5.1\src\lmem.h" + > + RelativePath=".\lua-5.1\src\loadlib.c" + > + RelativePath=".\lua-5.1\src\lobject.c" + > + RelativePath=".\lua-5.1\src\lobject.h" + > + RelativePath=".\lua-5.1\src\lopcodes.c" + > + RelativePath=".\lua-5.1\src\lopcodes.h" + > + RelativePath=".\lua-5.1\src\loslib.c" + > + RelativePath=".\lua-5.1\src\lparser.c" + > + RelativePath=".\lua-5.1\src\lparser.h" + > + RelativePath=".\lua-5.1\src\lstate.c" + > + RelativePath=".\lua-5.1\src\lstate.h" + > + RelativePath=".\lua-5.1\src\lstring.c" + > + RelativePath=".\lua-5.1\src\lstring.h" + > + RelativePath=".\lua-5.1\src\lstrlib.c" + > + RelativePath=".\lua-5.1\src\ltable.c" + > + RelativePath=".\lua-5.1\src\ltable.h" + > + RelativePath=".\lua-5.1\src\ltablib.c" + > + RelativePath=".\lua-5.1\src\ltm.c" + > + RelativePath=".\lua-5.1\src\ltm.h" + > + RelativePath=".\lua-5.1\src\lua.h" + > + RelativePath=".\lua-5.1\src\luaconf.h" + > + RelativePath=".\lua-5.1\src\lualib.h" + > + RelativePath=".\lua-5.1\src\lundump.c" + > + RelativePath=".\lua-5.1\src\lundump.h" + > + RelativePath=".\lua-5.1\src\lvm.c" + > + RelativePath=".\lua-5.1\src\lvm.h" + > + RelativePath=".\lua-5.1\src\lzio.c" + > + RelativePath=".\lua-5.1\src\lzio.h" + > + > + RelativePath=".\CsvFile.cpp" + > + RelativePath=".\CsvFile.h" + > + RelativePath=".\IniFile.cpp" + > + RelativePath=".\IniFile.h" + > + RelativePath=".\XmlFile.cpp" + > + RelativePath=".\XmlFile.h" + > + RelativePath=".\XmlFileUtil.cpp" + > + RelativePath=".\XmlFileUtil.h" + > + > + RelativePath=".\Command.cpp" + > + RelativePath=".\Command.h" + > + RelativePath=".\DateTime.cpp" + > + RelativePath=".\DateTime.h" + > + RelativePath=".\EnumHelper.cpp" + > + RelativePath=".\EnumHelper.h" + > + RelativePath=".\FontCharAliases.cpp" + > + RelativePath=".\FontCharAliases.h" + > + RelativePath=".\LocalizedString.cpp" + > + RelativePath=".\LocalizedString.h" + > + RelativePath=".\LuaBinding.cpp" + > + RelativePath=".\LuaBinding.h" + > + RelativePath=".\LuaReference.cpp" + > + RelativePath=".\LuaReference.h" + > + RelativePath=".\ThemeMetric.h" + > + > + RelativePath=".\LuaManager.cpp" + > + RelativePath=".\LuaManager.h" + > + RelativePath=".\ThemeManager.cpp" + > + RelativePath=".\ThemeManager.h" + > + RelativePath=".\smpackage\header.bmp" + > + RelativePath=".\smpackage\install.bmp" + > + RelativePath=".\smpackage\manage.bmp" + > + RelativePath=".\smpackage\menu.bmp" + > + RelativePath=".\smpackage\smpackage.ICO" + > + Value="smpackage\smpackage.rc" + /> diff --git a/src/smpackage/ZipArchive/StdAfx.h b/src/smpackage/ZipArchive/StdAfx.h index 954d9e8dcc..388ff789e1 100644 --- a/src/smpackage/ZipArchive/StdAfx.h +++ b/src/smpackage/ZipArchive/StdAfx.h @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////// // $Workfile: stdafx.h $ // $Archive: /ZipArchive/stdafx.h $ -// $Date: 2006-01-20 13:43:41 -0600 (Fri, 20 Jan 2006) $ $Author: gmaynard $ +// $Date: 2003-07-21 21:10:30 -0500 (Mon, 21 Jul 2003) $ $Author: gmaynard $ //////////////////////////////////////////////////////////////////////////////// // This source file is part of the ZipArchive library source distribution and // is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/) @@ -38,20 +38,10 @@ #define ZIP_ARCHIVE_MFC -#if defined(_DEBUG) -#undef _DEBUG -#define RESTORE_DEBUG -#endif - #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include #include -#if defined(RESTORE_DEBUG) -#undef RESTORE_DEBUG -#define _DEBUG -#endif - //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/src/smpackage/ZipArchive/ZipArchive-net2003.vcproj b/src/smpackage/ZipArchive/ZipArchive-net2003.vcproj index 0770070d68..dc15524a56 100644 --- a/src/smpackage/ZipArchive/ZipArchive-net2003.vcproj +++ b/src/smpackage/ZipArchive/ZipArchive-net2003.vcproj @@ -1,33 +1,53 @@ + Keyword="MFCProj" + TargetFrameworkVersion="131072" + > + Name="Win32" + /> + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Debug\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Release\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + > + + + + + + SuppressStartupBanner="true" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Unicode_Static_Release\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Static_Release\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Unicode_Debug\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Static_Debug\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + > + + + + + + SuppressStartupBanner="true" + /> - - - - - + Name="VCManagedResourceCompilerTool" + /> + Culture="1033" + /> + Name="VCPreLinkEventTool" + /> + Name="VCLibrarianTool" + OutputFile=".\Unicode_Release\ZipArchive.lib" + SuppressStartupBanner="true" + /> + Name="VCALinkTool" + /> + Name="VCXDCMakeTool" + /> + + + @@ -378,905 +542,1142 @@ + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + RelativePath="StdAfx.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + UsePrecompiledHeader="1" + /> + Name="Unicode Static Release|Win32" + > + UsePrecompiledHeader="1" + /> + Name="Static Release|Win32" + > + UsePrecompiledHeader="1" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + UsePrecompiledHeader="1" + /> + RelativePath="ZipArchive.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipAutoBuffer.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipCentralDir.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipCompatibility.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipException.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipFile.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipFileHeader.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipMemFile.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipPathComponent.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipPlatform.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipPlatformComm.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipStorage.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + RelativePath="ZipString.cpp" + > + Name="Debug|Win32" + > + BrowseInformation="1" + /> + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Static Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Name="Static Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Unicode Debug|Win32" + > + BrowseInformation="1" + /> + Name="Static Debug|Win32" + > + BrowseInformation="1" + /> + Name="Unicode Release|Win32" + > + PreprocessorDefinitions="NDEBUG;_AFXDLL;_UNICODE;ZLIB_DLL;WIN32;_WINDOWS;ZIP_ARCHIVE_MFC_PROJ;PKZIP_BUG_WORKAROUND;$(NoInherit)" + /> + Filter="h;hpp;hxx;hm;inl" + > + RelativePath="StdAfx.h" + > + RelativePath="ZipAbstractFile.h" + > + RelativePath="ZipArchive.h" + > + RelativePath="ZipAutoBuffer.h" + > + RelativePath="ZipBaseException.h" + > + RelativePath="ZipCentralDir.h" + > + RelativePath="ZipCollections.h" + > + RelativePath="ZipCompatibility.h" + > + RelativePath="ZipException.h" + > + RelativePath="ZipExport.h" + > + RelativePath="ZipFile.h" + > + RelativePath="ZipFileHeader.h" + > + RelativePath="ZipFileMapping.h" + > + RelativePath="ZipMemFile.h" + > + RelativePath="ZipPathComponent.h" + > + RelativePath="ZipPlatform.h" + > + RelativePath="ZipStorage.h" + > + RelativePath="ZipString.h" + > + Filter="txt" + > + RelativePath="Appnote.txt" + > + RelativePath="ChangeLog.txt" + > + RelativePath="faq.txt" + > + RelativePath="gpl.txt" + > + RelativePath="License.txt" + > + RelativePath="Readme.txt" + > diff --git a/src/smpackage/ZipArchive/__Windows_MFC.zcfg b/src/smpackage/ZipArchive/__Windows_MFC.zcfg index e69de29bb2..e00a2183a5 100644 --- a/src/smpackage/ZipArchive/__Windows_MFC.zcfg +++ b/src/smpackage/ZipArchive/__Windows_MFC.zcfg @@ -0,0 +1 @@ +Windows MFC