From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 21 Mar 2007 19:19:04 +0000
Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1
 b956fd51-792f-4845-bead-9b4dfca2ff2c

---
 Modis/5000Points/Until5000.dpr          |  89 +++++++++++++++++
 Modis/Blind/Blind.dpr                   |  97 ++++++++++++++++++
 Modis/Don't_Get_Worse/Hold_The_Line.dpr | 170 ++++++++++++++++++++++++++++++++
 Modis/Duell/Duell.cfg                   |  40 ++++++++
 Modis/Duell/Duell.dpr                   |  95 ++++++++++++++++++
 Modis/SDK/ModiSDK.pas                   | 139 ++++++++++++++++++++++++++
 Modis/SDK/StrUtils.pas                  |  70 +++++++++++++
 7 files changed, 700 insertions(+)
 create mode 100644 Modis/5000Points/Until5000.dpr
 create mode 100644 Modis/Blind/Blind.dpr
 create mode 100644 Modis/Don't_Get_Worse/Hold_The_Line.dpr
 create mode 100644 Modis/Duell/Duell.cfg
 create mode 100644 Modis/Duell/Duell.dpr
 create mode 100644 Modis/SDK/ModiSDK.pas
 create mode 100644 Modis/SDK/StrUtils.pas

(limited to 'Modis')

diff --git a/Modis/5000Points/Until5000.dpr b/Modis/5000Points/Until5000.dpr
new file mode 100644
index 00000000..8d66eb5f
--- /dev/null
+++ b/Modis/5000Points/Until5000.dpr
@@ -0,0 +1,89 @@
+library Until5000;
+
+uses
+  ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+  Info.Name    := 'PLUGIN_UNTIL5000_NAME';
+  Info.NumPlayers := 31;
+
+  Info.Creator    := 'Whiteshark';
+  Info.PluginDesc := 'PLUGIN_UNTIL5000_DESC';
+
+
+  //Options
+  Info.LoadSong := True;  //Whether or not a Song should be Loaded
+  //Only When Song is Loaded:
+  Info.ShowScore := True; //Whether or not the Score should be shown
+  Info.ShowNotes := True; //Whether the Note Lines should be displayed
+  Info.LoadVideo := True; //Should the Video be loaded ?
+  Info.LoadBack  := True; //Should the Background be loaded ?
+
+  Info.BGShowFull := False;   //Whether the Background or the Video should be shown Fullsize
+  Info.BGShowFull_O := True;  //Whether the Background or the Video should be shown Fullsize
+
+  Info.ShowRateBar:= True;   //Whether the Bar that shows how good the player was sould be displayed
+  Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+  Info.EnLineBonus := False;  //Whether LineBonus Should be enabled
+  Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+  //Options even when song is Not loaded
+  Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+  Info.TeamModeOnly := False;  //If True the Plugin can only be Played in Team Mode
+  Info.GetSoundData := False;  //If True the RData Procedure is called when new SoundData is available
+  Info.Dummy := False;         //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+I: Integer;
+begin
+Result := False;
+  for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    PlayerInfo.Playerinfo[I].Bar := PlayerInfo.Playerinfo[I].Score div 50;
+    PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Bar;
+    if (PlayerInfo.Playerinfo[I].Score >=5000) then
+      Exit;
+  end;
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+  I:Integer;
+begin
+Result := 0;
+for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    if (PlayerInfo.Playerinfo[I].Score >=5000) then
+    begin
+      Case I of
+        0: Result := Result OR 1;
+        1: Result := Result OR 2;
+        2: Result := Result OR 4;
+        3: Result := Result OR 8;
+        4: Result := Result OR 16;
+        5: Result := Result OR 32;
+      end;
+    end;
+  end;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file
diff --git a/Modis/Blind/Blind.dpr b/Modis/Blind/Blind.dpr
new file mode 100644
index 00000000..99c7d7eb
--- /dev/null
+++ b/Modis/Blind/Blind.dpr
@@ -0,0 +1,97 @@
+library Blind;
+
+uses
+  ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+  Info.Name    := 'PLUGIN_BLIND_NAME';
+  Info.NumPlayers := 31;
+
+  Info.Creator    := 'Whiteshark';
+  Info.PluginDesc := 'PLUGIN_BLIND_DESC';
+
+
+  //Options
+  Info.LoadSong := True;  //Whether or not a Song should be Loaded
+  //Only When Song is Loaded:
+  Info.ShowScore := True; //Whether or not the Score should be shown
+  Info.ShowNotes := False; //Whether the Note Lines should be displayed
+  Info.LoadVideo := True; //Should the Video be loaded ?
+  Info.LoadBack  := True; //Should the Background be loaded ?
+
+  Info.BGShowFull := False;   //Whether the Background or the Video should be shown Fullsize
+  Info.BGShowFull_O := True;  //Whether the Background or the Video should be shown Fullsize
+
+  Info.ShowRateBar:= False;   //Whether the Bar that shows how good the player was sould be displayed
+  Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+  Info.EnLineBonus := False;  //Whether LineBonus Should be enabled
+  Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+  //Options even when song is Not loaded
+  Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+  Info.TeamModeOnly := False;  //If True the Plugin can only be Played in Team Mode
+  Info.GetSoundData := False;  //If True the RData Procedure is called when new SoundData is available
+  Info.Dummy := False;         //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+I: Integer;
+begin
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+  I:Integer;
+  MaxScore: Word;
+begin
+  Result := 0;
+  MaxScore := 0;
+  for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+    if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+    begin
+      MaxScore := PlayerInfo.Playerinfo[I].Score;
+      Case I of
+        0: Result :=  1;
+        1: Result :=  2;
+        2: Result :=  4;
+        3: Result :=  8;
+        4: Result := 16;
+        5: Result := 32;
+      end;
+    end
+    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) then
+    begin
+      Case I of
+        0: Result := Result OR 1;
+        1: Result := Result OR 2;
+        2: Result := Result OR 4;
+        3: Result := Result OR 8;
+        4: Result := Result OR 16;
+        5: Result := Result OR 32;
+      end;
+    end;
+  end;
+
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file
diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
new file mode 100644
index 00000000..87fea3db
--- /dev/null
+++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
@@ -0,0 +1,170 @@
+library Hold_The_Line;
+
+uses
+  ModiSDK in '..\SDK\ModiSDK.pas',
+  StrUtils in '..\SDK\StrUtils.pas',
+  OpenGL12;
+
+var
+  PointerTex: TSmallTexture;
+  CountSentences: Cardinal;
+  Limit: Byte;
+  fPrint: fModi_Print;
+  Frame: Integer;
+  PlayerTimes: array[0..5] of Integer;
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+  Info.Name    := 'PLUGIN_HDL_NAME';
+  Info.NumPlayers := 31;
+
+  Info.Creator    := 'Whiteshark';
+  Info.PluginDesc := 'PLUGIN_HDL_DESC';
+
+
+  //Options
+  Info.LoadSong := True;  //Whether or not a Song should be Loaded
+  //Only When Song is Loaded:
+  Info.ShowScore := True; //Whether or not the Score should be shown
+  Info.ShowNotes := True; //Whether the Note Lines should be displayed
+  Info.LoadVideo := True; //Should the Video be loaded ?
+  Info.LoadBack  := True; //Should the Background be loaded ?
+
+  Info.BGShowFull := False;   //Whether the Background or the Video should be shown Fullsize
+  Info.BGShowFull_O := True;  //Whether the Background or the Video should be shown Fullsize
+
+  Info.ShowRateBar:= True;   //Whether the Bar that shows how good the player was sould be displayed
+  Info.ShowRateBar_O := False; //Load from Ini whether the Bar should be Displayed
+
+  Info.EnLineBonus := False;  //Whether LineBonus Should be enabled
+  Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+  //Options even when song is Not loaded
+  Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+  Info.TeamModeOnly := False;  //If True the Plugin can only be Played in Team Mode
+  Info.GetSoundData := False;  //If True the RData Procedure is called when new SoundData is available
+  Info.Dummy := False;         //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+var
+  I: Integer;
+  Texname, TexType: PChar;
+begin {
+  TexName := CreateStr(PChar('HDL_Pointer'));
+  TexType := CreateStr(PChar('Plain'));
+  //PointerTex := LoadTex(TexName, TexType);
+
+  FreeStr(TexName);
+  FreeStr(TexType);
+
+  //CountSentences := Sentences.High;
+  Limit := 0;
+  Frame := 0;
+
+  fPrint := Print;
+
+  {for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    PlayerInfo.Playerinfo[I].Enabled := True;
+    PlayerInfo.Playerinfo[I].Percentage := 100;
+    PlayerTimes[I] := 0;
+  end; }         
+
+  Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+  I: Integer;
+  L: Byte;
+  C: Byte;
+  Text: PChar;
+begin
+  case Limit of
+    0: L := 20;
+    1: L := 50;
+    2: L := 75;
+  end;
+
+  C:= 0;
+
+  Inc(Frame);
+
+  Result := True;
+
+  //Inc Limit
+  if (Limit = 0) And  (CurSentence >= CountSentences div 5 * 2) then
+    Inc(Limit)
+  else if (Limit = 1) And  (CurSentence >= CountSentences div 3 * 2) then
+    Inc(Limit);
+
+  for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    if PlayerInfo.Playerinfo[I].Enabled then
+    begin
+      if PlayerInfo.Playerinfo[I].Bar < L then
+      begin
+        PlayerInfo.Playerinfo[I].Enabled := False;
+        Inc(C);
+        PlayerTimes[I] := Frame; //Save Tiem of Dismission
+        //ToDo: PlaySound
+      end;
+      
+      //Draw Pointer;
+      //glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
+
+      glBegin(GL_QUADS);
+        glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4);
+        glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12);
+        glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12);
+        glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4);
+      glEnd;
+
+    end
+    else
+    begin
+      Inc(C);
+      //Draw Dismissed
+      Text := CreateStr(PChar('PARTY_DISMISSED'));
+      //Str := 'Test123';
+      //fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
+      FreeStr(Text);
+    end;
+  end;
+  {if (C >= PlayerInfo.NumPlayers-1) then
+    Result := False; }
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+  I:Integer;
+begin
+Result := 0;
+for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+  PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div Frame;
+    if (PlayerInfo.Playerinfo[I].Enabled) then
+    begin
+      Case I of
+        0: Result := Result OR 1;
+        1: Result := Result OR 2;
+        2: Result := Result OR 4;
+        3: Result := Result OR 8;
+        4: Result := Result OR 16;
+        5: Result := Result OR 32;
+      end;
+    end;
+  end;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file
diff --git a/Modis/Duell/Duell.cfg b/Modis/Duell/Duell.cfg
new file mode 100644
index 00000000..7f619472
--- /dev/null
+++ b/Modis/Duell/Duell.cfg
@@ -0,0 +1,40 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-E"E:\Projekte\Ultrastar\Bin\Plugins"
+-LE"e:\programme\borland\delphi7\Projects\Bpl"
+-LN"e:\programme\borland\delphi7\Projects\Bpl"
+-U"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
+-O"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
+-I"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
+-R"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
diff --git a/Modis/Duell/Duell.dpr b/Modis/Duell/Duell.dpr
new file mode 100644
index 00000000..40ae11ed
--- /dev/null
+++ b/Modis/Duell/Duell.dpr
@@ -0,0 +1,95 @@
+library Duell;
+
+uses
+  ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+  Info.Name    := 'PLUGIN_DUELL_NAME';
+  Info.NumPlayers := 31;
+
+  Info.Creator    := 'Whiteshark';
+  Info.PluginDesc := 'PLUGIN_DUELL_DESC';
+
+
+  //Options
+  Info.LoadSong := True;  //Whether or not a Song should be Loaded
+  //Only When Song is Loaded:
+  Info.ShowScore := True; //Whether or not the Score should be shown
+  Info.ShowNotes := True; //Whether the Note Lines should be displayed
+  Info.LoadVideo := True; //Should the Video be loaded ?
+  Info.LoadBack  := True; //Should the Background be loaded ?
+
+  Info.BGShowFull := False;   //Whether the Background or the Video should be shown Fullsize
+  Info.BGShowFull_O := True;  //Whether the Background or the Video should be shown Fullsize
+
+  Info.ShowRateBar:= False;   //Whether the Bar that shows how good the player was sould be displayed
+  Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+  Info.EnLineBonus := False;  //Whether LineBonus Should be enabled
+  Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+  //Options even when song is Not loaded
+  Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+  Info.TeamModeOnly := False;  //If True the Plugin can only be Played in Team Mode
+  Info.GetSoundData := False;  //If True the RData Procedure is called when new SoundData is available
+  Info.Dummy := False;         //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+  I:Integer;
+  MaxScore: Word;
+begin
+  Result := 0;
+  MaxScore := 0;
+  for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+    if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+    begin
+      MaxScore := PlayerInfo.Playerinfo[I].Score;
+      Case I of
+        0: Result :=  1;
+        1: Result :=  2;
+        2: Result :=  4;
+        3: Result :=  8;
+        4: Result := 16;
+        5: Result := 32;
+      end;
+    end
+    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) then
+    begin
+      Case I of
+        0: Result := Result OR 1;
+        1: Result := Result OR 2;
+        2: Result := Result OR 4;
+        3: Result := Result OR 8;
+        4: Result := Result OR 16;
+        5: Result := Result OR 32;
+      end;
+    end;
+  end;
+
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file
diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
new file mode 100644
index 00000000..dc3b74c0
--- /dev/null
+++ b/Modis/SDK/ModiSDK.pas
@@ -0,0 +1,139 @@
+unit ModiSDK;
+
+interface
+
+type  //PluginInfo, for Init
+  TPluginInfo = record
+    //Info
+    Name: Array [0..32] of Char;         //Modi to Register for the Plugin
+    Creator: Array [0..32] of Char;      //Name of the Author
+    PluginDesc: Array [0..64] of Char;   //Plugin Description
+
+    //Options
+    LoadSong:      boolean; //Whether or not a Song should be Loaded
+    //Only When Song is Loaded:
+    ShowNotes:     boolean; //Whether the Note Lines should be displayed
+    LoadVideo:     boolean; //Should the Video be loaded ?
+    LoadBack:      boolean; //Should the Background be loaded ?
+
+    ShowRateBar:   boolean; //Whether the Bar that shows how good the player was sould be displayed
+    ShowRateBar_O: boolean; //Load from Ini whether the Bar should be Displayed
+
+    EnLineBonus:   boolean; //Whether LineBonus Should be enabled
+    EnLineBonus_O: boolean; //Load from Ini whether LineBonus Should be enabled
+
+    BGShowFull:    boolean; //Whether the Background or the Video should be shown Fullsize
+    BGShowFull_O:  boolean; //Whether the Background or the Video should be shown Fullsize
+
+    //Options -> everytime
+    ShowScore:     boolean; //Whether or not the Score should be shown
+    ShowBars:      boolean; //Whether the White Bars on Top and Bottom should be Drawn
+    TeamModeOnly:  boolean; //If True the Plugin can only be Played in Team Mode
+    GetSoundData:  boolean; //If True the RData Procedure is called when new SoundData is available
+    Dummy:         boolean; //Should be Set to False... for Updateing Plugin Interface
+
+    NumPlayers: Byte;   //Number of Available Players for Modi
+    //Set different Bits
+    //1 -> One Player
+    //2 -> Two Players
+    //4 -> Three Players
+    //8 -> Four Players
+    //16-> Six Players
+    //e.g. : 10 -> Playable with 2 and 4 Players
+
+  end;
+
+  TPlayerInfo = record
+    NumPlayers: Byte;
+    Playerinfo: array[0..5] of record
+      Name: PChar; //Name of the Player
+      Score:Word;  //Players Score
+      Bar:  Byte;  //Percentage of the SingBar filled
+      PosX: Real;  //PosX of Players SingBar
+      PosY: Real;  //PosY "
+      Enabled: Boolean; //Whether the Player could get Points
+      Percentage: Byte; //Percentage Shown on the Score Screen
+    end;
+  end;
+
+  TTeamInfo = record
+    NumTeams: Byte;
+    Teaminfo: array[0..5] of record
+      Name:  PChar;
+      Score: Word;
+      Joker: Byte;
+      CurPlayer: Byte;
+      NumPlayers: Byte;
+      Playerinfo: array[0..3] of record
+        Name: PChar;
+        TimesPlayed: Byte;
+        
+      end;
+    end;
+  end;
+
+  TsmallTexture = record
+    TexNum:   integer;
+    W:        real;
+    H:        real;
+    ScaleW:   real; // for dynamic scalling while leaving width constant
+    ScaleH:   real; // for dynamic scalling while leaving height constant
+  end;
+
+  TSentences = record
+    Akt:      integer;      // aktualna czesc utworu do rysowania
+    High:     integer;
+    Ilosc:    integer;
+    Resolution: integer;
+    NotesGAP: integer;
+    TotalLength:  integer;
+    Sentence:    array of record
+      Start:    integer;
+      StartNote:  integer;
+      Lyric:      string;
+      LyricWidth: real;
+      Koniec:   integer;
+      BaseNote: integer;
+      HighNote:  integer;
+      IlNut:    integer;
+      TotalNotes: integer;
+      Note:     array of record
+        Color:      integer;
+        Start:      integer;
+        Length:    integer;
+        Ton:        integer;
+        TonGamy:    integer;
+        //Text:      string;
+        FreeStyle:  boolean;
+        Typ:    integer;    // zwykla nuta x1, zlota nuta x2
+      end;
+    end;
+  end;
+
+  //AChar = array [0..254] of Char;
+
+  DWORD = Longword;
+  HSTREAM = DWORD;
+
+  //Routines to gave to the Plugin
+  fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; stdcall; //Pointer to Texture Loader
+  //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall;       //Pointer to Translator
+  fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall;       //Procedure to Print Text   //Now translated automatically
+  fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall;       //Procedure that loads a Custom Sound
+  fModi_PlaySound = procedure (const Index: Cardinal); stdcall;       //Plays a Custom Sound
+
+  //DLL Funktionen
+  //Gave the Plugins Info
+  pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall;
+  //Executed on Game Start //If True Game begins, else Failure
+  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+  //Executed everytime the Screen is Drawed //If False The Game finishes
+  fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+  //Is Executed on Finish, Returns the Playernum of the Winner
+  fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; stdcall;
+  //Procedure called when new Sound Data is available
+  pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); stdcall;
+
+implementation
+
+end.
diff --git a/Modis/SDK/StrUtils.pas b/Modis/SDK/StrUtils.pas
new file mode 100644
index 00000000..276d95a2
--- /dev/null
+++ b/Modis/SDK/StrUtils.pas
@@ -0,0 +1,70 @@
+unit StrUtils;
+
+interface
+uses ModiSDK;
+
+//function StrToAChar(Str: String): AChar;
+function CreateStr(Str: PChar): PChar;
+procedure FreeStr(Str: PChar);
+
+implementation
+
+{function StrToAChar(Str: String): AChar;
+var
+  L, I: Integer;
+begin
+  L := Length(Str);
+  For I := 0 to L-1 do
+    AChar[I] := Str[I+1];
+
+  For I := L to 254 do
+    AChar[I] := #0;
+end; }
+
+function StrCopy(Dest, Source: PChar): PChar; assembler;
+asm
+        PUSH    EDI
+        PUSH    ESI
+        MOV     ESI,EAX
+        MOV     EDI,EDX
+        MOV     ECX,0FFFFFFFFH
+        XOR     AL,AL
+        REPNE   SCASB
+        NOT     ECX
+        MOV     EDI,ESI
+        MOV     ESI,EDX
+        MOV     EDX,ECX
+        MOV     EAX,EDI
+        SHR     ECX,2
+        REP     MOVSD
+        MOV     ECX,EDX
+        AND     ECX,3
+        REP     MOVSB
+        POP     ESI
+        POP     EDI
+end;
+
+function StrLen(Str: PChar): Cardinal; assembler;
+asm
+        MOV     EDX,EDI
+        MOV     EDI,EAX
+        MOV     ECX,0FFFFFFFFH
+        XOR     AL,AL
+        REPNE   SCASB
+        MOV     EAX,0FFFFFFFEH
+        SUB     EAX,ECX
+        MOV     EDI,EDX
+end;
+
+function CreateStr(Str: PChar): PChar;
+begin
+  GetMem(Result, StrLen(Str) + 1);
+  StrCopy(Result, Str);
+end;
+
+procedure FreeStr(Str: PChar);
+begin
+  FreeMem(Str);
+end;
+
+end.
\ No newline at end of file
-- 
cgit v1.2.3


