From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001 From: whiteshark0 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/Don't_Get_Worse/Hold_The_Line.dpr | 170 ++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 Modis/Don't_Get_Worse/Hold_The_Line.dpr (limited to 'Modis/Don't_Get_Worse/Hold_The_Line.dpr') 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 -- cgit v1.2.3 From 541b91c3f40f283411faebe83d7cc50e2507c66e Mon Sep 17 00:00:00 2001 From: whiteshark0 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/Don't_Get_Worse/Hold_The_Line.dpr') 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 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/Don't_Get_Worse/Hold_The_Line.dpr') 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 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/Don't_Get_Worse/Hold_The_Line.dpr | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Modis/Don't_Get_Worse/Hold_The_Line.dpr') 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; -- cgit v1.2.3