aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-03-09 20:35:41 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-03-09 20:35:41 +0000
commitaf048a3b2b8a239c818f1be7e5b96436a57dec27 (patch)
tree7b7a833a4a1b010c6c990bba056e9e13223e3cd5
parent4f56ffdc9dbeedaf82c4ec2833ded7f1de2709d9 (diff)
downloadusdx-af048a3b2b8a239c818f1be7e5b96436a57dec27.tar.gz
usdx-af048a3b2b8a239c818f1be7e5b96436a57dec27.tar.xz
usdx-af048a3b2b8a239c818f1be7e5b96436a57dec27.zip
bugfix: side effects in stats caused by aspect ratio
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2188 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UDataBase.pas19
1 files changed, 13 insertions, 6 deletions
diff --git a/Game/Code/Classes/UDataBase.pas b/Game/Code/Classes/UDataBase.pas
index 8e05475d..b9b0773a 100644
--- a/Game/Code/Classes/UDataBase.pas
+++ b/Game/Code/Classes/UDataBase.pas
@@ -439,10 +439,15 @@ begin
//Create Query
Case Typ of
- 0: Query := 'SELECT `Player` , `Difficulty` , `Score` , `Artist` , `Title` , `Date` FROM `US_Scores` INNER JOIN `US_Songs` ON (`SongID` = `ID`) ORDER BY `Score`';
- 1: Query := 'SELECT `Player` , ROUND (Sum(`Score`) / COUNT(`Score`)), COUNT(`rowid`) FROM `US_Scores` GROUP BY `Player` ORDER BY (Sum(`Score`) / COUNT(`Score`))';
- 2: Query := 'SELECT `Artist` , `Title` , `TimesPlayed` FROM `US_Songs` ORDER BY `TimesPlayed`';
- 3: Query := 'SELECT `Artist` , Sum(`TimesPlayed`) FROM `US_Songs` GROUP BY `Artist` ORDER BY Sum(`TimesPlayed`)';
+ 0: Query := 'SELECT `Player` , `Difficulty` , `Score` , `Artist` , `Title` , `Date` '+
+ 'FROM `US_Scores` INNER JOIN `US_Songs` ON (`SongID` = `ID`) ORDER BY `Score`';
+ 1: Query := 'SELECT `Player` , ROUND (Sum(`Score`) / COUNT(`Score`)), '+
+ 'COUNT(`rowid`) FROM `US_Scores` GROUP BY `Player` '+
+ 'ORDER BY (Sum(`Score`) / COUNT(`Score`))';
+ 2: Query := 'SELECT `Artist` , `Title` , `TimesPlayed` '+
+ 'FROM `US_Songs` WHERE `TimesPlayed` > 0 ORDER BY `TimesPlayed`';
+ 3: Query := 'SELECT `Artist` , Sum(`TimesPlayed`) '+
+ 'FROM `US_Songs` WHERE `TimesPlayed` > 0 GROUP BY `Artist` ORDER BY Sum(`TimesPlayed`)';
end;
//Add Order Direction
@@ -521,8 +526,10 @@ begin
Case Typ of
0: Query := 'SELECT COUNT(`SongID`) FROM `US_Scores`;';
1: Query := 'SELECT COUNT(DISTINCT `Player`) FROM `US_Scores`;';
- 2: Query := 'SELECT COUNT(`ID`) FROM `US_Songs`;';
- 3: Query := 'SELECT COUNT(DISTINCT `Artist`) FROM `US_Songs`;';
+ 2: Query := 'SELECT COUNT(`ID`) FROM `US_Songs` '+
+ 'WHERE `TimesPlayed` > 0;';
+ 3: Query := 'SELECT COUNT(DISTINCT `Artist`) FROM `US_Songs` '+
+ 'WHERE `TimesPlayed` > 0;';
end;
Result := ScoreDB.GetTableValue(Query);