From 7120ff7e18ff9bf05d4635435e39654fbc4f4eef Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 21 Mar 2007 19:31:43 +0000
Subject: =?UTF-8?q?Datei=20/=20Ordner=20gel=C3=B6scht?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/Duell/Duell.cfg | 40 ----------------------------------------
 1 file changed, 40 deletions(-)
 delete mode 100644 Modis/Duell/Duell.cfg

(limited to 'Modis')

diff --git a/Modis/Duell/Duell.cfg b/Modis/Duell/Duell.cfg
deleted file mode 100644
index 7f619472..00000000
--- a/Modis/Duell/Duell.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--$A8
--$B-
--$C+
--$D+
--$E-
--$F-
--$G+
--$H+
--$I+
--$J-
--$K-
--$L+
--$M-
--$N+
--$O+
--$P+
--$Q-
--$R-
--$S-
--$T-
--$U-
--$V+
--$W-
--$X+
--$YD
--$Z1
--cg
--AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
--H+
--W+
--M
--$M16384,1048576
--K$00400000
--E"E:\Projekte\Ultrastar\Bin\Plugins"
--LE"e:\programme\borland\delphi7\Projects\Bpl"
--LN"e:\programme\borland\delphi7\Projects\Bpl"
--U"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
--O"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
--I"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
--R"E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Image\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Mixer\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Net\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_Sound\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDL_ttf\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLFilter\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLMonoFonts\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SDLSpriteEngine\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\SFont\Pas;E:\Projekte\TVPC Software\Include\JEDI-SDL\smpeg\Pas;E:\Projekte\TVPC Software\Include\Zlportio"
-- 
cgit v1.2.3


From b6d5c314031498281c73dbfe53bba323430e031a Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Thu, 22 Mar 2007 19:36:12 +0000
Subject: Fixed Bug: If Nobody gets Points, everybody wins

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@14 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/Blind/Blind.dpr | 2 +-
 Modis/Duell/Duell.dpr | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'Modis')

diff --git a/Modis/Blind/Blind.dpr b/Modis/Blind/Blind.dpr
index 99c7d7eb..ab440e67 100644
--- a/Modis/Blind/Blind.dpr
+++ b/Modis/Blind/Blind.dpr
@@ -74,7 +74,7 @@ begin
         5: Result := 32;
       end;
     end
-    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) then
+    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
     begin
       Case I of
         0: Result := Result OR 1;
diff --git a/Modis/Duell/Duell.dpr b/Modis/Duell/Duell.dpr
index 40ae11ed..4a22a5d7 100644
--- a/Modis/Duell/Duell.dpr
+++ b/Modis/Duell/Duell.dpr
@@ -72,7 +72,7 @@ begin
         5: Result := 32;
       end;
     end
-    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) then
+    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
     begin
       Case I of
         0: Result := Result OR 1;
-- 
cgit v1.2.3


From 541b91c3f40f283411faebe83d7cc50e2507c66e Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Thu, 22 Mar 2007 19:37:09 +0000
Subject: Fixed Crash at Startup (OpenGL Pointers not Inited)

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@15 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/Don't_Get_Worse/Hold_The_Line.dpr | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'Modis')

diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
index 87fea3db..a6eb9a3a 100644
--- a/Modis/Don't_Get_Worse/Hold_The_Line.dpr
+++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
@@ -52,26 +52,28 @@ function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sen
 var
   I: Integer;
   Texname, TexType: PChar;
-begin {
+begin
   TexName := CreateStr(PChar('HDL_Pointer'));
   TexType := CreateStr(PChar('Plain'));
-  //PointerTex := LoadTex(TexName, TexType);
+  PointerTex := LoadTex(TexName, TexType);
 
   FreeStr(TexName);
   FreeStr(TexType);
 
-  //CountSentences := Sentences.High;
+  CountSentences := Sentences.High;
   Limit := 0;
   Frame := 0;
 
   fPrint := Print;
 
-  {for I := 0 to PlayerInfo.NumPlayers-1 do
+  for I := 0 to PlayerInfo.NumPlayers-1 do
   begin
     PlayerInfo.Playerinfo[I].Enabled := True;
     PlayerInfo.Playerinfo[I].Percentage := 100;
     PlayerTimes[I] := 0;
-  end; }         
+  end;
+
+  LoadOpenGL;
 
   Result := True;
 end;
@@ -110,12 +112,12 @@ begin
       begin
         PlayerInfo.Playerinfo[I].Enabled := False;
         Inc(C);
-        PlayerTimes[I] := Frame; //Save Tiem of Dismission
+        PlayerTimes[I] := Frame; //Save Time of Dismission
         //ToDo: PlaySound
       end;
       
       //Draw Pointer;
-      //glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
+      glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
 
       glBegin(GL_QUADS);
         glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4);
