aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-12 16:47:43 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-12 16:47:43 +0000
commit06dd168485ab960930c907976e242b28c6a621ff (patch)
treed7f21c866a308b812795b247bf111413a79a4313
parent215f80b357450ff0b0c52a3aac017a0998acc0b7 (diff)
downloadusdx-06dd168485ab960930c907976e242b28c6a621ff.tar.gz
usdx-06dd168485ab960930c907976e242b28c6a621ff.tar.xz
usdx-06dd168485ab960930c907976e242b28c6a621ff.zip
cleanup + comments
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1187 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/USongs.pas25
1 files changed, 19 insertions, 6 deletions
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index a1ab86f9..fb423ff7 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -696,22 +696,35 @@ begin
end;
//Wrong song selected when tabs on bug End
+(**
+ * Returns the number of visible songs.
+ *)
function TCatSongs.VisibleSongs: integer;
var
- S: integer; // song
+ SongIndex: integer;
begin
Result := 0;
- for S := 0 to high(CatSongs.Song) do
- if CatSongs.Song[S].Visible = true then Inc(Result);
+ for SongIndex := 0 to High(CatSongs.Song) do
+ begin
+ if (CatSongs.Song[SongIndex].Visible) then
+ Inc(Result);
+ end;
end;
+(**
+ * Returns the index of a song in the subset of all visible songs.
+ * If all songs are visible, the result will be equal to the Index parameter.
+ *)
function TCatSongs.VisibleIndex(Index: integer): integer;
var
- S: integer; // song
+ SongIndex: integer;
begin
Result := 0;
- for S := 0 to Index-1 do
- if CatSongs.Song[S].Visible = true then Inc(Result);
+ for SongIndex := 0 to Index-1 do
+ begin
+ if (CatSongs.Song[SongIndex].Visible) then
+ Inc(Result);
+ end;
end;
function TCatSongs.SetFilter(FilterStr: string; const fType: Byte): Cardinal;