diff options
author | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-05 19:49:10 +0000 |
---|---|---|
committer | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-05 19:49:10 +0000 |
commit | 47da0a4d8f298bc3bc32e19242aa2d714e2c5ebc (patch) | |
tree | efa0cb63cc3b4fa6bd04d6b099bd2c3295454a23 /Game/Code | |
parent | 133792f09b6f6deffa8805395a04dfddb6359991 (diff) | |
download | usdx-47da0a4d8f298bc3bc32e19242aa2d714e2c5ebc.tar.gz usdx-47da0a4d8f298bc3bc32e19242aa2d714e2c5ebc.tar.xz usdx-47da0a4d8f298bc3bc32e19242aa2d714e2c5ebc.zip |
Fixed compilation on the mac: Function Ptr() does not exist. Please use the Pointer() cast. Changed function StartParty.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@588 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
-rw-r--r-- | Game/Code/Classes/UParty.pas | 1227 | ||||
-rw-r--r-- | Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.mode1 | 92 | ||||
-rw-r--r-- | Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.pbxuser | 166 | ||||
-rw-r--r-- | Game/Code/MacOSX/UltraStarDX.xcodeproj/project.pbxproj | 6 |
4 files changed, 747 insertions, 744 deletions
diff --git a/Game/Code/Classes/UParty.pas b/Game/Code/Classes/UParty.pas index 1db8f3e1..3fc52b8e 100644 --- a/Game/Code/Classes/UParty.pas +++ b/Game/Code/Classes/UParty.pas @@ -1,613 +1,614 @@ -unit UParty;
-
-interface
-
-{$IFDEF FPC}
- {$MODE DELPHI}
-{$ENDIF}
-
-{$I switches.inc}
-
-uses UPartyDefs, UCoreModule, UPluginDefs;
-
-type
- ARounds = Array [0..252] of Integer; //0..252 needed for
- PARounds = ^ARounds;
-
- TRoundInfo = record
- Modi: Cardinal;
- Winner: Byte;
- end;
-
- TeamOrderEntry = record
- Teamnum: Byte;
- Score: Byte;
- end;
-
- TeamOrderArray = Array[0..5] of Byte;
-
- TUS_ModiInfoEx = record
- Info: TUS_ModiInfo;
- Owner: Integer;
- TimesPlayed: Byte; //Helper for setting Round Plugins
- end;
-
- TPartySession = class (TCoreModule)
- private
- bPartyMode: Boolean; //Is this Party or Singleplayer
- CurRound: Byte;
-
- Modis: Array of TUS_ModiInfoEx;
- Teams: TTeamInfo;
-
- function IsWinner(Player, Winner: Byte): boolean;
- procedure GenScores;
- function GetRandomPlugin(TeamMode: Boolean): Cardinal;
- function GetRandomPlayer(Team: Byte): Byte;
- public
- //Teams: TTeamInfo;
- Rounds: array of TRoundInfo;
-
- //TCoreModule methods to inherit
- Constructor Create; override;
- Procedure Info(const pInfo: PModuleInfo); override;
- Function Load: Boolean; override;
- Function Init: Boolean; override;
- Procedure DeInit; override;
- Procedure Free; override;
-
- //Register Modi Service
- Function RegisterModi(pModiInfo, nothin: DWord): integer; //Registers a new Modi. wParam: Pointer to TUS_ModiInfo
-
- //Start new Party
- Function StartParty(NumRounds, PAofIRounds: DWord): integer; //Starts new Party Mode. Returns Non Zero on Success
- Function GetCurModi(wParam, lParam: DWord): integer; //Returns Pointer to Cur. Modis TUS_ModiInfo (to Use with Singscreen)
- Function StopParty(wParam, lParam: DWord): integer; //Stops Party Mode. Returns 1 If Partymode was enabled before.
- Function NextRound(wParam, lParam: DWord): integer; //Increases CurRound by 1; Returns num of Round or -1 if last Round is already played
-
- Function CallModiInit(wParam, lParam: DWord): integer; //Calls CurModis Init Proc. If an Error occurs, Returns Nonzero. In this Case a New Plugin was Selected. Please renew Loading
- Function CallModiDeInit(wParam, lParam: DWord): integer; //Calls DeInitProc and does the RoundEnding
-
- Function GetTeamInfo(wParam, pTeamInfo: DWord): integer; //Writes TTeamInfo Record to Pointer at lParam. Returns Zero on Success
- Function SetTeamInfo(wParam, pTeamInfo: DWord): integer; //Read TTeamInfo Record from Pointer at lParam. Returns Zero on Success
-
- Function GetTeamOrder(wParam, lParam: DWord): integer; //Returns Team Order. Structure: Bits 1..3: Team at Place1; Bits 4..6: Team at Place2 ...
- Function GetWinnerString(wParam, lParam: DWord): integer; //wParam is Roundnum. If (Pointer = nil) then Return Length of the String. Otherwise Write the String to Address at lParam
- end;
-
-const
- StandardModi = 0; //Modi ID that will be played in non party Mode
-
-implementation
-
-uses UCore, UGraphic, UMain, ULanguage, ULog, SysUtils;
-
-{*********************
- TPluginLoader
- Implentation
-*********************}
-
-//-------------
-// Function that gives some Infos about the Module to the Core
-//-------------
-Procedure TPartySession.Info(const pInfo: PModuleInfo);
-begin
- pInfo^.Name := 'TPartySession';
- pInfo^.Version := MakeVersion(1,0,0,chr(0));
- pInfo^.Description := 'Manages Party Modi and Party Game';
-end;
-
-//-------------
-// Just the Constructor
-//-------------
-Constructor TPartySession.Create;
-begin
- //UnSet PartyMode
- bPartyMode := False;
-end;
-
-//-------------
-//Is Called on Loading.
-//In this Method only Events and Services should be created
-//to offer them to other Modules or Plugins during the Init process
-//If False is Returned this will cause a Forced Exit
-//-------------
-Function TPartySession.Load: Boolean;
-begin
- //Add Register Party Modi Service
- Result := True;
- Core.Services.AddService('Party/RegisterModi', nil, Self.RegisterModi);
- Core.Services.AddService('Party/StartParty', nil, Self.StartParty);
- Core.Services.AddService('Party/GetCurModi', nil, Self.GetCurModi);
-end;
-
-//-------------
-//Is Called on Init Process
-//In this Method you can Hook some Events and Create + Init
-//your Classes, Variables etc.
-//If False is Returned this will cause a Forced Exit
-//-------------
-Function TPartySession.Init: Boolean;
-begin
- //Just set Prvate Var to true.
- Result := true;
-end;
-
-//-------------
-//Is Called if this Module has been Inited and there is a Exit.
-//Deinit is in backwards Initing Order
-//-------------
-Procedure TPartySession.DeInit;
-begin
- //Force DeInit
-
-end;
-
-//-------------
-//Is Called if this Module will be unloaded and has been created
-//Should be used to Free Memory
-//-------------
-Procedure TPartySession.Free;
-begin
- //Just save some Memory if it wasn't done now..
- SetLength(Modis, 0);
-end;
-
-//-------------
-// Registers a new Modi. wParam: Pointer to TUS_ModiInfo
-// Service for Plugins
-//-------------
-Function TPartySession.RegisterModi(pModiInfo, nothin: DWord): integer;
-var
- Len: Integer;
- Info: PUS_ModiInfo;
-begin
- Info := ptr(PModiInfo);
- //Copy Info if cbSize is correct
- If (Info.cbSize = SizeOf(TUS_ModiInfo)) then
- begin
- Len := Length(Modis);
- SetLength(Modis, Len + 1);
-
- Modis[Len].Info := Info^;
- end
- else
- Core.ReportError(Integer(PChar('Plugins try to Register Modi with wrong Pointer, or wrong TUS_ModiInfo Record.')), Integer(PChar('TPartySession')));
-end;
-
-//----------
-// Returns a Number of a Random Plugin
-//----------
-Function TPartySession.GetRandomPlugin(TeamMode: Boolean): Cardinal;
-var
- LowestTP: Byte;
- NumPwithLTP: Word;
- I: Integer;
- R: Word;
-begin
- Result := StandardModi; //If there are no matching Modis, Play StandardModi
- LowestTP := high(Byte);
- NumPwithLTP := 0;
-
- //Search for Plugins not often played yet
- For I := 0 to high(Modis) do
- begin
- if (Modis[I].TimesPlayed < lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then
- begin
- lowestTP := Modis[I].TimesPlayed;
- NumPwithLTP := 1;
- end
- else if (Modis[I].TimesPlayed = lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then
- begin
- Inc(NumPwithLTP);
- end;
- end;
-
- //Create Random No
- R := Random(NumPwithLTP);
-
- //Search for Random Plugin
- For I := 0 to high(Modis) do
- begin
- if (Modis[I].TimesPlayed = lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then
- begin
- //Plugin Found
- if (R = 0) then
- begin
- Result := I;
- Inc(Modis[I].TimesPlayed);
- Break;
- end;
-
- Dec(R);
- end;
- end;
-end;
-
-//----------
-// Starts new Party Mode. Returns Non Zero on Success
-//----------
-Function TPartySession.StartParty(NumRounds, PAofIRounds: DWord): integer;
-var
- I: Integer;
- aiRounds: PARounds;
- TeamMode: Boolean;
-begin
- Result := 0;
- If (Teams.NumTeams >= 1) AND (NumRounds < High(Byte)-1) then
- begin
- bPartyMode := false;
- aiRounds := Ptr(PAofIRounds);
-
- Try
- //Is this Teammode(More then one Player per Team) ?
- TeamMode := True;
- For I := 0 to Teams.NumTeams-1 do
- TeamMode := TeamMode AND (Teams.Teaminfo[I].NumPlayers > 1);
-
- For I := 0 to High(NumRounds) do
- begin //Set Plugins
- If (aiRounds[I] = -1) then
- Rounds[I].Modi := GetRandomPlugin(TeamMode)
- Else If (aiRounds[I] >= 0) AND (aiRounds[I] <= High(Modis)) AND (TeamMode OR ((Modis[aiRounds[I]].Info.LoadingSettings AND MLS_TeamOnly) = 0)) then
- Rounds[I].Modi := aiRounds[I]
- Else
- Rounds[I].Modi := StandardModi;
-
- Rounds[I].Winner := High(Byte); //Set Winner to Not Played
- end;
-
- CurRound := High(Byte); //Set CurRound to not defined
-
- //Return teh true and Set PartyMode
- bPartyMode := True;
- Result := 1;
-
- Except
- Core.ReportError(Integer(PChar('Can''t start PartyMode.')), Integer(PChar('TPartySession')));
- end;
- end;
-end;
-
-//----------
-// Returns Pointer to Cur. ModiInfoEx (to Use with Singscreen)
-//----------
-Function TPartySession.GetCurModi(wParam, lParam: DWord): integer;
-begin
- If (bPartyMode) AND (CurRound <= High(Rounds)) then
- begin //If PartyMode is enabled:
- //Return the Plugin of the Cur Round
- Result := Integer(@Modis[Rounds[CurRound].Modi]);
- end
- else
- begin //Return StandardModi
- Result := Integer(@Modis[StandardModi]);
- end;
-end;
-
-//----------
-// Stops Party Mode. Returns 1 If Partymode was enabled before. And -1 if Change was not possible
-//----------
-Function TPartySession.StopParty(wParam, lParam: DWord): integer;
-begin
- Result := -1;
- If (bPartyMode) then
- begin
- // to-do : Whitü: Check here if SingScreen is not Shown atm.
- bPartyMode := False;
- Result := 1;
- end
- else
- Result := 0;
-end;
-
-//----------
-//GetRandomPlayer - Gives back a Random Player to Play next Round
-//----------
-function TPartySession.GetRandomPlayer(Team: Byte): Byte;
-var
- I, R: Integer;
- lowestTP: Byte;
- NumPwithLTP: Byte;
-begin
- LowestTP := high(Byte);
- NumPwithLTP := 0;
- Result := 0;
-
- //Search for Players that have not often played yet
- For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do
- begin
- if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed < lowestTP) then
- begin
- lowestTP := Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed;
- NumPwithLTP := 1;
- end
- else if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP) then
- begin
- Inc(NumPwithLTP);
- end;
- end;
-
- //Create Random No
- R := Random(NumPwithLTP);
-
- //Search for Random Player
- For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do
- begin
- if Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP then
- begin
- //Player Found
- if (R = 0) then
- begin
- Result := I;
- Break;
- end;
-
- Dec(R);
- end;
- end;
-end;
-
-//----------
-// NextRound - Increases CurRound by 1; Returns num of Round or -1 if last Round is already played
-//----------
-Function TPartySession.NextRound(wParam, lParam: DWord): integer;
-var I: Integer;
-begin
- If ((CurRound < high(Rounds)) OR (CurRound = high(CurRound))) then
- begin //everythings OK! -> Start the Round, maaaaan
- Inc(CurRound);
-
- //Set Players to play this Round
- for I := 0 to Teams.NumTeams-1 do
- Teams.Teaminfo[I].CurPlayer := GetRandomPlayer(I);
- end
- else
- Result := -1;
-end;
-
-//----------
-//IsWinner - Returns True if the Players Bit is set in the Winner Byte
-//----------
-function TPartySession.IsWinner(Player, Winner: Byte): boolean;
-var
- Bit: Byte;
-begin
- Bit := 1 shl Player;
-
- Result := ((Winner AND Bit) = Bit);
-end;
-
-//----------
-//GenScores - Inc Scores for Cur. Round
-//----------
-procedure TPartySession.GenScores;
-var
- I: Byte;
-begin
- for I := 0 to Teams.NumTeams-1 do
- begin
- if isWinner(I, Rounds[CurRound].Winner) then
- Inc(Teams.Teaminfo[I].Score);
- end;
-end;
-
-//----------
-// CallModiInit - Calls CurModis Init Proc. If an Error occurs, Returns Nonzero. In this Case a New Plugin was Selected. Please renew Loading
-//----------
-Function TPartySession.CallModiInit(wParam, lParam: DWord): integer;
-begin
- If (not bPartyMode) then
- begin //Set Rounds if not in PartyMode
- SetLength(Rounds, 1);
- Rounds[0].Modi := StandardModi;
- Rounds[0].Winner := High(Byte);
- CurRound := 0;
- end;
-
- Try
- //Core.
- Except
- on E : Exception do
- begin
- Core.ReportError(Integer(PChar('Error starting Modi: ' + Modis[Rounds[CurRound].Modi].Info.Name + ' ErrorStr: ' + E.Message)), Integer(PChar('TPartySession')));
- If (Rounds[CurRound].Modi = StandardModi) then
- begin
- Core.ReportError(Integer(PChar('Can''t start StandardModi, will exit now!')), Integer(PChar('TPartySession')));
- Halt;
- end
- Else //Select StandardModi
- begin
- Rounds[CurRound].Modi := StandardModi
- end;
- end;
- End;
-end;
-
-//----------
-// CallModiDeInit - Calls DeInitProc and does the RoundEnding
-//----------
-Function TPartySession.CallModiDeInit(wParam, lParam: DWord): integer;
-var
- I: Integer;
- MaxScore: Word;
-begin
- If (bPartyMode) then
- begin
- //Get Winner Byte!
- if (@Modis[Rounds[CurRound].Modi].Info.ModiDeInit <> nil) then //get Winners from Plugin
- Rounds[CurRound].Winner := Modis[Rounds[CurRound].Modi].Info.ModiDeInit(Modis[Rounds[CurRound].Modi].Info.ID)
- else
- begin //Create winners by Score :/
- Rounds[CurRound].Winner := 0;
- MaxScore := 0;
- for I := 0 to Teams.NumTeams-1 do
- begin
- // to-do : recode Percentage stuff
- //PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
- if (Player[I].ScoreTotalI > MaxScore) then
- begin
- MaxScore := Player[I].ScoreTotalI;
- Rounds[CurRound].Winner := 1 shl I;
- end
- else if (Player[I].ScoreTotalI = MaxScore) AND (Player[I].ScoreTotalI <> 0) then
- begin
- Rounds[CurRound].Winner := Rounds[CurRound].Winner or (1 shl I);
- end;
- end;
-
-
- //When nobody has Points -> Everybody loose
- if (MaxScore = 0) then
- Rounds[CurRound].Winner := 0;
-
- end;
-
- //Generate teh Scores
- GenScores;
-
- //Inc Players TimesPlayed
- If ((Modis[Rounds[CurRound-1].Modi].Info.LoadingSettings AND MLS_IncTP) = MLS_IncTP) then
- begin
- For I := 0 to Teams.NumTeams-1 do
- Inc(Teams.TeamInfo[I].Playerinfo[Teams.TeamInfo[I].CurPlayer].TimesPlayed);
- end;
- end
- else if (@Modis[Rounds[CurRound].Modi].Info.ModiDeInit <> nil) then
- Modis[Rounds[CurRound].Modi].Info.ModiDeInit(Modis[Rounds[CurRound].Modi].Info.ID);
-end;
-
-//----------
-// GetTeamInfo - Writes TTeamInfo Record to Pointer at lParam. Returns Zero on Success
-//----------
-Function TPartySession.GetTeamInfo(wParam, pTeamInfo: DWord): integer;
-var Info: ^TTeamInfo;
-begin
- Result := -1;
- Info := ptr(pTeamInfo);
- If (Info <> nil) then
- begin
- Try
- // to - do : Check Delphi memory management in this case
- //Not sure if i had to copy PChars to a new address or if delphi manages this o0
- Info^ := Teams;
- Result := 0;
- Except
- Result := -2;
- End;
- end;
-end;
-
-//----------
-// SetTeamInfo - Read TTeamInfo Record from Pointer at lParam. Returns Zero on Success
-//----------
-Function TPartySession.SetTeamInfo(wParam, pTeamInfo: DWord): integer;
-var
- TeamInfobackup: TTeamInfo;
- Info: ^TTeamInfo;
-begin
- Result := -1;
- Info := ptr(pTeamInfo);
- If (Info <> nil) then
- begin
- Try
- TeamInfoBackup := Teams;
- // to - do : Check Delphi memory management in this case
- //Not sure if i had to copy PChars to a new address or if delphi manages this o0
- Teams := Info^;
- Result := 0;
- Except
- Teams := TeamInfoBackup;
- Result := -2;
- End;
- end;
-end;
-
-//----------
-// GetTeamOrder - Returns Team Order. Structure: Bits 1..3: Team at Place1; Bits 4..6: Team at Place2 ...
-//----------
-Function TPartySession.GetTeamOrder(wParam, lParam: DWord): integer;
-var
- I, J: Integer;
- ATeams: array [0..5] of TeamOrderEntry;
- TempTeam: TeamOrderEntry;
-begin
- // to-do : PartyMode: Write this in another way, so that teams with the same scire get the same Placing
- //Fill Team Array
- For I := 0 to Teams.NumTeams-1 do
- begin
- ATeams[I].Teamnum := I;
- ATeams[I].Score := Teams.Teaminfo[I].Score;
- end;
-
- //Sort Teams
- for J := 0 to Teams.NumTeams-1 do
- for I := 1 to Teams.NumTeams-1 do
- if ATeams[I].Score > ATeams[I-1].Score then
- begin
- TempTeam := ATeams[I-1];
- ATeams[I-1] := ATeams[I];
- ATeams[I] := TempTeam;
- end;
-
- //Copy to Result
- Result := 0;
- For I := 0 to Teams.NumTeams-1 do
- Result := Result or (ATeams[I].TeamNum Shl I*3);
-end;
-
-//----------
-// GetWinnerString - wParam is Roundnum. If (Pointer = nil) then Return Length of the String. Otherwise Write the String to Address at lParam
-//----------
-Function TPartySession.GetWinnerString(wParam, lParam: DWord): integer;
-var
- Winners: Array of String;
- I: Integer;
- ResultStr: String;
- S: ^String;
-begin
- ResultStr := Language.Translate('PARTY_NOBODY');
-
- if (wParam <= High(Rounds)) then
- begin
- if (Rounds[wParam].Winner <> 0) then
- begin
- if (Rounds[wParam].Winner = 255) then
- begin
- ResultStr := Language.Translate('PARTY_NOTPLAYEDYET');
- end
- else
- begin
- SetLength(Winners, 0);
- for I := 0 to Teams.NumTeams-1 do
- begin
- if isWinner(I, Rounds[wParam].Winner) then
- begin
- SetLength(Winners, Length(Winners) + 1);
- Winners[high(Winners)] := Teams.TeamInfo[I].Name;
- end;
- end;
- ResultStr := Language.Implode(Winners);
- end;
- end;
- end;
-
- //Now Return what we have got
- If (ptr(lParam) = nil) then
- begin //ReturnString Length
- Result := Length(ResultStr);
- end
- Else
- begin //Return String
- Try
- S := Ptr(lParam);
- S^ := ResultStr;
- Result := 0;
- Except
- Result := -1;
-
- End;
- end;
-end;
-
-end.
+unit UParty; + +interface + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + +{$I switches.inc} + +uses UPartyDefs, UCoreModule, UPluginDefs; + +type + ARounds = Array [0..252] of Integer; //0..252 needed for + PARounds = ^ARounds; + + TRoundInfo = record + Modi: Cardinal; + Winner: Byte; + end; + + TeamOrderEntry = record + Teamnum: Byte; + Score: Byte; + end; + + TeamOrderArray = Array[0..5] of Byte; + + TUS_ModiInfoEx = record + Info: TUS_ModiInfo; + Owner: Integer; + TimesPlayed: Byte; //Helper for setting Round Plugins + end; + + TPartySession = class (TCoreModule) + private + bPartyMode: Boolean; //Is this Party or Singleplayer + CurRound: Byte; + + Modis: Array of TUS_ModiInfoEx; + Teams: TTeamInfo; + + function IsWinner(Player, Winner: Byte): boolean; + procedure GenScores; + function GetRandomPlugin(TeamMode: Boolean): Cardinal; + function GetRandomPlayer(Team: Byte): Byte; + public + //Teams: TTeamInfo; + Rounds: array of TRoundInfo; + + //TCoreModule methods to inherit + Constructor Create; override; + Procedure Info(const pInfo: PModuleInfo); override; + Function Load: Boolean; override; + Function Init: Boolean; override; + Procedure DeInit; override; + Procedure Free; override; + + //Register Modi Service + Function RegisterModi(pModiInfo, nothin: DWord): integer; //Registers a new Modi. wParam: Pointer to TUS_ModiInfo + + //Start new Party + Function StartParty(NumRounds, PAofIRounds: DWord): integer; //Starts new Party Mode. Returns Non Zero on Success + Function GetCurModi(wParam, lParam: DWord): integer; //Returns Pointer to Cur. Modis TUS_ModiInfo (to Use with Singscreen) + Function StopParty(wParam, lParam: DWord): integer; //Stops Party Mode. Returns 1 If Partymode was enabled before. + Function NextRound(wParam, lParam: DWord): integer; //Increases CurRound by 1; Returns num of Round or -1 if last Round is already played + + Function CallModiInit(wParam, lParam: DWord): integer; //Calls CurModis Init Proc. If an Error occurs, Returns Nonzero. In this Case a New Plugin was Selected. Please renew Loading + Function CallModiDeInit(wParam, lParam: DWord): integer; //Calls DeInitProc and does the RoundEnding + + Function GetTeamInfo(wParam, pTeamInfo: DWord): integer; //Writes TTeamInfo Record to Pointer at lParam. Returns Zero on Success + Function SetTeamInfo(wParam, pTeamInfo: DWord): integer; //Read TTeamInfo Record from Pointer at lParam. Returns Zero on Success + + Function GetTeamOrder(wParam, lParam: DWord): integer; //Returns Team Order. Structure: Bits 1..3: Team at Place1; Bits 4..6: Team at Place2 ... + Function GetWinnerString(wParam, lParam: DWord): integer; //wParam is Roundnum. If (Pointer = nil) then Return Length of the String. Otherwise Write the String to Address at lParam + end; + +const + StandardModi = 0; //Modi ID that will be played in non party Mode + +implementation + +uses UCore, UGraphic, UMain, ULanguage, ULog, SysUtils; + +{********************* + TPluginLoader + Implentation +*********************} + +//------------- +// Function that gives some Infos about the Module to the Core +//------------- +Procedure TPartySession.Info(const pInfo: PModuleInfo); +begin + pInfo^.Name := 'TPartySession'; + pInfo^.Version := MakeVersion(1,0,0,chr(0)); + pInfo^.Description := 'Manages Party Modi and Party Game'; +end; + +//------------- +// Just the Constructor +//------------- +Constructor TPartySession.Create; +begin + //UnSet PartyMode + bPartyMode := False; +end; + +//------------- +//Is Called on Loading. +//In this Method only Events and Services should be created +//to offer them to other Modules or Plugins during the Init process +//If False is Returned this will cause a Forced Exit +//------------- +Function TPartySession.Load: Boolean; +begin + //Add Register Party Modi Service + Result := True; + Core.Services.AddService('Party/RegisterModi', nil, Self.RegisterModi); + Core.Services.AddService('Party/StartParty', nil, Self.StartParty); + Core.Services.AddService('Party/GetCurModi', nil, Self.GetCurModi); +end; + +//------------- +//Is Called on Init Process +//In this Method you can Hook some Events and Create + Init +//your Classes, Variables etc. +//If False is Returned this will cause a Forced Exit +//------------- +Function TPartySession.Init: Boolean; +begin + //Just set Prvate Var to true. + Result := true; +end; + +//------------- +//Is Called if this Module has been Inited and there is a Exit. +//Deinit is in backwards Initing Order +//------------- +Procedure TPartySession.DeInit; +begin + //Force DeInit + +end; + +//------------- +//Is Called if this Module will be unloaded and has been created +//Should be used to Free Memory +//------------- +Procedure TPartySession.Free; +begin + //Just save some Memory if it wasn't done now.. + SetLength(Modis, 0); +end; + +//------------- +// Registers a new Modi. wParam: Pointer to TUS_ModiInfo +// Service for Plugins +//------------- +Function TPartySession.RegisterModi(pModiInfo, nothin: DWord): integer; +var + Len: Integer; + Info: PUS_ModiInfo; +begin + Info := Pointer(PModiInfo); + //Copy Info if cbSize is correct + If (Info.cbSize = SizeOf(TUS_ModiInfo)) then + begin + Len := Length(Modis); + SetLength(Modis, Len + 1); + + Modis[Len].Info := Info^; + end + else + Core.ReportError(Integer(PChar('Plugins try to Register Modi with wrong Pointer, or wrong TUS_ModiInfo Record.')), Integer(PChar('TPartySession'))); +end; + +//---------- +// Returns a Number of a Random Plugin +//---------- +Function TPartySession.GetRandomPlugin(TeamMode: Boolean): Cardinal; +var + LowestTP: Byte; + NumPwithLTP: Word; + I: Integer; + R: Word; +begin + Result := StandardModi; //If there are no matching Modis, Play StandardModi + LowestTP := high(Byte); + NumPwithLTP := 0; + + //Search for Plugins not often played yet + For I := 0 to high(Modis) do + begin + if (Modis[I].TimesPlayed < lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then + begin + lowestTP := Modis[I].TimesPlayed; + NumPwithLTP := 1; + end + else if (Modis[I].TimesPlayed = lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then + begin + Inc(NumPwithLTP); + end; + end; + + //Create Random No + R := Random(NumPwithLTP); + + //Search for Random Plugin + For I := 0 to high(Modis) do + begin + if (Modis[I].TimesPlayed = lowestTP) And (((Modis[I].Info.LoadingSettings AND MLS_TeamOnly) <> 0) = TeamMode) then + begin + //Plugin Found + if (R = 0) then + begin + Result := I; + Inc(Modis[I].TimesPlayed); + Break; + end; + + Dec(R); + end; + end; +end; + +//---------- +// Starts new Party Mode. Returns Non Zero on Success +//---------- +Function TPartySession.StartParty(NumRounds, PAofIRounds: DWord): integer; +var + I: Integer; + aiRounds: PARounds; + TeamMode: Boolean; +begin + Result := 0; + If (Teams.NumTeams >= 1) AND (NumRounds < High(Byte)-1) then + begin + bPartyMode := false; + aiRounds := Pointer(PAofIRounds); + + Try + //Is this Teammode(More then one Player per Team) ? + TeamMode := True; + For I := 0 to Teams.NumTeams-1 do + TeamMode := TeamMode AND (Teams.Teaminfo[I].NumPlayers > 1); + + // For I := 0 to High(NumRounds) do // eddie: changed NumRounds to Rounds - is this correct ??? I get compile errors on the mac otherwise... + For I := 0 to High(Rounds) do + begin //Set Plugins + If (aiRounds[I] = -1) then + Rounds[I].Modi := GetRandomPlugin(TeamMode) + Else If (aiRounds[I] >= 0) AND (aiRounds[I] <= High(Modis)) AND (TeamMode OR ((Modis[aiRounds[I]].Info.LoadingSettings AND MLS_TeamOnly) = 0)) then + Rounds[I].Modi := aiRounds[I] + Else + Rounds[I].Modi := StandardModi; + + Rounds[I].Winner := High(Byte); //Set Winner to Not Played + end; + + CurRound := High(Byte); //Set CurRound to not defined + + //Return teh true and Set PartyMode + bPartyMode := True; + Result := 1; + + Except + Core.ReportError(Integer(PChar('Can''t start PartyMode.')), Integer(PChar('TPartySession'))); + end; + end; +end; + +//---------- +// Returns Pointer to Cur. ModiInfoEx (to Use with Singscreen) +//---------- +Function TPartySession.GetCurModi(wParam, lParam: DWord): integer; +begin + If (bPartyMode) AND (CurRound <= High(Rounds)) then + begin //If PartyMode is enabled: + //Return the Plugin of the Cur Round + Result := Integer(@Modis[Rounds[CurRound].Modi]); + end + else + begin //Return StandardModi + Result := Integer(@Modis[StandardModi]); + end; +end; + +//---------- +// Stops Party Mode. Returns 1 If Partymode was enabled before. And -1 if Change was not possible +//---------- +Function TPartySession.StopParty(wParam, lParam: DWord): integer; +begin + Result := -1; + If (bPartyMode) then + begin + // to-do : Whitü: Check here if SingScreen is not Shown atm. + bPartyMode := False; + Result := 1; + end + else + Result := 0; +end; + +//---------- +//GetRandomPlayer - Gives back a Random Player to Play next Round +//---------- +function TPartySession.GetRandomPlayer(Team: Byte): Byte; +var + I, R: Integer; + lowestTP: Byte; + NumPwithLTP: Byte; +begin + LowestTP := high(Byte); + NumPwithLTP := 0; + Result := 0; + + //Search for Players that have not often played yet + For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do + begin + if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed < lowestTP) then + begin + lowestTP := Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed; + NumPwithLTP := 1; + end + else if (Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP) then + begin + Inc(NumPwithLTP); + end; + end; + + //Create Random No + R := Random(NumPwithLTP); + + //Search for Random Player + For I := 0 to Teams.Teaminfo[Team].NumPlayers-1 do + begin + if Teams.Teaminfo[Team].Playerinfo[I].TimesPlayed = lowestTP then + begin + //Player Found + if (R = 0) then + begin + Result := I; + Break; + end; + + Dec(R); + end; + end; +end; + +//---------- +// NextRound - Increases CurRound by 1; Returns num of Round or -1 if last Round is already played +//---------- +Function TPartySession.NextRound(wParam, lParam: DWord): integer; +var I: Integer; +begin + If ((CurRound < high(Rounds)) OR (CurRound = high(CurRound))) then + begin //everythings OK! -> Start the Round, maaaaan + Inc(CurRound); + + //Set Players to play this Round + for I := 0 to Teams.NumTeams-1 do + Teams.Teaminfo[I].CurPlayer := GetRandomPlayer(I); + end + else + Result := -1; +end; + +//---------- +//IsWinner - Returns True if the Players Bit is set in the Winner Byte +//---------- +function TPartySession.IsWinner(Player, Winner: Byte): boolean; +var + Bit: Byte; +begin + Bit := 1 shl Player; + + Result := ((Winner AND Bit) = Bit); +end; + +//---------- +//GenScores - Inc Scores for Cur. Round +//---------- +procedure TPartySession.GenScores; +var + I: Byte; +begin + for I := 0 to Teams.NumTeams-1 do + begin + if isWinner(I, Rounds[CurRound].Winner) then + Inc(Teams.Teaminfo[I].Score); + end; +end; + +//---------- +// CallModiInit - Calls CurModis Init Proc. If an Error occurs, Returns Nonzero. In this Case a New Plugin was Selected. Please renew Loading +//---------- +Function TPartySession.CallModiInit(wParam, lParam: DWord): integer; +begin + If (not bPartyMode) then + begin //Set Rounds if not in PartyMode + SetLength(Rounds, 1); + Rounds[0].Modi := StandardModi; + Rounds[0].Winner := High(Byte); + CurRound := 0; + end; + + Try + //Core. + Except + on E : Exception do + begin + Core.ReportError(Integer(PChar('Error starting Modi: ' + Modis[Rounds[CurRound].Modi].Info.Name + ' ErrorStr: ' + E.Message)), Integer(PChar('TPartySession'))); + If (Rounds[CurRound].Modi = StandardModi) then + begin + Core.ReportError(Integer(PChar('Can''t start StandardModi, will exit now!')), Integer(PChar('TPartySession'))); + Halt; + end + Else //Select StandardModi + begin + Rounds[CurRound].Modi := StandardModi + end; + end; + End; +end; + +//---------- +// CallModiDeInit - Calls DeInitProc and does the RoundEnding +//---------- +Function TPartySession.CallModiDeInit(wParam, lParam: DWord): integer; +var + I: Integer; + MaxScore: Word; +begin + If (bPartyMode) then + begin + //Get Winner Byte! + if (@Modis[Rounds[CurRound].Modi].Info.ModiDeInit <> nil) then //get Winners from Plugin + Rounds[CurRound].Winner := Modis[Rounds[CurRound].Modi].Info.ModiDeInit(Modis[Rounds[CurRound].Modi].Info.ID) + else + begin //Create winners by Score :/ + Rounds[CurRound].Winner := 0; + MaxScore := 0; + for I := 0 to Teams.NumTeams-1 do + begin + // to-do : recode Percentage stuff + //PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999; + if (Player[I].ScoreTotalI > MaxScore) then + begin + MaxScore := Player[I].ScoreTotalI; + Rounds[CurRound].Winner := 1 shl I; + end + else if (Player[I].ScoreTotalI = MaxScore) AND (Player[I].ScoreTotalI <> 0) then + begin + Rounds[CurRound].Winner := Rounds[CurRound].Winner or (1 shl I); + end; + end; + + + //When nobody has Points -> Everybody loose + if (MaxScore = 0) then + Rounds[CurRound].Winner := 0; + + end; + + //Generate teh Scores + GenScores; + + //Inc Players TimesPlayed + If ((Modis[Rounds[CurRound-1].Modi].Info.LoadingSettings AND MLS_IncTP) = MLS_IncTP) then + begin + For I := 0 to Teams.NumTeams-1 do + Inc(Teams.TeamInfo[I].Playerinfo[Teams.TeamInfo[I].CurPlayer].TimesPlayed); + end; + end + else if (@Modis[Rounds[CurRound].Modi].Info.ModiDeInit <> nil) then + Modis[Rounds[CurRound].Modi].Info.ModiDeInit(Modis[Rounds[CurRound].Modi].Info.ID); +end; + +//---------- +// GetTeamInfo - Writes TTeamInfo Record to Pointer at lParam. Returns Zero on Success +//---------- +Function TPartySession.GetTeamInfo(wParam, pTeamInfo: DWord): integer; +var Info: ^TTeamInfo; +begin + Result := -1; + Info := Pointer(pTeamInfo); + If (Info <> nil) then + begin + Try + // to - do : Check Delphi memory management in this case + //Not sure if i had to copy PChars to a new address or if delphi manages this o0 + Info^ := Teams; + Result := 0; + Except + Result := -2; + End; + end; +end; + +//---------- +// SetTeamInfo - Read TTeamInfo Record from Pointer at lParam. Returns Zero on Success +//---------- +Function TPartySession.SetTeamInfo(wParam, pTeamInfo: DWord): integer; +var + TeamInfobackup: TTeamInfo; + Info: ^TTeamInfo; +begin + Result := -1; + Info := Pointer(pTeamInfo); + If (Info <> nil) then + begin + Try + TeamInfoBackup := Teams; + // to - do : Check Delphi memory management in this case + //Not sure if i had to copy PChars to a new address or if delphi manages this o0 + Teams := Info^; + Result := 0; + Except + Teams := TeamInfoBackup; + Result := -2; + End; + end; +end; + +//---------- +// GetTeamOrder - Returns Team Order. Structure: Bits 1..3: Team at Place1; Bits 4..6: Team at Place2 ... +//---------- +Function TPartySession.GetTeamOrder(wParam, lParam: DWord): integer; +var + I, J: Integer; + ATeams: array [0..5] of TeamOrderEntry; + TempTeam: TeamOrderEntry; +begin + // to-do : PartyMode: Write this in another way, so that teams with the same scire get the same Placing + //Fill Team Array + For I := 0 to Teams.NumTeams-1 do + begin + ATeams[I].Teamnum := I; + ATeams[I].Score := Teams.Teaminfo[I].Score; + end; + + //Sort Teams + for J := 0 to Teams.NumTeams-1 do + for I := 1 to Teams.NumTeams-1 do + if ATeams[I].Score > ATeams[I-1].Score then + begin + TempTeam := ATeams[I-1]; + ATeams[I-1] := ATeams[I]; + ATeams[I] := TempTeam; + end; + + //Copy to Result + Result := 0; + For I := 0 to Teams.NumTeams-1 do + Result := Result or (ATeams[I].TeamNum Shl I*3); +end; + +//---------- +// GetWinnerString - wParam is Roundnum. If (Pointer = nil) then Return Length of the String. Otherwise Write the String to Address at lParam +//---------- +Function TPartySession.GetWinnerString(wParam, lParam: DWord): integer; +var + Winners: Array of String; + I: Integer; + ResultStr: String; + S: ^String; +begin + ResultStr := Language.Translate('PARTY_NOBODY'); + + if (wParam <= High(Rounds)) then + begin + if (Rounds[wParam].Winner <> 0) then + begin + if (Rounds[wParam].Winner = 255) then + begin + ResultStr := Language.Translate('PARTY_NOTPLAYEDYET'); + end + else + begin + SetLength(Winners, 0); + for I := 0 to Teams.NumTeams-1 do + begin + if isWinner(I, Rounds[wParam].Winner) then + begin + SetLength(Winners, Length(Winners) + 1); + Winners[high(Winners)] := Teams.TeamInfo[I].Name; + end; + end; + ResultStr := Language.Implode(Winners); + end; + end; + end; + + //Now Return what we have got + If (Pointer(lParam) = nil) then + begin //ReturnString Length + Result := Length(ResultStr); + end + Else + begin //Return String + Try + S := Pointer(lParam); + S^ := ResultStr; + Result := 0; + Except + Result := -1; + + End; + end; +end; + +end. diff --git a/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.mode1 b/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.mode1 index b56265f4..897a4860 100644 --- a/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.mode1 +++ b/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.mode1 @@ -204,10 +204,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFEC0CDE1AB6004F5956</string> + <string>2CF8E6C70CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CF3EFA30CDE1A19004F5956</string> + <string>2CF3EFEC0CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -244,10 +244,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFED0CDE1AB6004F5956</string> + <string>2CF8E6C80CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8F70CDCA55E0027F7CD</string> + <string>2CF3EFED0CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -284,10 +284,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFEE0CDE1AB6004F5956</string> + <string>2CF8E6C90CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8F90CDCA55E0027F7CD</string> + <string>2CF3EFEE0CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -324,10 +324,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFEF0CDE1AB6004F5956</string> + <string>2CF8E6CA0CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8FA0CDCA55E0027F7CD</string> + <string>2CF3EFEF0CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -364,10 +364,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFF00CDE1AB6004F5956</string> + <string>2CF8E6CB0CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8FB0CDCA55E0027F7CD</string> + <string>2CF3EFF00CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -404,10 +404,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFF10CDE1AB6004F5956</string> + <string>2CF8E6CC0CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8FC0CDCA55E0027F7CD</string> + <string>2CF3EFF10CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -444,10 +444,10 @@ <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> - <string>2CF3EFF20CDE1AB6004F5956</string> + <string>2CF8E6CD0CDFAAAB0053A996</string> <key>history</key> <array> - <string>2CE7D8FD0CDCA55E0027F7CD</string> + <string>2CF3EFF20CDE1AB6004F5956</string> </array> </dict> <key>SplitCount</key> @@ -500,6 +500,8 @@ <key>Layout</key> <array> <dict> + <key>BecomeActive</key> + <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> @@ -543,7 +545,7 @@ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> - <integer>21</integer> + <integer>20</integer> <integer>15</integer> <integer>0</integer> </array> @@ -568,7 +570,7 @@ <real>266</real> </array> <key>RubberWindowFrame</key> - <string>767 271 817 753 0 0 1680 1028 </string> + <string>765 271 817 753 0 0 1680 1028 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> @@ -605,7 +607,7 @@ <key>Frame</key> <string>{{0, 0}, {529, 0}}</string> <key>RubberWindowFrame</key> - <string>767 271 817 753 0 0 1680 1028 </string> + <string>765 271 817 753 0 0 1680 1028 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> @@ -613,8 +615,6 @@ <string>0pt</string> </dict> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> @@ -627,7 +627,7 @@ <key>Frame</key> <string>{{0, 5}, {529, 707}}</string> <key>RubberWindowFrame</key> - <string>767 271 817 753 0 0 1680 1028 </string> + <string>765 271 817 753 0 0 1680 1028 </string> </dict> <key>Module</key> <string>XCDetailModule</string> @@ -651,9 +651,9 @@ </array> <key>TableOfContents</key> <array> - <string>2CF3EE840CDE0AAA004F5956</string> + <string>2CF8E6C50CDFAAAB0053A996</string> <string>1CE0B1FE06471DED0097A5F4</string> - <string>2CF3EE850CDE0AAA004F5956</string> + <string>2CF8E6C60CDFAAAB0053A996</string> <string>1CE0B20306471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string> </array> @@ -787,25 +787,21 @@ <integer>5</integer> <key>WindowOrderList</key> <array> - <string>2CDD4B730CB935C700549FAC</string> - <string>1C530D57069F1CE1000CFCEE</string> - <string>2CF3EE990CDE0AAA004F5956</string> - <string>2CF3EE9A0CDE0AAA004F5956</string> - <string>2CDD4BFC0CB948FC00549FAC</string> - <string>2CF3EE950CDE0AAA004F5956</string> - <string>1C0AD2B3069F1EA900FABCE6</string> + <string>2CF8E6D50CDFAAAB0053A996</string> <string>2CF553750CDA575B00627463</string> <string>2CF553720CDA575B00627463</string> <string>2CF5536F0CDA575B00627463</string> <string>2CF552930CDA426600627463</string> <string>2CF552960CDA426600627463</string> <string>2C0C2C180CDC7312004A651F</string> - <string>/Users/eddie/Projekte/UltraStarDX/trunk/Game/Code/MacOSX/UltraStarDX.xcodeproj</string> <string>2CF3EF8A0CDE1898004F5956</string> <string>1CD10A99069EF8BA00B06720</string> + <string>/Users/eddie/Projekte/UltraStarDX/trunk/Game/Code/MacOSX/UltraStarDX.xcodeproj</string> + <string>2CDD4B730CB935C700549FAC</string> + <string>1C0AD2B3069F1EA900FABCE6</string> </array> <key>WindowString</key> - <string>767 271 817 753 0 0 1680 1028 </string> + <string>765 271 817 753 0 0 1680 1028 </string> <key>WindowTools</key> <array> <dict> @@ -821,14 +817,12 @@ <key>Dock</key> <array> <dict> - <key>BecomeActive</key> - <true/> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528F0623707200166675</string> <key>PBXProjectModuleLabel</key> - <string>MacResources.pas</string> + <string>UParty.pas</string> <key>StatusBarVisibility</key> <true/> </dict> @@ -845,6 +839,8 @@ <string>566pt</string> </dict> <dict> + <key>BecomeActive</key> + <true/> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> @@ -884,7 +880,7 @@ <key>TableOfContents</key> <array> <string>2CDD4B730CB935C700549FAC</string> - <string>2CF3EEAC0CDE0C76004F5956</string> + <string>2CF8E6CE0CDFAAAB0053A996</string> <string>1CD0528F0623707200166675</string> <string>XCMainBuildResultsModuleGUID</string> </array> @@ -895,7 +891,7 @@ <key>WindowToolGUID</key> <string>2CDD4B730CB935C700549FAC</string> <key>WindowToolIsVisible</key> - <false/> + <true/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> @@ -926,8 +922,8 @@ <string>yes</string> <key>sizes</key> <array> - <string>{{0, 0}, {341, 414}}</string> - <string>{{341, 0}, {623, 414}}</string> + <string>{{0, 0}, {339, 414}}</string> + <string>{{339, 0}, {625, 414}}</string> </array> </dict> <key>VerticalSplitView</key> @@ -990,14 +986,14 @@ <key>TableOfContents</key> <array> <string>1CD10A99069EF8BA00B06720</string> - <string>2CF3EE8F0CDE0AAA004F5956</string> + <string>2CF8E6CF0CDFAAAB0053A996</string> <string>1C162984064C10D400B95A72</string> - <string>2CF3EE900CDE0AAA004F5956</string> - <string>2CF3EE910CDE0AAA004F5956</string> - <string>2CF3EE920CDE0AAA004F5956</string> - <string>2CF3EE930CDE0AAA004F5956</string> - <string>2CF3EE940CDE0AAA004F5956</string> - <string>2CF3EE950CDE0AAA004F5956</string> + <string>2CF8E6D00CDFAAAB0053A996</string> + <string>2CF8E6D10CDFAAAB0053A996</string> + <string>2CF8E6D20CDFAAAB0053A996</string> + <string>2CF8E6D30CDFAAAB0053A996</string> + <string>2CF8E6D40CDFAAAB0053A996</string> + <string>2CF8E6D50CDFAAAB0053A996</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debug</string> @@ -1248,9 +1244,9 @@ <key>TableOfContents</key> <array> <string>1C0AD2B3069F1EA900FABCE6</string> - <string>2CF3EE970CDE0AAA004F5956</string> + <string>2CF8E6D60CDFAAAB0053A996</string> <string>1CD0528B0623707200166675</string> - <string>2CF3EE980CDE0AAA004F5956</string> + <string>2CF8E6D70CDFAAAB0053A996</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.run</string> @@ -1259,7 +1255,7 @@ <key>WindowToolGUID</key> <string>1C0AD2B3069F1EA900FABCE6</string> <key>WindowToolIsVisible</key> - <false/> + <true/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> diff --git a/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.pbxuser b/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.pbxuser index 0a358f1e..36d98df6 100644 --- a/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.pbxuser +++ b/Game/Code/MacOSX/UltraStarDX.xcodeproj/eddie.pbxuser @@ -226,9 +226,9 @@ }; 2C4D9C7F0CC9EC8C0031092D /* UParty.pas */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {758, 5278}}"; - sepNavSelRange = "{48, 0}"; - sepNavVisRect = "{{0, 0}, {758, 716}}"; + sepNavIntBoundsRect = "{{0, 0}, {1305, 8610}}"; + sepNavSelRange = "{7616, 0}"; + sepNavVisRect = "{{0, 3141}, {1305, 534}}"; sepNavWindowFrame = "{{15, 178}, {797, 845}}"; }; }; @@ -316,7 +316,7 @@ uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1730, 16002}}"; sepNavSelRange = "{11873, 20}"; - sepNavVisRect = "{{0, 4988}, {577, 612}}"; + sepNavVisRect = "{{0, 5189}, {577, 612}}"; sepNavWindowFrame = "{{15, 282}, {616, 741}}"; }; }; @@ -579,66 +579,6 @@ modificationTime = 215882409.953114; state = 1; }; - 2CE7D8F70CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2C4D9C890CC9EC8C0031092D /* USongs.pas */; - name = "USongs.pas: 39"; - rLen = 0; - rLoc = 503; - rType = 0; - vrLen = 1403; - vrLoc = 4615; - }; - 2CE7D8F90CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2C4D9C640CC9EC8C0031092D /* UAudio_FFMpeg.pas */; - name = "UAudio_FFMpeg.pas: 952"; - rLen = 0; - rLoc = 22697; - rType = 0; - vrLen = 1224; - vrLoc = 21473; - }; - 2CE7D8FA0CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2C4D9C630CC9EC8C0031092D /* UAudio_bass.pas */; - name = "nux ... is t"; - rLen = 12; - rLoc = 3202; - rType = 0; - vrLen = 1266; - vrLoc = 15619; - }; - 2CE7D8FB0CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2C4D9DEC0CC9EF0A0031092D /* sdl_image.pas */; - name = "sdl_image.pas: 130"; - rLen = 0; - rLoc = 8020; - rType = 0; - vrLen = 832; - vrLoc = 7978; - }; - 2CE7D8FC0CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 98B8BE5C0B1F974F00162019 /* sdl.pas */; - name = "sdl.pas: 250"; - rLen = 0; - rLoc = 16506; - rType = 0; - vrLen = 886; - vrLoc = 16376; - }; - 2CE7D8FD0CDCA55E0027F7CD /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2C4D9C8B0CC9EC8C0031092D /* UTexture.pas */; - name = "ScaledTexture(TexSur"; - rLen = 20; - rLoc = 11873; - rType = 0; - vrLen = 1220; - vrLoc = 11189; - }; 2CF3EF210CDE13A0004F5956 /* Messages.pas */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1013, 614}}"; @@ -655,16 +595,6 @@ sepNavWindowFrame = "{{515, 220}, {1052, 743}}"; }; }; - 2CF3EFA30CDE1A19004F5956 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 2CF3EF260CDE13BA004F5956 /* MacResources.pas */; - name = "MacResources.pas: 63"; - rLen = 0; - rLoc = 1896; - rType = 0; - vrLen = 1181; - vrLoc = 455; - }; 2CF3EFEC0CDE1AB6004F5956 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 2CF3EF260CDE13BA004F5956 /* MacResources.pas */; @@ -1087,6 +1017,76 @@ sepNavWindowFrame = "{{38, 259}, {1052, 743}}"; }; }; + 2CF8E6C70CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2CF3EF260CDE13BA004F5956 /* MacResources.pas */; + name = "MacResources.pas: 60"; + rLen = 0; + rLoc = 1521; + rType = 0; + vrLen = 1339; + vrLoc = 455; + }; + 2CF8E6C80CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2C4D9C890CC9EC8C0031092D /* USongs.pas */; + name = "USongs.pas: 39"; + rLen = 0; + rLoc = 503; + rType = 0; + vrLen = 1403; + vrLoc = 4615; + }; + 2CF8E6C90CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2C4D9C640CC9EC8C0031092D /* UAudio_FFMpeg.pas */; + name = "UAudio_FFMpeg.pas: 952"; + rLen = 0; + rLoc = 22697; + rType = 0; + vrLen = 1224; + vrLoc = 21473; + }; + 2CF8E6CA0CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2C4D9C630CC9EC8C0031092D /* UAudio_bass.pas */; + name = "nux ... is t"; + rLen = 12; + rLoc = 3202; + rType = 0; + vrLen = 1266; + vrLoc = 15619; + }; + 2CF8E6CB0CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2C4D9DEC0CC9EF0A0031092D /* sdl_image.pas */; + name = "sdl_image.pas: 130"; + rLen = 0; + rLoc = 8020; + rType = 0; + vrLen = 832; + vrLoc = 7978; + }; + 2CF8E6CC0CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 98B8BE5C0B1F974F00162019 /* sdl.pas */; + name = "sdl.pas: 250"; + rLen = 0; + rLoc = 16506; + rType = 0; + vrLen = 886; + vrLoc = 16376; + }; + 2CF8E6CD0CDFAAAB0053A996 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 2C4D9C8B0CC9EC8C0031092D /* UTexture.pas */; + name = "TempSurface:=TexS"; + rLen = 20; + rLoc = 11873; + rType = 0; + vrLen = 1318; + vrLoc = 11176; + }; 9845B6590B1F9B9E0084DD62 /* SDL.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {948, 1330}}"; @@ -1229,17 +1229,10 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 215878288; - PBXWorkspaceStateSaveDate = 215878288; + PBXPerProjectTemplateStateSaveDate = 215983788; + PBXWorkspaceStateSaveDate = 215983788; }; perUserProjectItems = { - 2CE7D8F70CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8F70CDCA55E0027F7CD /* PBXTextBookmark */; - 2CE7D8F90CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8F90CDCA55E0027F7CD /* PBXTextBookmark */; - 2CE7D8FA0CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8FA0CDCA55E0027F7CD /* PBXTextBookmark */; - 2CE7D8FB0CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8FB0CDCA55E0027F7CD /* PBXTextBookmark */; - 2CE7D8FC0CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8FC0CDCA55E0027F7CD /* PBXTextBookmark */; - 2CE7D8FD0CDCA55E0027F7CD /* PBXTextBookmark */ = 2CE7D8FD0CDCA55E0027F7CD /* PBXTextBookmark */; - 2CF3EFA30CDE1A19004F5956 /* PBXTextBookmark */ = 2CF3EFA30CDE1A19004F5956 /* PBXTextBookmark */; 2CF3EFEC0CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFEC0CDE1AB6004F5956 /* PBXTextBookmark */; 2CF3EFED0CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFED0CDE1AB6004F5956 /* PBXTextBookmark */; 2CF3EFEE0CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFEE0CDE1AB6004F5956 /* PBXTextBookmark */; @@ -1247,6 +1240,13 @@ 2CF3EFF00CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFF00CDE1AB6004F5956 /* PBXTextBookmark */; 2CF3EFF10CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFF10CDE1AB6004F5956 /* PBXTextBookmark */; 2CF3EFF20CDE1AB6004F5956 /* PBXTextBookmark */ = 2CF3EFF20CDE1AB6004F5956 /* PBXTextBookmark */; + 2CF8E6C70CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6C70CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6C80CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6C80CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6C90CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6C90CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6CA0CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6CA0CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6CB0CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6CB0CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6CC0CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6CC0CDFAAAB0053A996 /* PBXTextBookmark */; + 2CF8E6CD0CDFAAAB0053A996 /* PBXTextBookmark */ = 2CF8E6CD0CDFAAAB0053A996 /* PBXTextBookmark */; }; sourceControlManager = 2CDD4B690CB9357000549FAC /* Source Control */; userBuildSettings = { diff --git a/Game/Code/MacOSX/UltraStarDX.xcodeproj/project.pbxproj b/Game/Code/MacOSX/UltraStarDX.xcodeproj/project.pbxproj index 6d8eb133..38736234 100644 --- a/Game/Code/MacOSX/UltraStarDX.xcodeproj/project.pbxproj +++ b/Game/Code/MacOSX/UltraStarDX.xcodeproj/project.pbxproj @@ -255,6 +255,8 @@ 2CF553420CDA531100627463 /* libavformat.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2CF552C00CDA4B7B00627463 /* libavformat.dylib */; }; 2CF553430CDA531100627463 /* libavutil.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2CF552C10CDA4B7B00627463 /* libavutil.dylib */; }; 2CF553440CDA531100627463 /* libmp3lame.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2CF552C20CDA4B7B00627463 /* libmp3lame.dylib */; }; + 2CF8E6BE0CDFA8E80053A996 /* UPartyDefs.pas in Sources */ = {isa = PBXBuildFile; fileRef = 2CF8E6BD0CDFA8E80053A996 /* UPartyDefs.pas */; }; + 2CF8E6BF0CDFA8E80053A996 /* UPartyDefs.pas in Sources */ = {isa = PBXBuildFile; fileRef = 2CF8E6BD0CDFA8E80053A996 /* UPartyDefs.pas */; }; 98B8BE340B1F947800162019 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 98B8BE330B1F947800162019 /* AppKit.framework */; }; 98B8BE390B1F949C00162019 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 98B8BE370B1F949C00162019 /* Cocoa.framework */; }; 98B8BE3A0B1F949C00162019 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 98B8BE380B1F949C00162019 /* Foundation.framework */; }; @@ -483,6 +485,7 @@ 2CF552C10CDA4B7B00627463 /* libavutil.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.dylib; path = ../lib/ffmpeg/libavutil.dylib; sourceTree = SOURCE_ROOT; }; 2CF552C20CDA4B7B00627463 /* libmp3lame.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmp3lame.dylib; path = ../lib/ffmpeg/libmp3lame.dylib; sourceTree = SOURCE_ROOT; }; 2CF553070CDA51B500627463 /* sdlutils.pas */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.pascal; name = sdlutils.pas; path = "/Library/Frameworks/JEDI-SDL.framework/SDL/sdlutils.pas"; sourceTree = "<absolute>"; }; + 2CF8E6BD0CDFA8E80053A996 /* UPartyDefs.pas */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.pascal; name = UPartyDefs.pas; path = ../../../Modis/SDK/UPartyDefs.pas; sourceTree = SOURCE_ROOT; }; 9845B6590B1F9B9E0084DD62 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = /Library/Frameworks/SDL.framework/Versions/A/Headers/SDL.h; sourceTree = "<absolute>"; }; 98B8BE330B1F947800162019 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 98B8BE370B1F949C00162019 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; @@ -687,6 +690,7 @@ 2CF5508A0CDA228800627463 /* SDK */ = { isa = PBXGroup; children = ( + 2CF8E6BD0CDFA8E80053A996 /* UPartyDefs.pas */, 2CDC716B0CDB9CB70018F966 /* StrUtils.pas */, 2CF552110CDA3D1400627463 /* UPluginDefs.pas */, 2CF5508B0CDA22B000627463 /* ModiSDK.pas */, @@ -1073,6 +1077,7 @@ 2CDC716C0CDB9CB70018F966 /* StrUtils.pas in Sources */, 2CF3EF220CDE13A0004F5956 /* Messages.pas in Sources */, 2CF3EF270CDE13BA004F5956 /* MacResources.pas in Sources */, + 2CF8E6BE0CDFA8E80053A996 /* UPartyDefs.pas in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1194,6 +1199,7 @@ 2CDC716D0CDB9CB70018F966 /* StrUtils.pas in Sources */, 2CF3EF230CDE13A0004F5956 /* Messages.pas in Sources */, 2CF3EF280CDE13BA004F5956 /* MacResources.pas in Sources */, + 2CF8E6BF0CDFA8E80053A996 /* UPartyDefs.pas in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; |