@@ -131,7 +133,7 @@ begin
       //Draw Dismissed
       Text := CreateStr(PChar('PARTY_DISMISSED'));
       //Str := 'Test123';
-      //fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
+      fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
       FreeStr(Text);
     end;
   end;
@@ -150,6 +152,7 @@ for I := 0 to PlayerInfo.NumPlayers-1 do
   PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div Frame;
     if (PlayerInfo.Playerinfo[I].Enabled) then
     begin
+      PlayerInfo.Playerinfo[I].Percentage := 100;
       Case I of
         0: Result := Result OR 1;
         1: Result := Result OR 2;
-- 
cgit v1.2.3


From 066af80fcd332cae182f0ea84c94b820389e8df4 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 30 Mar 2007 12:21:11 +0000
Subject: Finished Hold The Line Plugin: Better Generating of Percentage Play
 Sound at Dismission Load Textur correctly Finish if only one Player is Left

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@51 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/Don't_Get_Worse/Hold_The_Line.dpr | 89 ++++++++++++++++++++++++---------
 1 file changed, 64 insertions(+), 25 deletions(-)

(limited to 'Modis')

diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
index a6eb9a3a..ef7a16f7 100644
--- a/Modis/Don't_Get_Worse/Hold_The_Line.dpr
+++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
@@ -3,15 +3,21 @@ library Hold_The_Line;
 uses
   ModiSDK in '..\SDK\ModiSDK.pas',
   StrUtils in '..\SDK\StrUtils.pas',
-  OpenGL12;
+  OpenGL12,
+  Windows;
 
 var
   PointerTex: TSmallTexture;
   CountSentences: Cardinal;
   Limit: Byte;
   fPrint: fModi_Print;
+  fPlaySound: fModi_PlaySound;
   Frame: Integer;
   PlayerTimes: array[0..5] of Integer;
+  LastTick: Cardinal;
+  PointerVisible: Boolean;
+
+  DismissedSound: Cardinal;
 
 //Gave the Plugins Info
 procedure PluginInfo (var Info: TPluginInfo); stdcall;
@@ -54,17 +60,22 @@ var
   Texname, TexType: PChar;
 begin
   TexName := CreateStr(PChar('HDL_Pointer'));
-  TexType := CreateStr(PChar('Plain'));
+  TexType := CreateStr(PChar('Font Black'));
   PointerTex := LoadTex(TexName, TexType);
 
   FreeStr(TexName);
   FreeStr(TexType);
 
+  TexName := CreateStr(PChar('dismissed.mp3'));
+  DismissedSound := LoadSound (TexName);
+  FreeStr(TexName);
+
   CountSentences := Sentences.High;
   Limit := 0;
   Frame := 0;
 
   fPrint := Print;
+  fPlaySound := PlaySound;
 
   for I := 0 to PlayerInfo.NumPlayers-1 do
   begin
@@ -85,7 +96,28 @@ var
   L: Byte;
   C: Byte;
   Text: PChar;
+  Blink: Boolean;
+  tick: Cardinal;
 begin
+  //Aktivate Blink
+  If (CurSentence = CountSentences div 5 * 2 - 1) OR (CurSentence = CountSentences div 3 * 2 - 1) then
+  begin
+    Tick := Gettickcount div 400;
+    If (Tick <> LastTick) then
+    begin
+      LastTick := Tick;
+      PointerVisible := Not PointerVisible;
+    end;
+  end
+  else
+    PointerVisible := True;
+
+  //Inc Limit
+  if (Limit = 0) And  (CurSentence >= CountSentences div 5 * 2) then
+    Inc(Limit)
+  else if (Limit = 1) And  (CurSentence >= CountSentences div 3 * 2) then
+    Inc(Limit);
+
   case Limit of
     0: L := 20;
     1: L := 50;
@@ -94,16 +126,8 @@ begin
 
   C:= 0;
 
-  Inc(Frame);
-
   Result := True;
 
-  //Inc Limit
-  if (Limit = 0) And  (CurSentence >= CountSentences div 5 * 2) then
-    Inc(Limit)
-  else if (Limit = 1) And  (CurSentence >= CountSentences div 3 * 2) then
-    Inc(Limit);
-
   for I := 0 to PlayerInfo.NumPlayers-1 do
   begin
     if PlayerInfo.Playerinfo[I].Enabled then
@@ -112,19 +136,32 @@ begin
       begin
         PlayerInfo.Playerinfo[I].Enabled := False;
         Inc(C);
-        PlayerTimes[I] := Frame; //Save Time of Dismission
-        //ToDo: PlaySound
+        PlayerTimes[I] := CurSentence; //Save Time of Dismission
+        //PlaySound
+        fPlaySound (DismissedSound);
       end;
-      
-      //Draw Pointer;
-      glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
 
-      glBegin(GL_QUADS);
-        glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4);
-        glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12);
-        glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12);
-        glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4);
-      glEnd;
+      //Draw Pointer
+      if (PointerVisible) then
+      begin
+        glColor4f (0.2, 0.8, 0.1, 1);
+
+        glEnable(GL_TEXTURE_2D);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+        glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
+
+        glBegin(GL_QUADS);
+          glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4);
+          glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12);
+          glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12);
+          glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4);
+        glEnd;
+
+        glDisable(GL_TEXTURE_2D);
+        glDisable(GL_BLEND);
+      end;
 
     end
     else
@@ -132,13 +169,15 @@ begin
       Inc(C);
       //Draw Dismissed
       Text := CreateStr(PChar('PARTY_DISMISSED'));
-      //Str := 'Test123';
+
+      glColor4f (0.8, 0.8, 0.8, 1);
+
       fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
       FreeStr(Text);
     end;
   end;
-  {if (C >= PlayerInfo.NumPlayers-1) then
-    Result := False; }
+  if (C >= PlayerInfo.NumPlayers-1) then
+    Result := False;
 end;
 
 //Is Executed on Finish, Returns the Playernum of the Winner
@@ -149,7 +188,7 @@ begin
 Result := 0;
 for I := 0 to PlayerInfo.NumPlayers-1 do
   begin
-  PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div Frame;
+  PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div CountSentences;
     if (PlayerInfo.Playerinfo[I].Enabled) then
     begin
       PlayerInfo.Playerinfo[I].Percentage := 100;
-- 
cgit v1.2.3


From 7bf5487faf2b099ced0b2126c2cca164be80acf1 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 18 May 2007 10:57:17 +0000
Subject: Some changes mode on ModiSDK and Depending Files(Plugin Loader, Party
 SingScreen and Plugins) Changes make the Pluginsystem more extendable with
 backwards compatibility in further Versions.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@220 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/5000Points/Until5000.dpr          |  6 ++-
 Modis/Blind/Blind.dpr                   | 11 +++--
 Modis/Don't_Get_Worse/Hold_The_Line.dpr | 20 ++++-----
 Modis/Duell/Duell.dpr                   |  8 +++-
 Modis/SDK/ModiSDK.pas                   | 80 ++++++++++++++++++---------------
 5 files changed, 71 insertions(+), 54 deletions(-)

(limited to 'Modis')

diff --git a/Modis/5000Points/Until5000.dpr b/Modis/5000Points/Until5000.dpr
index 8d66eb5f..b826d212 100644
--- a/Modis/5000Points/Until5000.dpr
+++ b/Modis/5000Points/Until5000.dpr
@@ -7,12 +7,14 @@ uses
 procedure PluginInfo (var Info: TPluginInfo); stdcall;
 begin
   Info.Name    := 'PLUGIN_UNTIL5000_NAME';
-  Info.NumPlayers := 31;
 
   Info.Creator    := 'Whiteshark';
   Info.PluginDesc := 'PLUGIN_UNTIL5000_DESC';
 
+  //Set to Party Modi Plugin
+  Info.Typ := 8;
 
+  Info.NumPlayers := 31;
   //Options
   Info.LoadSong := True;  //Whether or not a Song should be Loaded
   //Only When Song is Loaded:
@@ -38,7 +40,7 @@ begin
 end;
 
 //Executed on Game Start //If True Game begins, else Failure
-function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
 begin
 Result := True;
 end;
diff --git a/Modis/Blind/Blind.dpr b/Modis/Blind/Blind.dpr
index ab440e67..c806171d 100644
--- a/Modis/Blind/Blind.dpr
+++ b/Modis/Blind/Blind.dpr
@@ -7,11 +7,14 @@ uses
 procedure PluginInfo (var Info: TPluginInfo); stdcall;
 begin
   Info.Name    := 'PLUGIN_BLIND_NAME';
-  Info.NumPlayers := 31;
 
   Info.Creator    := 'Whiteshark';
   Info.PluginDesc := 'PLUGIN_BLIND_DESC';
 
+  //Set to Party Modi Plugin
+  Info.Typ := 8;
+
+  Info.NumPlayers := 31;
 
   //Options
   Info.LoadSong := True;  //Whether or not a Song should be Loaded
@@ -38,7 +41,7 @@ begin
 end;
 
 //Executed on Game Start //If True Game begins, else Failure
-function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
 begin
 Result := True;
 end;
@@ -86,7 +89,9 @@ begin
       end;
     end;
   end;
-
+  //If everybody has 0 Points nobody Wins
+  If (MaxScore = 0) then
+    Result := 0;
 end;
 
 exports
diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
index ef7a16f7..de19858b 100644
--- a/Modis/Don't_Get_Worse/Hold_The_Line.dpr
+++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr
@@ -10,8 +10,7 @@ var
   PointerTex: TSmallTexture;
   CountSentences: Cardinal;
   Limit: Byte;
-  fPrint: fModi_Print;
-  fPlaySound: fModi_PlaySound;
+  MethodRec: TMethodRec;
   Frame: Integer;
   PlayerTimes: array[0..5] of Integer;
   LastTick: Cardinal;
@@ -23,12 +22,14 @@ var
 procedure PluginInfo (var Info: TPluginInfo); stdcall;
 begin
   Info.Name    := 'PLUGIN_HDL_NAME';
-  Info.NumPlayers := 31;
 
   Info.Creator    := 'Whiteshark';
   Info.PluginDesc := 'PLUGIN_HDL_DESC';
 
+  //Set to Party Modi Plugin
+  Info.Typ := 8;
 
+  Info.NumPlayers := 31;
   //Options
   Info.LoadSong := True;  //Whether or not a Song should be Loaded
   //Only When Song is Loaded:
@@ -54,28 +55,27 @@ begin
 end;
 
 //Executed on Game Start //If True Game begins, else Failure
-function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
 var
   I: Integer;
   Texname, TexType: PChar;
 begin
   TexName := CreateStr(PChar('HDL_Pointer'));
   TexType := CreateStr(PChar('Font Black'));
-  PointerTex := LoadTex(TexName, TexType);
+  PointerTex := Methods.LoadTex(TexName, TexType);
 
   FreeStr(TexName);
   FreeStr(TexType);
 
   TexName := CreateStr(PChar('dismissed.mp3'));
-  DismissedSound := LoadSound (TexName);
+  DismissedSound := Methods.LoadSound (TexName);
   FreeStr(TexName);
 
   CountSentences := Sentences.High;
   Limit := 0;
   Frame := 0;
 
-  fPrint := Print;
-  fPlaySound := PlaySound;
+  MethodRec := Methods;
 
   for I := 0 to PlayerInfo.NumPlayers-1 do
   begin
@@ -138,7 +138,7 @@ begin
         Inc(C);
         PlayerTimes[I] := CurSentence; //Save Time of Dismission
         //PlaySound
-        fPlaySound (DismissedSound);
+        MethodRec.PlaySound (DismissedSound);
       end;
 
       //Draw Pointer
@@ -172,7 +172,7 @@ begin
 
       glColor4f (0.8, 0.8, 0.8, 1);
 
-      fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
+      MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
       FreeStr(Text);
     end;
   end;
diff --git a/Modis/Duell/Duell.dpr b/Modis/Duell/Duell.dpr
index 4a22a5d7..cff9d4ef 100644
--- a/Modis/Duell/Duell.dpr
+++ b/Modis/Duell/Duell.dpr
@@ -7,12 +7,13 @@ uses
 procedure PluginInfo (var Info: TPluginInfo); stdcall;
 begin
   Info.Name    := 'PLUGIN_DUELL_NAME';
-  Info.NumPlayers := 31;
 
   Info.Creator    := 'Whiteshark';
   Info.PluginDesc := 'PLUGIN_DUELL_DESC';
 
+  Info.Typ := 8;
 
