aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-09 18:38:23 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-09 18:38:23 +0000
commit417b8200e765f849e836667d717c4af6e15fcbf6 (patch)
treea40a295641b9f4572d3f0cccd215cb08c1ff202a /Game
parentceda196bb89e55fc4163c932e92803c16916060b (diff)
downloadusdx-417b8200e765f849e836667d717c4af6e15fcbf6.tar.gz
usdx-417b8200e765f849e836667d717c4af6e15fcbf6.tar.xz
usdx-417b8200e765f849e836667d717c4af6e15fcbf6.zip
Fixed some warnings ("missing result-values", "0 instead of nil", "comparison is always true", "range check errors")
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@943 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Screens/UScreenCredits.pas9
-rw-r--r--Game/Code/Screens/UScreenPartyPlayer.pas6
-rw-r--r--Game/Code/Screens/UScreenSingModi.pas328
3 files changed, 176 insertions, 167 deletions
diff --git a/Game/Code/Screens/UScreenCredits.pas b/Game/Code/Screens/UScreenCredits.pas
index 0daedf4d..254f9357 100644
--- a/Game/Code/Screens/UScreenCredits.pas
+++ b/Game/Code/Screens/UScreenCredits.pas
@@ -1218,11 +1218,16 @@ Log.LogStatus('',' JB-4');
else
f:=0;
- if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
+ if (CTime >= STime+Delay-10) and (CTime <= STime+Delay) then
+ begin
j:=CTime-(STime+Delay-10);
g:=32.6*j;
- end else
+ end
+ else
+ begin
g:=0;
+ end;
+
glBindTexture(GL_TEXTURE_2D, credits_whiteshark.TexNum);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
diff --git a/Game/Code/Screens/UScreenPartyPlayer.pas b/Game/Code/Screens/UScreenPartyPlayer.pas
index d46fb2b6..8897de0a 100644
--- a/Game/Code/Screens/UScreenPartyPlayer.pas
+++ b/Game/Code/Screens/UScreenPartyPlayer.pas
@@ -56,10 +56,12 @@ var
end;
begin
Result := true;
- If (PressedDown) Then
+ if (PressedDown) then
SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
- + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT);
+ + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT)
+ else
+ SDL_ModState := 0;
begin // Key Down
case PressedKey of
diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas
index 0526b76c..2e4f8240 100644
--- a/Game/Code/Screens/UScreenSingModi.pas
+++ b/Game/Code/Screens/UScreenSingModi.pas
@@ -283,7 +283,9 @@ var
S, I: integer;
T: integer;
begin
-//Set Playerinfo
+ Result := false;
+
+ //Set Playerinfo
PlayerInfo.NumPlayers := PlayersPlay;
for I := 0 to PlayerInfo.NumPlayers-1 do
begin
@@ -296,184 +298,148 @@ begin
end;
end;
-//Show Score
-if DLLMan.Selected.ShowScore then
-begin
- {//ScoreBG Mod
- // set player colors
- if PlayersPlay = 4 then begin
- if ScreenAct = 1 then begin
- LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
- Static[StaticP1TwoP].Texture.ColB, 'P1Dark');
- LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
- Static[StaticP2R].Texture.ColB, 'P2Dark');
-
-
-
- LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
- Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark');
- LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
- Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark');
-
-
-
- end;
- if ScreenAct = 2 then begin
- LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
- Static[StaticP1TwoP].Texture.ColB, 'P3Dark');
- LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
- Static[StaticP2R].Texture.ColB, 'P4Dark');
-
-
-
- LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
- Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark');
- LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
- Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark');
-
-
-
- end;
- end;
-
- if PlayersPlay = 6 then begin
- if ScreenAct = 1 then begin
- LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
- Static[StaticP1ThreeP].Texture.ColB, 'P1Dark');
- LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
+ //Show Score
+ if DLLMan.Selected.ShowScore then
+ begin
+ {//ScoreBG Mod
+ // set player colors
+ if PlayersPlay = 4 then begin
+ if ScreenAct = 1 then begin
+ LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
+ Static[StaticP1TwoP].Texture.ColB, 'P1Dark');
+ LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
Static[StaticP2R].Texture.ColB, 'P2Dark');
- LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
- Static[StaticP3R].Texture.ColB, 'P3Dark');
- LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
- Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark');
- LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
+ LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
+ Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark');
+ LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark');
- LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
- Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark');
- end;
- if ScreenAct = 2 then begin
- LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
- Static[StaticP1ThreeP].Texture.ColB, 'P4Dark');
- LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
- Static[StaticP2R].Texture.ColB, 'P5Dark');
- LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
- Static[StaticP3R].Texture.ColB, 'P6Dark');
+ end;
+ if ScreenAct = 2 then begin
+ LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
+ Static[StaticP1TwoP].Texture.ColB, 'P3Dark');
+ LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
+ Static[StaticP2R].Texture.ColB, 'P4Dark');
+ LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
+ Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark');
+ LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
+ Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark');
- LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
- Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark');
- LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
- Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark');
- LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
- Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark');
+ end;
+ end;
+ if PlayersPlay = 6 then begin
+ if ScreenAct = 1 then begin
+ LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
+ Static[StaticP1ThreeP].Texture.ColB, 'P1Dark');
+ LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
+ Static[StaticP2R].Texture.ColB, 'P2Dark');
+ LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
+ Static[StaticP3R].Texture.ColB, 'P3Dark');
- end;
- end;
- //end ScoreBG Mod }
-
-// set player names (for 2 screens and only Singstar skin)
- if ScreenAct = 1 then begin
- Text[TextP1].Text := 'P1';
- Text[TextP1TwoP].Text := 'P1'; // added for ps3 skin
- Text[TextP1ThreeP].Text := 'P1'; // added for ps3 skin
- Text[TextP2R].Text := 'P2';
- Text[TextP2M].Text := 'P2';
- Text[TextP3R].Text := 'P3';
- end;
- if ScreenAct = 2 then begin
- case PlayersPlay of
- 4: begin
- Text[TextP1TwoP].Text := 'P3';
- Text[TextP2R].Text := 'P4';
- end;
- 6: begin
- Text[TextP1ThreeP].Text := 'P4';
- Text[TextP2M].Text := 'P5';
- Text[TextP3R].Text := 'P6';
- end;
- end; // case
- end; // if
+ LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
+ Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark');
+ LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
+ Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark');
+ LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
+ Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark');
- // stereo <- and where iss P2M? or P3?
- Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX;
- Text[TextP1].X := Text[TextP1].X + 10*ScreenX;
- {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX;
- Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;}
- Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX;
- Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX;
+ end;
+ if ScreenAct = 2 then begin
+ LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
+ Static[StaticP1ThreeP].Texture.ColB, 'P4Dark');
+ LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
+ Static[StaticP2R].Texture.ColB, 'P5Dark');
+ LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
+ Static[StaticP3R].Texture.ColB, 'P6Dark');
- {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX;
- Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;}
- // .. and scores
- {if PlayersPlay = 1 then begin
- Tekst := IntToStr(Player[0].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP1Score].Text := Tekst;
- end;
- if PlayersPlay = 2 then begin
- Tekst := IntToStr(Player[0].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP1TwoPScore].Text := Tekst;
- Tekst := IntToStr(Player[1].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP2RScore].Text := Tekst;
- end;
+ LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
+ Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark');
+ LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
+ Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark');
+ LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
+ Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark');
- if PlayersPlay = 3 then begin
- Tekst := IntToStr(Player[0].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP1ThreePScore].Text := Tekst;
- Tekst := IntToStr(Player[1].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP2MScore].Text := Tekst;
- Tekst := IntToStr(Player[2].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP3RScore].Text := Tekst;
- end;
- if PlayersPlay = 4 then begin
+ end;
+ end;
+ //end ScoreBG Mod }
+
+ // set player names (for 2 screens and only Singstar skin)
if ScreenAct = 1 then begin
- Tekst := IntToStr(Player[0].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP1TwoPScore].Text := Tekst;
+ Text[TextP1].Text := 'P1';
+ Text[TextP1TwoP].Text := 'P1'; // added for ps3 skin
+ Text[TextP1ThreeP].Text := 'P1'; // added for ps3 skin
+ Text[TextP2R].Text := 'P2';
+ Text[TextP2M].Text := 'P2';
+ Text[TextP3R].Text := 'P3';
+ end;
- Tekst := IntToStr(Player[1].ScoreTotalI);
+ if ScreenAct = 2 then begin
+ case PlayersPlay of
+ 4: begin
+ Text[TextP1TwoP].Text := 'P3';
+ Text[TextP2R].Text := 'P4';
+ end;
+ 6: begin
+ Text[TextP1ThreeP].Text := 'P4';
+ Text[TextP2M].Text := 'P5';
+ Text[TextP3R].Text := 'P6';
+ end;
+ end; // case
+ end; // if
+
+
+ // stereo <- and where iss P2M? or P3?
+ Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX;
+ Text[TextP1].X := Text[TextP1].X + 10*ScreenX;
+
+ {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX;
+ Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;}
+
+ Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX;
+ Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX;
+
+ {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX;
+ Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;}
+
+ // .. and scores
+ {if PlayersPlay = 1 then begin
+ Tekst := IntToStr(Player[0].ScoreTotalI);
while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP2RScore].Text := Tekst;
+ Text[TextP1Score].Text := Tekst;
end;
- if ScreenAct = 2 then begin
- Tekst := IntToStr(Player[2].ScoreTotalI);
+
+ if PlayersPlay = 2 then begin
+ Tekst := IntToStr(Player[0].ScoreTotalI);
while Length(Tekst) < 5 do Tekst := '0' + Tekst;
Text[TextP1TwoPScore].Text := Tekst;
- Tekst := IntToStr(Player[3].ScoreTotalI);
+ Tekst := IntToStr(Player[1].ScoreTotalI);
while Length(Tekst) < 5 do Tekst := '0' + Tekst;
Text[TextP2RScore].Text := Tekst;
end;
- end;
- if PlayersPlay = 6 then begin
- if ScreenAct = 1 then begin
+ if PlayersPlay = 3 then begin
Tekst := IntToStr(Player[0].ScoreTotalI);
while Length(Tekst) < 5 do Tekst := '0' + Tekst;
Text[TextP1ThreePScore].Text := Tekst;
@@ -486,22 +452,58 @@ begin
while Length(Tekst) < 5 do Tekst := '0' + Tekst;
Text[TextP3RScore].Text := Tekst;
end;
- if ScreenAct = 2 then begin
- Tekst := IntToStr(Player[3].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP1ThreePScore].Text := Tekst;
- Tekst := IntToStr(Player[4].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP2MScore].Text := Tekst;
+ if PlayersPlay = 4 then begin
+ if ScreenAct = 1 then begin
+ Tekst := IntToStr(Player[0].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP1TwoPScore].Text := Tekst;
- Tekst := IntToStr(Player[5].ScoreTotalI);
- while Length(Tekst) < 5 do Tekst := '0' + Tekst;
- Text[TextP3RScore].Text := Tekst;
+ Tekst := IntToStr(Player[1].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP2RScore].Text := Tekst;
+ end;
+ if ScreenAct = 2 then begin
+ Tekst := IntToStr(Player[2].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP1TwoPScore].Text := Tekst;
+
+ Tekst := IntToStr(Player[3].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP2RScore].Text := Tekst;
+ end;
end;
- end; }
-end; //ShowScore
+ if PlayersPlay = 6 then begin
+ if ScreenAct = 1 then begin
+ Tekst := IntToStr(Player[0].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP1ThreePScore].Text := Tekst;
+
+ Tekst := IntToStr(Player[1].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP2MScore].Text := Tekst;
+
+ Tekst := IntToStr(Player[2].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP3RScore].Text := Tekst;
+ end;
+ if ScreenAct = 2 then begin
+ Tekst := IntToStr(Player[3].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP1ThreePScore].Text := Tekst;
+
+ Tekst := IntToStr(Player[4].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP2MScore].Text := Tekst;
+
+ Tekst := IntToStr(Player[5].ScoreTotalI);
+ while Length(Tekst) < 5 do Tekst := '0' + Tekst;
+ Text[TextP3RScore].Text := Tekst;
+ end;
+ end; }
+
+ end; //ShowScore
for S := 1 to 1 do
Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX;
@@ -509,17 +511,17 @@ end; //ShowScore
for T := 0 to 1 do
Text[T].X := Text[T].X + 10*ScreenX;
-if DLLMan.Selected.LoadSong then
-begin
- // update static menu with time ...
- Min := Round(LineState.CurrentTime) div 60;
- Sec := Round(LineState.CurrentTime) mod 60;
- Text[TextTimeText].Text := '';
- if Min < 10 then Text[TextTimeText].Text := '0';
- Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':';
- if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0';
- Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec);
-end;
+ if DLLMan.Selected.LoadSong then
+ begin
+ // update static menu with time ...
+ Min := Round(LineState.CurrentTime) div 60;
+ Sec := Round(LineState.CurrentTime) mod 60;
+ Text[TextTimeText].Text := '';
+ if Min < 10 then Text[TextTimeText].Text := '0';
+ Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':';
+ if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0';
+ Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec);
+ end;
// draw static menu (BG)
DrawBG;
@@ -617,7 +619,7 @@ end;
for T := 0 to 1 do
Text[T].X := Text[T].X - 10*ScreenX;
-
+ Result := true;
end;
procedure TScreenSingModi.Finish;