+  Info.NumPlayers := 31;
   //Options
   Info.LoadSong := True;  //Whether or not a Song should be Loaded
   //Only When Song is Loaded:
@@ -38,7 +39,7 @@ begin
 end;
 
 //Executed on Game Start //If True Game begins, else Failure
-function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
 begin
 Result := True;
 end;
@@ -85,6 +86,9 @@ begin
     end;
   end;
 
+  //When nobody has Points -> Everybody loose
+  if (MaxScore = 0) then
+    Result := 0;
 end;
 
 exports
diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index dc3b74c0..d8bad0d2 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -9,37 +9,41 @@ type  //PluginInfo, for Init
     Creator: Array [0..32] of Char;      //Name of the Author
     PluginDesc: Array [0..64] of Char;   //Plugin Description
 
-    //Options
-    LoadSong:      boolean; //Whether or not a Song should be Loaded
-    //Only When Song is Loaded:
-    ShowNotes:     boolean; //Whether the Note Lines should be displayed
-    LoadVideo:     boolean; //Should the Video be loaded ?
-    LoadBack:      boolean; //Should the Background be loaded ?
-
-    ShowRateBar:   boolean; //Whether the Bar that shows how good the player was sould be displayed
-    ShowRateBar_O: boolean; //Load from Ini whether the Bar should be Displayed
-
-    EnLineBonus:   boolean; //Whether LineBonus Should be enabled
-    EnLineBonus_O: boolean; //Load from Ini whether LineBonus Should be enabled
-
-    BGShowFull:    boolean; //Whether the Background or the Video should be shown Fullsize
-    BGShowFull_O:  boolean; //Whether the Background or the Video should be shown Fullsize
-
-    //Options -> everytime
-    ShowScore:     boolean; //Whether or not the Score should be shown
-    ShowBars:      boolean; //Whether the White Bars on Top and Bottom should be Drawn
-    TeamModeOnly:  boolean; //If True the Plugin can only be Played in Team Mode
-    GetSoundData:  boolean; //If True the RData Procedure is called when new SoundData is available
-    Dummy:         boolean; //Should be Set to False... for Updateing Plugin Interface
-
-    NumPlayers: Byte;   //Number of Available Players for Modi
-    //Set different Bits
-    //1 -> One Player
-    //2 -> Two Players
-    //4 -> Three Players
-    //8 -> Four Players
-    //16-> Six Players
-    //e.g. : 10 -> Playable with 2 and 4 Players
+    //Plugin Typ, atm: 8 only for PartyMode Modi
+    Case Typ: byte of
+      8: (
+        //Options
+        LoadSong:      boolean; //Whether or not a Song should be Loaded
+        //Only When Song is Loaded:
+        ShowNotes:     boolean; //Whether the Note Lines should be displayed
+        LoadVideo:     boolean; //Should the Video be loaded ?
+        LoadBack:      boolean; //Should the Background be loaded ?
+
+        ShowRateBar:   boolean; //Whether the Bar that shows how good the player was sould be displayed
+        ShowRateBar_O: boolean; //Load from Ini whether the Bar should be Displayed
+
+        EnLineBonus:   boolean; //Whether LineBonus Should be enabled
+        EnLineBonus_O: boolean; //Load from Ini whether LineBonus Should be enabled
+
+        BGShowFull:    boolean; //Whether the Background or the Video should be shown Fullsize
+        BGShowFull_O:  boolean; //Whether the Background or the Video should be shown Fullsize
+
+        //Options -> everytime
+        ShowScore:     boolean; //Whether or not the Score should be shown
+        ShowBars:      boolean; //Whether the White Bars on Top and Bottom should be Drawn
+        TeamModeOnly:  boolean; //If True the Plugin can only be Played in Team Mode
+        GetSoundData:  boolean; //If True the RData Procedure is called when new SoundData is available
+        Dummy:         boolean; //Should be Set to False... for Updateing Plugin Interface
+
+        NumPlayers: Byte   //Number of Available Players for Modi
+        //Set different Bits
+        //1 -> One Player
+        //2 -> Two Players
+        //4 -> Three Players
+        //8 -> Four Players
+        //16-> Six Players
+        //e.g. : 10 -> Playable with 2 and 4 Players
+        );
 
   end;
 
@@ -76,8 +80,6 @@ type  //PluginInfo, for Init
     TexNum:   integer;
     W:        real;
     H:        real;
-    ScaleW:   real; // for dynamic scalling while leaving width constant
-    ScaleH:   real; // for dynamic scalling while leaving height constant
   end;
 
   TSentences = record
@@ -110,8 +112,6 @@ type  //PluginInfo, for Init
     end;
   end;
 
-  //AChar = array [0..254] of Char;
-
   DWORD = Longword;
   HSTREAM = DWORD;
 
@@ -120,13 +120,19 @@ type  //PluginInfo, for Init
   //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall;       //Pointer to Translator
   fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall;       //Procedure to Print Text   //Now translated automatically
   fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall;       //Procedure that loads a Custom Sound
-  fModi_PlaySound = procedure (const Index: Cardinal); stdcall;       //Plays a Custom Sound
+  pModi_PlaySound = procedure (const Index: Cardinal); stdcall;       //Plays a Custom Sound
 
+  TMethodRec = record
+    LoadTex:    fModi_LoadTex;
+    Print:      fModi_Print;
+    LoadSound:  fModi_LoadSound;
+    PlaySound:  pModi_PlaySound;
+  end;
   //DLL Funktionen
   //Gave the Plugins Info
   pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall;
   //Executed on Game Start //If True Game begins, else Failure
-  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const LoadTex: fModi_LoadTex; const Print: fModi_Print; LoadSound: fModi_LoadSound; PlaySound: fModi_PlaySound): boolean; stdcall;
+  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
   //Executed everytime the Screen is Drawed //If False The Game finishes
   fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
   //Is Executed on Finish, Returns the Playernum of the Winner
-- 
cgit v1.2.3


From 433a1b7339e2bf96f3b0bb4c98b8c799c6540027 Mon Sep 17 00:00:00 2001
From: jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Tue, 18 Sep 2007 13:19:20 +0000
Subject: changes in order to compile in lazarus... minor tidy ups and removal
 of big old comment blocks..

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@394 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index d8bad0d2..0127a65c 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -5,9 +5,9 @@ interface
 type  //PluginInfo, for Init
   TPluginInfo = record
     //Info
-    Name: Array [0..32] of Char;         //Modi to Register for the Plugin
-    Creator: Array [0..32] of Char;      //Name of the Author
-    PluginDesc: Array [0..64] of Char;   //Plugin Description
+    Name       : Array [0..32] of Char;   //Modi to Register for the Plugin
+    Creator    : Array [0..32] of Char;   //Name of the Author
+    PluginDesc : Array [0..64] of Char;   //Plugin Description
 
     //Plugin Typ, atm: 8 only for PartyMode Modi
     Case Typ: byte of
-- 
cgit v1.2.3


From fdb75fa47dd72522b705e94be5a201c4e1a731cb Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 3 Oct 2007 12:43:01 +0000
Subject: New plugin SDK added Some more debug information for windows builds
 (Does this work in lazarus?)

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@466 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/UPluginDefs.pas | 107 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)
 create mode 100644 Modis/SDK/UPluginDefs.pas

(limited to 'Modis')

diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
new file mode 100644
index 00000000..7428ae2e
--- /dev/null
+++ b/Modis/SDK/UPluginDefs.pas
@@ -0,0 +1,107 @@
+unit uPluginDefs;
+{*********************
+  uPluginDefs
+  Some Basic Structures and Functions used to communicate with Plugins
+  Usable as Delphi Plugin SDK
+*********************}
+
+interface
+
+type
+  DWORD = LongWord;
+
+  //----------------
+  // TUS_PluginInfo - Some Infos from Plugin to Core.
+  // Send when Plugininfo procedure is Called
+  //----------------
+  PUS_PluginInfo = ^TUS_PluginInfo;
+  TUS_PluginInfo = record
+    cbSize:       Integer;    //Size of this record (usefull if record will be extended in the future)
+
+    Name:         PChar;      //Name of the Plugin
+    Version:      DWord;      //Version of the Plugin
+    Description:  PChar;      //Description, what does this Plugin do
+    Author:       PChar;      //Author of this Plugin
+    AuthorEmail:  PChar;      //Authors Email
+    Homepage:     PChar;      //Homepage of Plugin/Author
+  end;
+
+  //----------------
+  // TUS_Hook - Structure of the Hook Function
+  // Return 0 if the Hook should be continue,
+  // or a non zero Value, if the Hook should be Interuped
+  // In this Case the Caller of the Notivier gets the Return Value
+  // Return Value Should not be -1
+  //----------------
+  TUS_Hook            = Function (wParam, lParam: DWord): integer; stdcall;
+  TUS_Hook_of_Object  = Function (wParam, lParam: DWord): integer of Object;
+
+  //----------------
+  // TUS_Service - Structure of the Service Function
+  // This Function is called if the Registered Service is Called
+  // Return Value Should not be SERVICE_NOT_FOUND
+  //----------------
+  TUS_Service           = Function (wParam, lParam: DWord): integer; stdcall;
+  TUS_Service_of_Object = Function (wParam, lParam: DWord): integer of Object;
+
+  //----------------
+  // TUS_PluginInterface - Structure that Includes all Methods callable
+  // from the Plugins
+  //----------------
+  PUS_PluginInterface = ^TUS_PluginInterface;
+  TUS_PluginInterface = record
+    {******** Hook specific Methods ********}
+    {Function Creates a new Hookable Event and Returns the Handle
+     or 0 on Failure. (Name already exists)}
+    CreateHookableEvent: Function (EventName: PChar): THandle; stdcall;
+    
+    {Function Destroys an Event and Unhooks all Hooks to this Event.
+     0 on success, not 0 on Failure}
+    DestroyHookableEvent: Function (hEvent: THandle): integer; stdcall;
+
+    {Function start calling the Hook Chain
+     0 if Chain is called until the End, -1 if Event Handle is not valid
+     otherwise Return Value of the Hook that breaks the Chain}
+    NotivyEventHooks: Function (hEvent: THandle; wParam, lParam: dWord): integer; stdcall;
+
+    {Function Hooks an Event by Name.
+     Returns Hook Handle on Success, otherwise 0}
+    HookEvent: Function (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall;
+
+    {Function Removes the Hook from the Chain
+     Returns 0 on Success}
+    UnHookEvent: Function (hHook: THandle): Integer; stdcall;
+
+    {Function Returns Non Zero if a Event with the given Name Exists,
+     otherwise 0}
+    EventExists: Function (EventName: PChar): Integer; stdcall;
+
+    {******** Service specific Methods ********}
+    {Function Creates a new Service and Returns the Services Handle
+     or 0 on Failure. (Name already exists)}
+    CreateService: Function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall;
+    
+    {Function Destroys a Service.
+     0 on success, not 0 on Failure}
+    DestroyService: Function (hService: THandle): integer; stdcall;
+
+    {Function Calls a Services Proc
+     Returns Services Return Value or SERVICE_NOT_FOUND on Failure}
+    CallService: Function (ServiceName: PChar; wParam, lParam: dWord): integer; stdcall;
+
+    {Function Returns Non Zero if a Service with the given Name Exists,
+     otherwise 0}
+    ServiceExists: Function (ServiceName: PChar): Integer; stdcall;
+  end;
+
+//----------------
+// Some Default Constants
+//----------------
+const
+  {Returned if Service is not Found from CallService}
+  SERVICE_NOT_FOUND=$80000000;
+
+
+implementation
+
+end.
-- 
cgit v1.2.3


From 621bfb05407a169f6511f5b115d0622e5ec8bdd5 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 10 Oct 2007 17:50:05 +0000
Subject: Added Hook and Service Class for new Plugin System to Trunc Added
 Core and CoreModule. That maybe will be used for new Core management. Core
 needs many code to write

Some Info to Plugin SDK added

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@497 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/Hooks.txt              | 19 +++++++++++++++++
 Modis/SDK/Plugin DLL Exports.txt |  0
 Modis/SDK/Services.txt           |  9 ++++++++
 Modis/SDK/UPluginDefs.pas        | 45 ++++++++++++++++++++++++++++++++++++----
 4 files changed, 69 insertions(+), 4 deletions(-)
 create mode 100644 Modis/SDK/Hooks.txt
 create mode 100644 Modis/SDK/Plugin DLL Exports.txt
 create mode 100644 Modis/SDK/Services.txt

(limited to 'Modis')

diff --git a/Modis/SDK/Hooks.txt b/Modis/SDK/Hooks.txt
new file mode 100644
index 00000000..32237694
--- /dev/null
+++ b/Modis/SDK/Hooks.txt
@@ -0,0 +1,19 @@
+Ultrastar Deluxe Hook List
+-----------------------------------
+Here you can find the Events the Core offers to you:
+
+--------------------
+Core:
+--------------------
+Core/LoadingFinished <- Hook is called after all Modules and Plugins are loaded completely, before MainLoop
+Core/MainLoop        <- Hook is called once in MainLoop before Drawing
+Core/LoadTextures    <- Hook is called when Textures should be Loaded. This will be called in Ogl Thread. If Textures are Reloaded (e.g. on Display ReInit) LParam is non Zero.
+Core/ExitQuery       <- Hook is called if someone querys an exit. (e.g. X is pressed). Not called on ForcedExit. If Chain is breaked the exit will be aborted.
+Core/Exit            <- Hook is called before Module a. Plugin unload.
+Core/NewDebugInfo    <- Hook is called everytime there is Debug Info to Output(only if Debug Mode is enabled). wParam: Pchar(Message), lParam: PChar(Reportername)
+Core/NewError        <- Hook is called everytime an error is reported. wParam: Pchar(Message), lParam: PChar(Reportername)
+
+--------------------
+Display
+--------------------
+Display/onScreenChange <-Hook is called when there is an attemp to change Screen. wParam is address to Screens Name(Null Terminated). If Chain is breaked Screenchange will be aborted.
\ No newline at end of file
diff --git a/Modis/SDK/Plugin DLL Exports.txt b/Modis/SDK/Plugin DLL Exports.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/Modis/SDK/Services.txt b/Modis/SDK/Services.txt
new file mode 100644
index 00000000..ae8f4097
--- /dev/null
+++ b/Modis/SDK/Services.txt
@@ -0,0 +1,9 @@
+Ultrastar Deluxe Hook List
+-----------------------------------
+Here you can find the Services the Core offers to you:
+
+--------------------
+Core:
+--------------------
+Core/ReportError    <- Calls the 'Core/NewError' Chain. wParam: Pchar(Message), lParam: PChar(Reportername)
+Core/ReportDebug    <- Calls the 'Core/NewDebugInfo' Chain. wParam: Pchar(Message), lParam: PChar(Reportername)
\ No newline at end of file
diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 7428ae2e..42f888e4 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -13,6 +13,12 @@ type
   //----------------
   // TUS_PluginInfo - Some Infos from Plugin to Core.
   // Send when Plugininfo procedure is Called
+  // ---
+  // Version Structure:
+  // First  Byte: Head Revison
+  // Second Byte: Sub Revison
+  // Third  Byte: Sub Revision 2
+  // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z')
   //----------------
   PUS_PluginInfo = ^TUS_PluginInfo;
   TUS_PluginInfo = record
@@ -30,7 +36,7 @@ type
   // TUS_Hook - Structure of the Hook Function
   // Return 0 if the Hook should be continue,
   // or a non zero Value, if the Hook should be Interuped
-  // In this Case the Caller of the Notivier gets the Return Value
+  // In this Case the Caller of the Notifier gets the Return Value
   // Return Value Should not be -1
   //----------------
   TUS_Hook            = Function (wParam, lParam: DWord): integer; stdcall;
@@ -54,7 +60,7 @@ type
     {Function Creates a new Hookable Event and Returns the Handle
      or 0 on Failure. (Name already exists)}
     CreateHookableEvent: Function (EventName: PChar): THandle; stdcall;
-    
+
     {Function Destroys an Event and Unhooks all Hooks to this Event.
      0 on success, not 0 on Failure}
     DestroyHookableEvent: Function (hEvent: THandle): integer; stdcall;
@@ -80,7 +86,7 @@ type
     {Function Creates a new Service and Returns the Services Handle
      or 0 on Failure. (Name already exists)}
     CreateService: Function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall;
-    
+
     {Function Destroys a Service.
      0 on success, not 0 on Failure}
     DestroyService: Function (hService: THandle): integer; stdcall;
@@ -98,10 +104,41 @@ type
 // Some Default Constants
 //----------------
 const
-  {Returned if Service is not Found from CallService}
+  {Returned if Service is not found from CallService}
   SERVICE_NOT_FOUND=$80000000;
 
+  CORE_SM_NOSYMBOL= 0;
+  CORE_SM_ERROR   = 1;
+  CORE_SM_WARNING = 2;
+  CORE_SM_INFO    = 3;
+
+//----------------
+// Some Functions to Handle Version DWords
+//----------------
+Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord;
+Function VersiontoSting(const Version: DWord): String;
+
 
 implementation
 
+//--------------
+// MakeVersion - Converts 4 Values to a valid Version DWord
+//--------------
+Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord;
+begin
+  If (letter < 'a') or (Letter > 'z') then
+    letter := chr(0);
+
+  Result := (HeadRevision shl 24) or (SubVersion shl 16) or (SubVersion2 shl 8) or Ord(Letter);
+end;
+
+//--------------
+// VersiontoString - Returns some beauty '1.0.2a' like String
+//--------------
+Function VersiontoSting(const Version: DWord): String;
+begin // to-do : Write VersiontoString without SysUtils depencies
+  //Result := InttoStr((ver and $FF000000) shr 24);
+  Result := '1.0.1
+end;
+
 end.
-- 
cgit v1.2.3


From 2f80e3be339f528bd0c7ef54db8ff7cc641883e3 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 10 Oct 2007 18:07:01 +0000
Subject: Fixed some Bugs from Previous Commit

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@498 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/UPluginDefs.pas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'Modis')

diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 42f888e4..5a16d807 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -138,7 +138,7 @@ end;
 Function VersiontoSting(const Version: DWord): String;
 begin // to-do : Write VersiontoString without SysUtils depencies
   //Result := InttoStr((ver and $FF000000) shr 24);
-  Result := '1.0.1
+  Result := '1.0.1'
 end;
 
 end.
-- 
cgit v1.2.3


From 4231c33ad7c7765fd3851c5c7168f8c7d367deef Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Tue, 16 Oct 2007 23:19:11 +0000
Subject: nearly finished Cores loading procs Add PluginLoader Unit to implent
 new PluginLoader Reordered Delphi .dpr uses clausel

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@519 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/Hooks.txt       | 1 +
 Modis/SDK/Services.txt    | 8 ++++++--
 Modis/SDK/UPluginDefs.pas | 9 +++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/Hooks.txt b/Modis/SDK/Hooks.txt
index 32237694..f63773e0 100644
--- a/Modis/SDK/Hooks.txt
+++ b/Modis/SDK/Hooks.txt
@@ -7,6 +7,7 @@ Core:
 --------------------
 Core/LoadingFinished <- Hook is called after all Modules and Plugins are loaded completely, before MainLoop
 Core/MainLoop        <- Hook is called once in MainLoop before Drawing
+Core/Translate       <- Hook is called when Strings should be translated. If this is Retranslating lParam is Non Zero
 Core/LoadTextures    <- Hook is called when Textures should be Loaded. This will be called in Ogl Thread. If Textures are Reloaded (e.g. on Display ReInit) LParam is non Zero.
 Core/ExitQuery       <- Hook is called if someone querys an exit. (e.g. X is pressed). Not called on ForcedExit. If Chain is breaked the exit will be aborted.
 Core/Exit            <- Hook is called before Module a. Plugin unload.
diff --git a/Modis/SDK/Services.txt b/Modis/SDK/Services.txt
index ae8f4097..7ed4be0e 100644
--- a/Modis/SDK/Services.txt
+++ b/Modis/SDK/Services.txt
@@ -1,4 +1,4 @@
-Ultrastar Deluxe Hook List
+Ultrastar Deluxe Service List
 -----------------------------------
 Here you can find the Services the Core offers to you:
 
@@ -6,4 +6,8 @@ Here you can find the Services the Core offers to you:
 Core:
 --------------------
 Core/ReportError    <- Calls the 'Core/NewError' Chain. wParam: Pchar(Message), lParam: PChar(Reportername)
-Core/ReportDebug    <- Calls the 'Core/NewDebugInfo' Chain. wParam: Pchar(Message), lParam: PChar(Reportername)
\ No newline at end of file
+Core/ReportDebug    <- Calls the 'Core/NewDebugInfo' Chain. wParam: Pchar(Message), lParam: PChar(Reportername)
+Core/ShowMessage    <- Shows a Message Dialog. (lParam: PChar Text, wParam: Symbol)
+Core/Retranslate    <- Calls Translate Hook
+Core/ReloadTextures <- Calls LoadTextures Hook
+Core/GetModuleInfo  <- If lParam = nil then get length of Moduleinfo Array. If lparam <> nil then write array of TModuleInfo to address at lparam
\ No newline at end of file
diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 5a16d807..8b964cc2 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -100,6 +100,15 @@ type
     ServiceExists: Function (ServiceName: PChar): Integer; stdcall;
   end;
 
+  //TModuleInfo: Info about Modules
+  PModuleInfo = ^TModuleInfo;
+  TModuleInfo = record
+    Name:         String;
+    Version:      LongWord;
+    Description:  String;
+  end;
+  AModuleInfo = array of TModuleInfo;
+
 //----------------
 // Some Default Constants
 //----------------
-- 
cgit v1.2.3


From 9af5260cd9905f8d7e5600110cdb0667c0bb5188 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Sat, 27 Oct 2007 09:28:42 +0000
Subject: Update forgotten UPluginDefs from last commit

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@536 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/Plugin DLL Exports.txt | 11 +++++++++++
 Modis/SDK/Services.txt           | 11 ++++++++++-
 Modis/SDK/UPluginDefs.pas        | 39 +++++++++++++++++++++++++++++++--------
 3 files changed, 52 insertions(+), 9 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/Plugin DLL Exports.txt b/Modis/SDK/Plugin DLL Exports.txt
index e69de29b..717ffacb 100644
--- a/Modis/SDK/Plugin DLL Exports.txt	
+++ b/Modis/SDK/Plugin DLL Exports.txt	
@@ -0,0 +1,11 @@
+Ultrastar Plugin DLL(Libary) Exports
+-----------------------------------
+This are the Procedurs and Functions that a UsDx Plugin has to export to get Loaded.
+
+
+USPlugin_Info(PInfo: PUS_PluginInfo); stdcall;
+-----------------------------------
+Ultrastar uses this Procedure to identify the Plugins.
+At the given Address there is a PUS_PluginInfo Record. cbSize
+attribut is already set. Please asure not to overwrite this assigned
+memory amount.
diff --git a/Modis/SDK/Services.txt b/Modis/SDK/Services.txt
index 7ed4be0e..2ab5cf20 100644
--- a/Modis/SDK/Services.txt
+++ b/Modis/SDK/Services.txt
@@ -10,4 +10,13 @@ Core/ReportDebug    <- Calls the 'Core/NewDebugInfo' Chain. wParam: Pchar(Messag
 Core/ShowMessage    <- Shows a Message Dialog. (lParam: PChar Text, wParam: Symbol)
 Core/Retranslate    <- Calls Translate Hook
 Core/ReloadTextures <- Calls LoadTextures Hook
-Core/GetModuleInfo  <- If lParam = nil then get length of Moduleinfo Array. If lparam <> nil then write array of TModuleInfo to address at lparam
\ No newline at end of file
+Core/GetModuleInfo  <- If lParam = nil then get length of Moduleinfo Array. If lparam <> nil then write array of TModuleInfo to address at lparam
+Core/GetApplicationHandle <- Returns Main-Applications Handle (Win32 Only)
+
+--------------------
+PluginLoader
+--------------------
+PluginLoader/GetPluginInfo  <- If wParam = -1 then (If lParam = nil then get length of Moduleinfo Array. If lparam <> nil then write array of TUS_PluginInfo to address at lparam) Else (Get PluginInfo of Plugin with Index(wParam) to Address at lParam)
+PluginLoader/GetPluginState <- If wParam = -1 then (If lParam = nil then get length of Moduleinfo Array. If lparam <> nil then write array of TUS_PluginInfo to address at lparam) Else (Return PluginInfo of Plugin with Index(wParam))
+PluginLoader/LoadPlugin     <- wParam PChar(PluginName/PluginPath) | lParam (if wParam = nil) ID of the Plugin
+PluginLoader/UnloadPlugin   <- wParam PChar(PluginName/PluginPath) | lParam (if wParam = nil) ID of the Plugin
\ No newline at end of file
diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 8b964cc2..69c258fb 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -24,13 +24,15 @@ type
   TUS_PluginInfo = record
     cbSize:       Integer;    //Size of this record (usefull if record will be extended in the future)
 
-    Name:         PChar;      //Name of the Plugin
-    Version:      DWord;      //Version of the Plugin
-    Description:  PChar;      //Description, what does this Plugin do
-    Author:       PChar;      //Author of this Plugin
-    AuthorEmail:  PChar;      //Authors Email
-    Homepage:     PChar;      //Homepage of Plugin/Author
+    Name:         Array [0..31] of Char;      //Name of the Plugin
+    Version:      DWord;                      //Version of the Plugin
+    Description:  Array [0..127] of Char;     //Description, what does this Plugin do
+    Author:       Array [0..31] of Char;      //Author of this Plugin
+    AuthorEmail:  Array [0..63] of Char;      //Authors Email
+    Homepage:     Array [0..63] of Char;      //Homepage of Plugin/Author
   end;
+  AUS_PluginInfo = Array of TUS_PluginInfo;
+  PAUS_PluginInfo = ^AUS_PluginInfo;
 
   //----------------
   // TUS_Hook - Structure of the Hook Function
@@ -100,7 +102,9 @@ type
     ServiceExists: Function (ServiceName: PChar): Integer; stdcall;
   end;
 
-  //TModuleInfo: Info about Modules
+  //----------------
+  //TModuleInfo: Info about Modules. Result of Core/GetModuleInfo
+  //----------------
   PModuleInfo = ^TModuleInfo;
   TModuleInfo = record
     Name:         String;
@@ -109,6 +113,25 @@ type
   end;
   AModuleInfo = array of TModuleInfo;
 
+  //----------------
+  // Procs that should be exported by Plugin Dlls
+  //----------------
+  //Procedure is called to check if this is USDx Plugin
+  //Info is Pointer to this Plugins Info. Size is already set. Don't write over this limit
+  Proc_PluginInfo = procedure (Info: PUS_PluginInfo); stdcall;
+
+  //Called on Plugins Load. If Non Zero is Returned => abort Loading
+  //PInterface is Pointer to PluginInterface
+  Func_Load = function (const PInterface: PUS_PluginInterface): Integer; stdcall;
+
+  //Called on Plugins Init. If Non Zero is Returned => abort Loading
+  //PInterface is Pointer to PluginInterface
+  Func_Init = function (const PInterface: PUS_PluginInterface): Integer; stdcall;
+
+  //Called on Plugins Deinit.
+  //PInterface is Pointer to PluginInterface
+  Proc_DeInit = procedure (const PInterface: PUS_PluginInterface); stdcall;
+
 //----------------
 // Some Default Constants
 //----------------
@@ -116,6 +139,7 @@ const
   {Returned if Service is not found from CallService}
   SERVICE_NOT_FOUND=$80000000;
 
+  //for use in Service 'Core/ShowMessage' lParam(Symbol)
   CORE_SM_NOSYMBOL= 0;
   CORE_SM_ERROR   = 1;
   CORE_SM_WARNING = 2;
@@ -127,7 +151,6 @@ const
 Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord;
 Function VersiontoSting(const Version: DWord): String;
 
-
 implementation
 
 //--------------
-- 
cgit v1.2.3


From e779d4f8a8ca13215895338f71e6929dc795cf60 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Mon, 29 Oct 2007 15:40:07 +0000
Subject: Add new Party Modi SDK to Trunk

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@539 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/UPartyDefs.pas | 163 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 163 insertions(+)
 create mode 100644 Modis/SDK/UPartyDefs.pas

(limited to 'Modis')

diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas
new file mode 100644
index 00000000..2ca8f327
--- /dev/null
+++ b/Modis/SDK/UPartyDefs.pas
@@ -0,0 +1,163 @@
+unit UPartyDefs;
+{*********************
+  uPluginDefs
+  Some Basic Structures and Functions used to communicate with Plugins
+  Usable as Delphi Plugin SDK
+*********************}
+
+interface
+uses UPluginDefs;
+
+type
+  //----------------
+  // TUS_Party_Proc_Init - Structure of the Party Init Proc
+  // This Function is called on SingScreen Init Everytime this Modi should be sung
+  // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded
+  //----------------
+  TUS_Party_Proc_Init     = Function (ID: Integer): integer; stdcall;
+
+  //----------------
+  // TUS_Party_Proc_Draw - Structure of the Party Draw Proc
+  // This Function is called on SingScreen Draw (Not when Paused). You should draw in this Proc
+  // Return Non Zero to Finish Song... In this Case Score Screen is loaded
+  //----------------
+  TUS_Party_Proc_Draw     = Function (ID: Integer): integer; stdcall;
+
+  //----------------
+  // TUS_Party_Proc_Init - Structure of the Party Init Proc
+  // This Function is called on SingScreen DeInit When Plugin abort Song or Song finishes
+  // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded
+  //----------------
+  TUS_Party_Proc_DeInit   = Function (ID: Integer): integer; stdcall;
+
+  //----------------
+  // TUS_ModiInfo - Some Infos from Plugin to Partymode.
+  // Used to register party modi to Party manager
+  // ---
+  // Version Structure:
+  // First  Byte: Head Revison
+  // Second Byte: Sub Revison
+  // Third  Byte: Sub Revision 2
+  // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z')
+  //----------------
+  TModiInfo_Name = Array [0..31] of Char;
+  TModiInfo_Desc = Array [0..63] of Char;
+  
+  PUS_ModiInfo = ^TUS_ModiInfo;
+  TUS_ModiInfo = record
+    //Size of this record (usefull if record will be extended in the future)
+    cbSize:       Integer; //Don't forget to set this as Plugin!
+
+    //Infos about the Modi
+    Name       : TModiInfo_Name;   //Modiname to Register for the Plugin
+    Description: TModiInfo_Desc;   //Plugin Description
+
+    //------------
+    // Loading Settings
+    // ---
+    // Bit to Set | Triggered Option
+    // 1          | Song should be loaded
+    // 2          | Song has to be Non Duett
+    // 4          | Song has to be Duett  (If 2 and 4 is set, both will be ignored)
+    // 8          | Only Playable with 2 and more players
+    // 16         | Restrict Background Loading
+    // 32         | Restrict Video Loading
+    // 64         | Not in Use, Don't set it!
+    // 128        | Not in Use, Don't set it!
+    LoadingSettings: Byte;
+
+    // SingScreen Settings
+    // ---
+    // Bit to Set | Triggered Option
+    // 1          | ShowNotes
+    // 2          | ShowScores
+    // 4          | ShowTime
+    // 8          | Start Audio Playback automaticaly
+    // 16         | Not in Use, Don't set it!
+    // 32         | Not in Use, Don't set it!
+    // 64         | Not in Use, Don't set it!
+    // 128        | Not in Use, Don't set it!
+    SingScreenSettings: Byte;
+
+    // With which count of players can this modi be played
+    // ---
+    //Set different Bits
+    //1 -> One Player
+    //2 -> Two Players
+    //4 -> Three Players
+    //8 -> Four Players
+    //16-> Six Players
+    //e.g. : 10 -> Playable with 2 and 4 Players
+    NumPlayers: Byte;
+
+    // ID that is given to the Party Procs when they are called
+    // If this Modi is running
+    // (e.g. to register Until 2000 and Until 5000 with the same Procs
+    //  ID is the Max Point Count in this example)
+    ID: Integer;
+
+    // Party Procs called on Party
+    // ---
+    // Set to nil(C: NULL) if u don't want to use this method
+    ModiInit:   TUS_Party_Proc_Init;
+    ModiDraw:   TUS_Party_Proc_Draw;
+    ModiDeInit: TUS_Party_Proc_DeInit;
+  end;
+
+//----------------
+// Some Default Constants
+//----------------
+const
+  // to use for TUS_ModiInfo.LoadingSettings
+  MLS_LoadSong    = 1;  //Song should be loaded
+  MLS_NotDuett    = 2;  //Song has to be Non Duett
+  MLS_ForceDuett  = 4;  //Song has to be Duett  (If 2 and 4 is set, both will be ignored)
+  MLS_TeamOnly    = 8;  //Only Playable with 2 and more players
+  MLS_RestrictBG  = 16; //Restrict Background Loading
+  MLS_RestrictVid = 32; //Restrict Video Loading
+
+  // to use with TUS_ModiInfo.SingScreenSettings
+  MSS_ShowNotes   = 1;  //ShowNotes
+  MSS_ShowScores  = 2;  //ShowScores
+  MSS_ShowTime    = 4;  //ShowTime
+  MSS_AutoPlayback= 8;  //Start Audio Playback automaticaly
+
+  //Standard (Duell) for TUS_ModiInfo.LoadingSettings and TUS_ModiInfo.SingScreenSettings
+  MLS_Standard    = MLS_LoadSong;
+  MSS_Standard    = MSS_ShowNotes or MSS_ShowScores or MSS_ShowTime or MSS_AutoPlayback;
+
+//-------------
+// Some helper functions to register Party Modi
+//-------------
+Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init = nil; const ModiDeInit: TUS_Party_Proc_DeInit = nil; const ModiDraw: TUS_Party_Proc_Draw = nil): THandle;
+
+
+
+implementation
+
+//-------------
+// Function that Prepares the ModiInfo Record and Calls Party/RegisterModi
+//-------------
+Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init; const ModiDeInit: TUS_Party_Proc_DeInit; const ModiDraw: TUS_Party_Proc_Draw): THandle;
+var
+  ModiInfo: TUS_ModiInfo;
+begin
+  //Init Record
+  ModiInfo.cbSize             := SizeOf(TUS_ModiInfo);
+
+  ModiInfo.Name               := Name;
+  ModiInfo.Description        := Description;
+  ModiInfo.LoadingSettings    := LoadingSettings;
+  ModiInfo.SingScreenSettings := SingScreenSettings;
+  ModiInfo.NumPlayers         := NumPlayers;
+
+  ModiInfo.ID                 := ID;
+  ModiInfo.ModiInit           := ModiInit;
+  ModiInfo.ModiDraw           := ModiDraw;
+  ModiInfo.ModiDeInit         := ModiDeInit;
+
+  //Call Service
+  Result := PluginInterface.CallService('Party/RegisterModi', Integer(@ModiInfo), 0);
+end;
+
+end.
\ No newline at end of file
-- 
cgit v1.2.3


From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001
From: eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Thu, 1 Nov 2007 19:34:40 +0000
Subject: Mac OS X version compiles and links. I hope I didn't break too many
 files on windows/linux. Added switches.inc to all files. Changed many IFDEFs.
 For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is
 also used by the Mac port.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas     | 2 ++
 Modis/SDK/StrUtils.pas    | 3 +++
 Modis/SDK/UPartyDefs.pas  | 3 +++
 Modis/SDK/UPluginDefs.pas | 2 ++
 4 files changed, 10 insertions(+)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index 0127a65c..4423502c 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -2,6 +2,8 @@ unit ModiSDK;
 
 interface
 
+{$I switches.inc}
+
 type  //PluginInfo, for Init
   TPluginInfo = record
     //Info
diff --git a/Modis/SDK/StrUtils.pas b/Modis/SDK/StrUtils.pas
index 276d95a2..00cfbf08 100644
--- a/Modis/SDK/StrUtils.pas
+++ b/Modis/SDK/StrUtils.pas
@@ -1,6 +1,9 @@
 unit StrUtils;
 
 interface
+
+{$I switches.inc}
+
 uses ModiSDK;
 
 //function StrToAChar(Str: String): AChar;
diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas
index 2ca8f327..bbe933c6 100644
--- a/Modis/SDK/UPartyDefs.pas
+++ b/Modis/SDK/UPartyDefs.pas
@@ -6,6 +6,9 @@ unit UPartyDefs;
 *********************}
 
 interface
+
+{$I switches.inc}
+
 uses UPluginDefs;
 
 type
diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 69c258fb..4e1ea36b 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -7,6 +7,8 @@ unit uPluginDefs;
 
 interface
 
+{$I switches.inc}
+
 type
   DWORD = LongWord;
 
-- 
cgit v1.2.3


From 8c9c787a1326b90490543bd50b56fce9b89d9807 Mon Sep 17 00:00:00 2001
From: jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Sat, 3 Nov 2007 02:31:06 +0000
Subject: Windows Lazarus Build working again... Lazarus Project file includes
 the DPR, so that we have a unified Uses Clause ( keep this in mind please )

added "Delphi" to switches

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@560 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas     | 4 ++++
 Modis/SDK/UPartyDefs.pas  | 4 ++++
 Modis/SDK/UPluginDefs.pas | 4 ++++
 3 files changed, 12 insertions(+)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index 4423502c..7cc3ef1a 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -2,6 +2,10 @@ unit ModiSDK;
 
 interface
 
+{$IFDEF FPC}
+  {$MODE Delphi}
+{$ENDIF}
+
 {$I switches.inc}
 
 type  //PluginInfo, for Init
diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas
index bbe933c6..78b04bdd 100644
--- a/Modis/SDK/UPartyDefs.pas
+++ b/Modis/SDK/UPartyDefs.pas
@@ -7,6 +7,10 @@ unit UPartyDefs;
 
 interface
 
+{$IFDEF FPC}
+  {$MODE Delphi}
+{$ENDIF}
+
 {$I switches.inc}
 
 uses UPluginDefs;
diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index 4e1ea36b..f0a68fa9 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -7,6 +7,10 @@ unit uPluginDefs;
 
 interface
 
+{$IFDEF FPC}
+  {$MODE Delphi}
+{$ENDIF}
+
 {$I switches.inc}
 
 type
-- 
cgit v1.2.3


From 5e733f7e9cb2118651df90171db1892c9155e089 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Sun, 4 Nov 2007 21:00:20 +0000
Subject: Partymodule finished. All PartyScreens and SingScreen needs some
 adapting.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@583 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/UPartyDefs.pas | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas
index 78b04bdd..08f5fd44 100644
--- a/Modis/SDK/UPartyDefs.pas
+++ b/Modis/SDK/UPartyDefs.pas
@@ -31,9 +31,9 @@ type
   TUS_Party_Proc_Draw     = Function (ID: Integer): integer; stdcall;
 
   //----------------
-  // TUS_Party_Proc_Init - Structure of the Party Init Proc
+  // TUS_Party_Proc_DeInit - Structure of the Party DeInit Proc
   // This Function is called on SingScreen DeInit When Plugin abort Song or Song finishes
-  // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded
+  // Return Winner
   //----------------
   TUS_Party_Proc_DeInit   = Function (ID: Integer): integer; stdcall;
 
@@ -69,7 +69,7 @@ type
     // 8          | Only Playable with 2 and more players
     // 16         | Restrict Background Loading
     // 32         | Restrict Video Loading
-    // 64         | Not in Use, Don't set it!
+    // 64         | Increase TimesPlayed for Cur. Player
     // 128        | Not in Use, Don't set it!
     LoadingSettings: Byte;
 
@@ -111,6 +111,24 @@ type
     ModiDeInit: TUS_Party_Proc_DeInit;
   end;
 
+  //--------------
+  // Team Info Record. Used by "Party/GetTeamInfo" and "Party/SetTeamInfo"
+  //--------------
+  TTeamInfo = record
+    NumTeams: Byte;
+    Teaminfo: array[0..5] of record
+      Name:  PChar;     //Teamname
+      Score: Word;      //TeamScore
+      Joker: Byte;      //Team Jokers available
+      CurPlayer: Byte;  //Id of Cur. Playing Player
+      NumPlayers: Byte;
+      Playerinfo: array[0..3] of record
+        Name: PChar;        //Playername
+        TimesPlayed: Byte;  //How often this Player has Sung
+      end;
+    end;
+  end;
+
 //----------------
 // Some Default Constants
 //----------------
@@ -122,6 +140,7 @@ const
   MLS_TeamOnly    = 8;  //Only Playable with 2 and more players
   MLS_RestrictBG  = 16; //Restrict Background Loading
   MLS_RestrictVid = 32; //Restrict Video Loading
+  MLS_IncTP       = 64; //Increase TimesPlayed for Cur. Player
 
   // to use with TUS_ModiInfo.SingScreenSettings
   MSS_ShowNotes   = 1;  //ShowNotes
@@ -130,7 +149,7 @@ const
   MSS_AutoPlayback= 8;  //Start Audio Playback automaticaly
 
   //Standard (Duell) for TUS_ModiInfo.LoadingSettings and TUS_ModiInfo.SingScreenSettings
-  MLS_Standard    = MLS_LoadSong;
+  MLS_Standard    = MLS_LoadSong or MLS_IncTP;
   MSS_Standard    = MSS_ShowNotes or MSS_ShowScores or MSS_ShowTime or MSS_AutoPlayback;
 
 //-------------
-- 
cgit v1.2.3


From a1a9c43dcd6f61610eb3afea542aec5de5dabf30 Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Tue, 6 Nov 2007 19:40:06 +0000
Subject: Some changes to PluginInterface to fit with 64 Bit Systems. lParam is
 maily for use as Pointer, therefore standardtype: Pointer. wParam should
 mainly be used for ordinals. (Integer or Int64 on 64Bit Systems). Don't
 return addresses. Result is not assured to be Int64 on 64 Bit Systems.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@592 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/UPluginDefs.pas | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/UPluginDefs.pas b/Modis/SDK/UPluginDefs.pas
index f0a68fa9..68b35446 100644
--- a/Modis/SDK/UPluginDefs.pas
+++ b/Modis/SDK/UPluginDefs.pas
@@ -16,6 +16,17 @@ interface
 type
   DWORD = LongWord;
 
+  //Compatibility with 64 Bit Systems
+  {$IFDEF CPU32}
+  TwParam = Integer;
+  TlParam = Pointer; //lParam is Used for 32 Bit addresses DWord is large enough
+  {$ELSE}
+  TwParam = Int64;
+  TlParam = Pointer; //lParam used for 64Bit addresses in 64 Bit Systems(FreePascal)
+  {$ENDIF}
+  //wParam is mainly used for Ordninals
+  //lParam is mainly used for Pointers
+
   //----------------
   // TUS_PluginInfo - Some Infos from Plugin to Core.
   // Send when Plugininfo procedure is Called
@@ -47,16 +58,16 @@ type
   // In this Case the Caller of the Notifier gets the Return Value
   // Return Value Should not be -1
   //----------------
-  TUS_Hook            = Function (wParam, lParam: DWord): integer; stdcall;
-  TUS_Hook_of_Object  = Function (wParam, lParam: DWord): integer of Object;
+  TUS_Hook            = Function (wParam: TwParam; lParam: TlParam): integer; stdcall;
+  TUS_Hook_of_Object  = Function (wParam: TwParam; lParam: TlParam): integer of Object;
 
   //----------------
   // TUS_Service - Structure of the Service Function
   // This Function is called if the Registered Service is Called
   // Return Value Should not be SERVICE_NOT_FOUND
   //----------------
-  TUS_Service           = Function (wParam, lParam: DWord): integer; stdcall;
-  TUS_Service_of_Object = Function (wParam, lParam: DWord): integer of Object;
+  TUS_Service           = Function (wParam: TwParam; lParam: TlParam): integer; stdcall;
+  TUS_Service_of_Object = Function (wParam: TwParam; lParam: TlParam): integer of Object;
 
   //----------------
   // TUS_PluginInterface - Structure that Includes all Methods callable
@@ -76,7 +87,7 @@ type
     {Function start calling the Hook Chain
      0 if Chain is called until the End, -1 if Event Handle is not valid
      otherwise Return Value of the Hook that breaks the Chain}
-    NotivyEventHooks: Function (hEvent: THandle; wParam, lParam: dWord): integer; stdcall;
+    NotivyEventHooks: Function (hEvent: THandle; wParam: TwParam; lParam: TlParam): integer; stdcall;
 
     {Function Hooks an Event by Name.
      Returns Hook Handle on Success, otherwise 0}
@@ -101,7 +112,7 @@ type
 
     {Function Calls a Services Proc
      Returns Services Return Value or SERVICE_NOT_FOUND on Failure}
-    CallService: Function (ServiceName: PChar; wParam, lParam: dWord): integer; stdcall;
+    CallService: Function (ServiceName: PChar; wParam: TwParam; lParam: TlParam): integer; stdcall;
 
     {Function Returns Non Zero if a Service with the given Name Exists,
      otherwise 0}
@@ -151,12 +162,14 @@ const
   CORE_SM_WARNING = 2;
   CORE_SM_INFO    = 3;
 
+
 //----------------
 // Some Functions to Handle Version DWords
 //----------------
 Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord;
 Function VersiontoSting(const Version: DWord): String;
 
+
 implementation
 
 //--------------
-- 
cgit v1.2.3


From ec0343498ff3d83e10f468a635ba7c13a253ca2d Mon Sep 17 00:00:00 2001
From: jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Wed, 21 Nov 2007 01:34:49 +0000
Subject: added TeamDuell Mode...

jira#USDX-169

THANKS Jekatt

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@620 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/Team_Duell/TeamDuell.dpr | 237 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 237 insertions(+)
 create mode 100644 Modis/Team_Duell/TeamDuell.dpr

(limited to 'Modis')

diff --git a/Modis/Team_Duell/TeamDuell.dpr b/Modis/Team_Duell/TeamDuell.dpr
new file mode 100644
index 00000000..5b90e8ad
--- /dev/null
+++ b/Modis/Team_Duell/TeamDuell.dpr
@@ -0,0 +1,237 @@
+library TeamDuell ;
+
+uses
+  ModiSDK in '..\SDK\ModiSDK.pas',
+  StrUtils in '..\SDK\StrUtils.pas',
+  sysutils,
+  OpenGL12,
+  Windows;
+
+var
+ TeamPlayer: array of array of String;
+ StartPoints: array of integer;
+ CurSinger, NextSinger: array[0..2] of Integer;
+ MethodRec: TMethodRec;
+ SPT, PlayerSelected: array[0..2] of Integer;
+ TtoNextChange, starttick, endtick, ChangeOnSentence : Cardinal;
+ bps, RTtoNextChange: Double;
+ firsttime, secondtime: boolean;
+
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+  Info.Name    := 'PLUGIN_TEAMDUELL_NAME';
+
+  Info.Creator    := 'jekatt';
+  Info.PluginDesc := 'PLUGIN_TEAMDUELL_DESC';
+
+  Info.Typ := 8;
+
+  Info.NumPlayers := 31;
+  //Options
+  Info.LoadSong := True;  //Whether or not a Song should be Loaded
+  //Only When Song is Loaded:
+  Info.ShowScore := True; //Whether or not the Score should be shown
+  Info.ShowNotes := True; //Whether the Note Lines should be displayed
+  Info.LoadVideo := True; //Should the Video be loaded ?
+  Info.LoadBack  := True; //Should the Background be loaded ?
+
+  Info.BGShowFull := False;   //Whether the Background or the Video should be shown Fullsize
+  Info.BGShowFull_O := True;  //Whether the Background or the Video should be shown Fullsize
+
+  Info.ShowRateBar:= True;   //Whether the Bar that shows how good the player was sould be displayed
+  Info.ShowRateBar_O := false; //Load from Ini whether the Bar should be Displayed
+
+  Info.EnLineBonus := False;  //Whether LineBonus Should be enabled
+  Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+  //Options even when song is Not loaded
+  Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+  Info.TeamModeOnly := True;  //If True the Plugin can only be Played in Team Mode
+  Info.GetSoundData := False;  //If True the RData Procedure is called when new SoundData is available
+  Info.Dummy := False;         //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+var
+I,J: Integer;
+begin
+  // Get beginning of sentences
+ for I := 0 to Sentences.High do begin
+    SetLength(Startpoints, I+1);
+    Startpoints[I]:=Sentences.Sentence[I].Start;
+  end;
+  // Get Teams and Players
+  for I := 0 to TeamInfo.NumTeams-1 do
+    begin
+      SetLength(TeamPlayer, I+1);
+      for J := 0 to TeamInfo.Teaminfo[I].NumPlayers-1 do
+        begin
+          SetLength(TeamPlayer[I], J+1);
+          TeamPlayer[I,J] := Copy(String(TeamInfo.Teaminfo[I].Playerinfo[J].Name),1,8);
+          If (NOT(TeamPlayer[I,J] = (String(TeamInfo.Teaminfo[I].Playerinfo[J].Name)))) THEN TeamPlayer[I,J] := TeamPlayer[I,J]+'.';
+          SPT[I]:=J+1;
+        end;
+        CurSinger[I] := TeamInfo.Teaminfo[I].CurPlayer;
+        repeat
+            NextSinger[I] := random(SPT[I]);
+        until NOT(NextSinger[I] = CurSinger[I]) OR (SPT[I] = 1) ;
+    end;
+  ChangeOnSentence := 8;
+  starttick := GetTickCount;
+  firsttime := true;
+  secondtime := true;
+  bps := 1;
+  MethodRec := Methods;
+  LoadOpenGL;
+  Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+ I,timeline,x,y: Integer;
+ display: PChar;
+ start: boolean;
+begin
+  // TickCount(firstSentence) (not zero!)
+  If (CurSentence = ChangeOnSentence - 7) AND (firsttime) then
+  begin
+    firsttime := false;
+    starttick := GetTickCount;
+  end;
+  start := false;
+  // show first singers for 5sec
+  if  (CurSentence < 1) AND ((starttick + 5000) > GetTickCount) then begin start := true; end;
+
+  // TickCount(thirdSentence)
+  If (CurSentence = 3) AND (secondtime) then
+  begin
+    secondtime := false;
+    firsttime := true;
+    endtick := GetTickCount;
+    bps :=  (Startpoints[3]-Startpoints[1]) * 1000 / (endtick-starttick); // BeatsPerSecond
+  end;
+
+  // Time to next Change
+  RTtoNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((GetTickCount - starttick) / 1000);
+  TtoNextChange := Trunc(RTtoNextChange) +1;
+
+  // Next Singer for Team I
+  for I := 0 to High(TeamPlayer) do begin
+    if (CurSentence = ChangeOnSentence) AND NOT(PlayerSelected[I] = CurSentence) then begin
+      PlayerSelected[I] := CurSentence;
+      CurSinger[I] := NextSinger[I];
+      repeat
+        NextSinger[I] := random(SPT[I]);
+      until NOT(NextSinger[I] = CurSinger[I]) OR (SPT[I] = 1) ;
+    end;
+
+  // display bg
+  glColor4f (0.8, 0.8, 0.8, 1);
+  display := PChar(TeamPlayer[I,CurSinger[I]]);
+  if (TtoNextChange <= 11) OR (start = true) Then begin
+   glEnable(GL_TEXTURE_2D);
+   glDisable(GL_BLEND);
+   glColor4f (0, 0, 0, 1);
+   glBegin(GL_QUADS);
+   glVertex2f(PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY+8);
+   glVertex2f(PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY + 30);
+   glVertex2f(PlayerInfo.Playerinfo[I].PosX + 100, PlayerInfo.Playerinfo[I].PosY + 30);
+   glVertex2f(PlayerInfo.Playerinfo[I].PosX + 100, PlayerInfo.Playerinfo[I].PosY+8);
+   glEnd;
+   display := 'Next Singer';
+
+   // timeline
+   x:= 270; y:= 472;
+  if (TtoNextChange <= 5) AND (RTtoNextChange > 0) then begin
+   timeline := Trunc(RTtoNextChange*50);
+   glColor3f (0, 0, 0);
+   glBegin(GL_QUADS);
+   glVertex2f(x, y);
+   glVertex2f(x, y+18);
+   glVertex2f(x+6+250, y+18);
+   glVertex2f(x+6+250, y);
+   glEnd;
+   glColor3f (0.2, 0.2, 0.2);
+   glBegin(GL_QUADS);
+   glVertex2f(x+3, y+3);
+   glVertex2f(x+3, y+15);
+   glVertex2f(x+3+250, y+15);
+   glVertex2f(x+3+250, y+3);
+   glEnd;
+   glColor3f (0.8, 0.2, 0.2);
+   glBegin(GL_QUADS);
+   glColor3f (0.9, 0, 0); glVertex2f(x+3, y+3);
+   glColor3f (0.8, 0.3, 0.3); glVertex2f(x+3, y+15);
+   glColor3f (0.8, 0.3, 0.3); glVertex2f(x+3+timeline, y+15);
+   glColor3f (0.9, 0, 0); glVertex2f(x+3+timeline, y+3);
+   glEnd;
+  end;
+  glDisable(GL_TEXTURE_2D);
+  end;
+
+  // Names, Timer
+  if (TtoNextChange <= 9) Then begin display := PChar(TeamPlayer[I,NextSinger[I]]);
+    glColor4f (0.8, 0.1, 0.2, 1);
+    MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+85, PlayerInfo.Playerinfo[I].PosY+10, CreateStr(PChar(IntToStr(Trunc(TtoNextChange)))));
+  end;
+  glColor4f (0.8, 0.8, 0.8, 1);
+  if (CurSentence = 0) then display := PChar(TeamPlayer[I,CurSinger[I]]);
+  if (TtoNextChange <= 11) OR (start) Then MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+5, PlayerInfo.Playerinfo[I].PosY+10, display);
+  end;
+  if (CurSentence = ChangeOnSentence) then  begin ChangeOnSentence := CurSentence + 7; firsttime := true; end;
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+  I:Integer;
+  MaxScore: Word;
+begin
+  Result := 0;
+  MaxScore := 0;
+  for I := 0 to PlayerInfo.NumPlayers-1 do
+  begin
+    PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+    if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+    begin
+      MaxScore := PlayerInfo.Playerinfo[I].Score;
+      Case I of
+        0: Result :=  1;
+        1: Result :=  2;
+        2: Result :=  4;
+        3: Result :=  8;
+        4: Result := 16;
+        5: Result := 32;
+      end;
+    end
+    else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
+    begin
+      Case I of
+        0: Result := Result OR 1;
+        1: Result := Result OR 2;
+        2: Result := Result OR 4;
+        3: Result := Result OR 8;
+        4: Result := Result OR 16;
+        5: Result := Result OR 32;
+      end;
+    end;
+  end;
+
+  //When nobody has Points -> Everybody loose
+  if (MaxScore = 0) then
+    Result := 0;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
+
+
-- 
cgit v1.2.3


From b8113e39fe31dda0c9afc0c7cb19bbc81d7e6995 Mon Sep 17 00:00:00 2001
From: eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 23 Nov 2007 19:39:47 +0000
Subject: Changed string to pchar in ModiSDK.pas.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@642 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/5000Points/Until5000.dpr | 14 ++++++++++----
 Modis/SDK/ModiSDK.pas          | 24 ++++++++++++------------
 2 files changed, 22 insertions(+), 16 deletions(-)

(limited to 'Modis')

diff --git a/Modis/5000Points/Until5000.dpr b/Modis/5000Points/Until5000.dpr
index b826d212..72214a33 100644
--- a/Modis/5000Points/Until5000.dpr
+++ b/Modis/5000Points/Until5000.dpr
@@ -1,10 +1,16 @@
 library Until5000;
 
+{$IFDEF FPC}
+  {$MODE Delphi}
+{$ENDIF}
+
+{$I ../../Game/Code/switches.inc}
+
 uses
   ModiSDK in '..\SDK\ModiSDK.pas';
 
 //Gave the Plugins Info
-procedure PluginInfo (var Info: TPluginInfo); stdcall;
+procedure PluginInfo (var Info: TPluginInfo); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 begin
   Info.Name    := 'PLUGIN_UNTIL5000_NAME';
 
@@ -40,13 +46,13 @@ begin
 end;
 
 //Executed on Game Start //If True Game begins, else Failure
-function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 begin
 Result := True;
 end;
 
 //Executed everytime the Screen is Drawed //If False The Game finishes
-function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 var
 I: Integer;
 begin
@@ -62,7 +68,7 @@ Result := True;
 end;
 
 //Is Executed on Finish, Returns the Playernum of the Winner
-function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+function Finish (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 var
   I:Integer;
 begin
diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index 7cc3ef1a..f42d13d9 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -6,7 +6,7 @@ interface
   {$MODE Delphi}
 {$ENDIF}
 
-{$I switches.inc}
+{$I ../../Game/Code/switches.inc}
 
 type  //PluginInfo, for Init
   TPluginInfo = record
@@ -98,7 +98,7 @@ type  //PluginInfo, for Init
     Sentence:    array of record
       Start:    integer;
       StartNote:  integer;
-      Lyric:      string;
+      Lyric:      PChar;      // todo: eddie: changed string to pchar.
       LyricWidth: real;
       Koniec:   integer;
       BaseNote: integer;
@@ -122,11 +122,11 @@ type  //PluginInfo, for Init
   HSTREAM = DWORD;
 
   //Routines to gave to the Plugin
-  fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; stdcall; //Pointer to Texture Loader
-  //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall;       //Pointer to Translator
-  fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall;       //Procedure to Print Text   //Now translated automatically
-  fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall;       //Procedure that loads a Custom Sound
-  pModi_PlaySound = procedure (const Index: Cardinal); stdcall;       //Plays a Custom Sound
+  fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} //Pointer to Texture Loader
+  //fModi_Translate = function (const Name, Translation: AChar): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Pointer to Translator
+  fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Procedure to Print Text   //Now translated automatically
+  fModi_LoadSound = function (const Name: PChar): Cardinal; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Procedure that loads a Custom Sound
+  pModi_PlaySound = procedure (const Index: Cardinal); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Plays a Custom Sound
 
   TMethodRec = record
     LoadTex:    fModi_LoadTex;
@@ -136,15 +136,15 @@ type  //PluginInfo, for Init
   end;
   //DLL Funktionen
   //Gave the Plugins Info
-  pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall;
+  pModi_PluginInfo = procedure (var Info: TPluginInfo); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
   //Executed on Game Start //If True Game begins, else Failure
-  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
   //Executed everytime the Screen is Drawed //If False The Game finishes
-  fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+  fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
   //Is Executed on Finish, Returns the Playernum of the Winner
-  fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; stdcall;
+  fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
   //Procedure called when new Sound Data is available
-  pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); stdcall;
+  pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
 implementation
 
-- 
cgit v1.2.3


From 0a224a9f0439ab336873352d8e4baeef07d5090f Mon Sep 17 00:00:00 2001
From: eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 23 Nov 2007 19:45:58 +0000
Subject: Fixed ModiSDK.pas.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@643 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index f42d13d9..75846a20 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -6,7 +6,7 @@ interface
   {$MODE Delphi}
 {$ENDIF}
 
-{$I ../../Game/Code/switches.inc}
+{$I switches.inc}
 
 type  //PluginInfo, for Init
   TPluginInfo = record
-- 
cgit v1.2.3


From 2a3e98281141c47b08eb3876d7ed52fdfe4daa81 Mon Sep 17 00:00:00 2001
From: eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 23 Nov 2007 19:53:21 +0000
Subject: Now it should build again...

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@644 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index 75846a20..ff2aa200 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -98,7 +98,7 @@ type  //PluginInfo, for Init
     Sentence:    array of record
       Start:    integer;
       StartNote:  integer;
-      Lyric:      PChar;      // todo: eddie: changed string to pchar.
+      Lyric:      String;
       LyricWidth: real;
       Koniec:   integer;
       BaseNote: integer;
-- 
cgit v1.2.3


From d485dbfbe1cfb66492da22448449cc34f739ff4d Mon Sep 17 00:00:00 2001
From: eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 23 Nov 2007 20:14:50 +0000
Subject: Now it should really build on linux again...

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@646 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Modis/SDK/ModiSDK.pas | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'Modis')

diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas
index ff2aa200..7cc3ef1a 100644
--- a/Modis/SDK/ModiSDK.pas
+++ b/Modis/SDK/ModiSDK.pas
@@ -98,7 +98,7 @@ type  //PluginInfo, for Init
     Sentence:    array of record
       Start:    integer;
       StartNote:  integer;
-      Lyric:      String;
+      Lyric:      string;
       LyricWidth: real;
       Koniec:   integer;
       BaseNote: integer;
@@ -122,11 +122,11 @@ type  //PluginInfo, for Init
   HSTREAM = DWORD;
 
   //Routines to gave to the Plugin
-  fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} //Pointer to Texture Loader
-  //fModi_Translate = function (const Name, Translation: AChar): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Pointer to Translator
-  fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Procedure to Print Text   //Now translated automatically
-  fModi_LoadSound = function (const Name: PChar): Cardinal; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Procedure that loads a Custom Sound
-  pModi_PlaySound = procedure (const Index: Cardinal); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}       //Plays a Custom Sound
+  fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; stdcall; //Pointer to Texture Loader
+  //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall;       //Pointer to Translator
+  fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall;       //Procedure to Print Text   //Now translated automatically
+  fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall;       //Procedure that loads a Custom Sound
+  pModi_PlaySound = procedure (const Index: Cardinal); stdcall;       //Plays a Custom Sound
 
   TMethodRec = record
     LoadTex:    fModi_LoadTex;
@@ -136,15 +136,15 @@ type  //PluginInfo, for Init
   end;
   //DLL Funktionen
   //Gave the Plugins Info
-  pModi_PluginInfo = procedure (var Info: TPluginInfo); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
+  pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall;
   //Executed on Game Start //If True Game begins, else Failure
-  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
+  fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
   //Executed everytime the Screen is Drawed //If False The Game finishes
-  fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
+  fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
   //Is Executed on Finish, Returns the Playernum of the Winner
-  fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
+  fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; stdcall;
   //Procedure called when new Sound Data is available
-  pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
+  pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); stdcall;
 
 implementation
 
-- 
cgit v1.2.3