aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Reordering of the directories[1]: moving Game/Code to srck-m_schindler2008-08-2790-61286/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1302 b956fd51-792f-4845-bead-9b4dfca2ff2c
* check if projectm_create1 succeedstobigun2008-08-211-3/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1285 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib gcc added for darwin. Needed for linking on 10.4k-m_schindler2008-08-191-0/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1275 b956fd51-792f-4845-bead-9b4dfca2ff2c
* FFmpeg updatetobigun2008-08-098-78/+209
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1249 b956fd51-792f-4845-bead-9b4dfca2ff2c
* use SQLiteDLL instead of sqlite3.dlltobigun2008-08-081-1/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1240 b956fd51-792f-4845-bead-9b4dfca2ff2c
* FPC warning for unknown $C directive removedtobigun2008-08-081-0/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1237 b956fd51-792f-4845-bead-9b4dfca2ff2c
* warnings suppressedtobigun2008-08-081-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1233 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Update of SQLiteTable3. The file was additionally patched to support ↵tobigun2008-08-074-125/+865
| | | | | | Format()-style bindings (BindData) and FieldAsBlobPtr. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1225 b956fd51-792f-4845-bead-9b4dfca2ff2c
* moved AllocateHWnd/DeallocateHWnd from UCommon.pas to WinAllocation.pas. Do ↵tobigun2008-08-065-8/+113
| | | | | | NOT use them in USDX code. They are just by the DirWatch and Midi... libs in FPC (Windows). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1224 b956fd51-792f-4845-bead-9b4dfca2ff2c
* support for projectM 1.2tobigun2008-08-065-16/+31
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1221 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Cleaning up our SVN, removing unneeded files.mogguh2008-07-153-204/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1200 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Cleaning up our SVN, removing unneeded files.mogguh2008-07-153-0/+0
| | | | | | These DLLs will be provided via wiki.ultrastardeluxe.org git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1199 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Cleaning up our SVN, removing unneeded files.mogguh2008-07-1513-910/+0
| | | | | | zlportio is no longer needed. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1198 b956fd51-792f-4845-bead-9b4dfca2ff2c
* unit UScreenStatMain;GogolNr12008-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface {$IFDEF FPC} {$MODE Delphi} {$ENDIF} {$I switches.inc} uses UMenu, SDL, SysUtils, UDisplay, UMusic, UIni, UThemes; type TScreenStatMain = class(TMenu) private //Some Stat Value that don't need to be calculated 2 times SongswithVid: Cardinal; public TextOverview: integer; constructor Create; override; function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; procedure onShow; override; procedure SetAnimationProgress(Progress: real); override; procedure SetOverview; end; implementation uses UGraphic, UDataBase, USongs, USong, ULanguage, UCommon, {$IFDEF win32} windows, {$ELSE} sysconst, {$ENDIF} ULog; function TScreenStatMain.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down // check normal keys case WideCharUpperCase(CharCode)[1] of 'Q': begin Result := false; Exit; end; end; // check special keys case PressedKey of SDLK_ESCAPE, SDLK_BACKSPACE : begin Ini.Save; AudioPlayback.PlaySound(SoundLib.Back); FadeTo(@ScreenMain); end; SDLK_RETURN: begin //Exit Button Pressed if Interaction = 4 then begin AudioPlayback.PlaySound(SoundLib.Back); FadeTo(@ScreenMain); end else //One of the Stats Buttons Pressed begin AudioPlayback.PlaySound(SoundLib.Back); ScreenStatDetail.Typ := Interaction; FadeTo(@ScreenStatDetail); end; end; SDLK_LEFT: begin InteractPrev; end; SDLK_RIGHT: begin InteractNext; end; SDLK_UP: begin InteractPrev; end; SDLK_DOWN: begin InteractNext; end; end; end; end; constructor TScreenStatMain.Create; var I: integer; begin inherited Create; TextOverview := AddText(Theme.StatMain.TextOverview); LoadFromTheme(Theme.StatMain); AddButton(Theme.StatMain.ButtonScores); if (Length(Button[0].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[0]); AddButton(Theme.StatMain.ButtonSingers); if (Length(Button[1].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[1]); AddButton(Theme.StatMain.ButtonSongs); if (Length(Button[2].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[2]); AddButton(Theme.StatMain.ButtonBands); if (Length(Button[3].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[3]); AddButton(Theme.StatMain.ButtonExit); if (Length(Button[4].Text)=0) then AddButtonText(14, 20, Theme.Options.Description[4]); Interaction := 0; //Set Songs with Vid SongswithVid := 0; For I := 0 to Songs.SongList.Count -1 do if (TSong(Songs.SongList[I]).Video <> '') then Inc(SongswithVid); end; procedure TScreenStatMain.onShow; begin inherited; //Set Overview Text: SetOverview; end; procedure TScreenStatMain.SetOverview; type TwSystemTime = record wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: Word; end; var Overview, Formatstr: String; I: Integer; //Some Vars to Save Attributes to A1, A2, A3: Integer; A4, A5: String; Result1, Result2: AStatResult; ResetTime: TSystemTime; begin //Song Overview //Introduction Formatstr := Language.Translate ('STAT_OVERVIEW_INTRO'); (*Format: %0:d Ultrastar Version %1:d Day of Reset (A1) %2:d Month of Reset (A2) %3:d Year of Reset (A3)*) DateTimeToSystemTime(Database.GetStatReset, ResetTime); // ResetTime := GetFileCreation(Database.Filename); {$IFDEF MSWINDOWS} A1 := ResetTime.wDay; A2 := ResetTime.wMonth; A3 := ResetTime.wYear; {$ELSE} A1 := ResetTime.Day; A2 := ResetTime.Month; A3 := ResetTime.Year; {$ENDIF} try Overview := Format(Formatstr, [Language.Translate('US_VERSION'), A1, A2, A3]); except on E: EConvertError do Log.LogError('Error Parsing FormatString "STAT_OVERVIEW_INTRO": ' + E.Message); end; Formatstr := Language.Translate ('STAT_OVERVIEW_SONG'); {Format: %0:d Count Songs (A1) %1:d Count of Sung Songs (A2) %2:d Count of UnSung Songs %3:d Count of Songs with Video (A3) %4:s Name of the most popular Song} A1 := Songs.SongList.Count; A2 := Database.GetTotalEntrys(2); A3 := SongswithVid; SetLength(Result1, 1); Database.GetStats(Result1, 2, 1, 0, False); A4 := Result1[0].Artist; A5 := Result1[0].Title; try Overview := Overview + '\n \n' + Format(Formatstr, [A1, A2, A1-A2, A3, A4, A5]); except on E: EConvertError do Log.LogError('Error Parsing FormatString "STAT_OVERVIEW_SONG": ' + E.Message); end; //Player Overview Formatstr := Language.Translate ('STAT_OVERVIEW_PLAYER'); {Format: %0:d Count Players (A1) %1:s Best Player (Result) %2:d Best Players Score %3:s Best Score Player (Result2) %4:d Best Score} A1 := Database.GetTotalEntrys(1); SetLength(Result1, 1); Database.GetStats(Result1, 1, 1, 0, False); SetLength(Result2, 1); Database.GetStats(Result2, 0, 1, 0, False); try Overview := Overview + '\n \n' + Format(Formatstr, [A1, Result1[0].Player, Result1[0].AverageScore, Result2[0].Singer, Result2[0].Score]); except on E: EConvertError do Log.LogError('Error Parsing FormatString "STAT_OVERVIEW_PLAYER": ' + E.Message); end; Text[0].Text := Overview; end; procedure TScreenStatMain.SetAnimationProgress(Progress: real); var I: Integer; begin For I := 0 to high(Button) do Button[I].Texture.ScaleW := Progress; end; end. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1186 b956fd51-792f-4845-bead-9b4dfca2ff2c
* 64bit compatibility fixtobigun2008-07-031-173/+185
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1165 b956fd51-792f-4845-bead-9b4dfca2ff2c
* 64bit compatibility fixtobigun2008-07-033-310/+311
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1164 b956fd51-792f-4845-bead-9b4dfca2ff2c
* 64bit compatibility fixtobigun2008-07-032-56/+61
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1163 b956fd51-792f-4845-bead-9b4dfca2ff2c
* 64bit compatibility fixtobigun2008-07-033-278/+281
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1162 b956fd51-792f-4845-bead-9b4dfca2ff2c
* some additiona to the last 64bit compatibility committobigun2008-07-031-10/+11
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1161 b956fd51-792f-4845-bead-9b4dfca2ff2c
* ffmpeg pascal header 64bit compatibility fix.tobigun2008-07-039-699/+762
| | | | | | Further headers will follow. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1160 b956fd51-792f-4845-bead-9b4dfca2ff2c
* some minor adjustmentstobigun2008-07-011-30/+28
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1154 b956fd51-792f-4845-bead-9b4dfca2ff2c
* check for outdated libs and some minor type correctionstobigun2008-07-013-9/+48
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1153 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Delphi 7 compatibility fix:tobigun2008-06-161-4/+4
| | | | | | | - "in"-operator does not work with WideChar operands, e.g. "mychar in ['a..z'] - FPC_VERSION/RELEASE/PATCH (e.g. {$IF FPC_VERSION > 2}) must be defined as constants because delphi 7 does not care about {$IFDEF FPC} sections and complains about undefined constant expressions. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1150 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Removed some "const" parameter modifiers for external function declarations. ↵tobigun2008-06-143-47/+47
| | | | | | | | Pascal has no equivalent to C's "pointer to constant type" const modifier. E.g. "const char* cstr" is not equivalent to "const cstr: PChar". This is because the first is a variable pointer to a constant type and the latter is a constant pointer to a variable type. This means contrary to the C version, in the incorrect pascal version the string can be changed. So it is like a false friend in this example, although "cstr: PChar" is not correct either, as the string can be changed too. Also note that "var myvar: TMyType" is always passed as reference (a pointer is used for this, so it is equivalent to "myvar: PMyType"). This also normally applies to "const myvar: TMyType". But not if the type-size is < 4byte or the function is declared as stdcall or cdecl. In these cases the variable is passed on the stack and not as a pointer. So NEVER replace a C declaration "const my_type_t* my_var" with "const my_var: TMy_type" as it might fail. Use the var modifier instead. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1148 b956fd51-792f-4845-bead-9b4dfca2ff2c
* ffmpeg updatetobigun2008-06-148-29/+122
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1147 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - all references to the libc unit removed. The Libc unit (not the library) ↵tobigun2008-06-093-58/+30
| | | | | | | | | was for kylix compatibility and should not be used anymore. In addition it seems the libc unit is not available on 64bit systems. - added some functions that will be introduced with FPC 2.2.2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1145 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - set svn:eol-style to nativetobigun2008-06-0865-45190/+45190
| | | | | | - removed some svn:executable properties from non-executable files git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1144 b956fd51-792f-4845-bead-9b4dfca2ff2c
* inconsistent line endings unifiedtobigun2008-06-081-10/+10
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1143 b956fd51-792f-4845-bead-9b4dfca2ff2c
* svn:eol-style testtobigun2008-06-081-865/+865
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1141 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Changing macos to darwin and adjusting linklibk-m_schindler2008-05-242-12/+8
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1136 b956fd51-792f-4845-bead-9b4dfca2ff2c
* WIN32 -> MSWINDOWS; targets reorderd, linklib changedk-m_schindler2008-05-241-5/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1132 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style unified and propset, indentationk-m_schindler2008-05-231-85/+83
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1127 b956fd51-792f-4845-bead-9b4dfca2ff2c
* implementation of MKTAGtobigun2008-05-212-3582/+3593
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1112 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - changed "Windows" define to "MSWINDOWS"tobigun2008-05-194-22/+19
| | | | | | | - moved a few linklib for darwin to the libname section - added bass-define (undefined by default) for darwin back to switches.inc so switching to bass is easier git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1111 b956fd51-792f-4845-bead-9b4dfca2ff2c
* no actual text change, only eol unified and property eol-style set to nativek-m_schindler2008-05-171-1739/+1739
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1109 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin added, eol corrected and eol-style property set to nativek-m_schindler2008-05-161-2/+6
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1102 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1100 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1099 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1098 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1097 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1096 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-1/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1095 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1094 b956fd51-792f-4845-bead-9b4dfca2ff2c
* linklib for darwin addedk-m_schindler2008-05-161-0/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1093 b956fd51-792f-4845-bead-9b4dfca2ff2c
* mischis first try: linklib addedk-m_schindler2008-05-161-0/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1092 b956fd51-792f-4845-bead-9b4dfca2ff2c
* forgot to set the ENOSYS/E... error codes to the ESysE... ones from BaseUnixtobigun2008-05-141-1/+9
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1090 b956fd51-792f-4845-bead-9b4dfca2ff2c
* corrected ffmpeg error-codestobigun2008-05-132-25/+37
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1083 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Update to Bass 2.4. Do not forget to replace the old with the new dll.tobigun2008-05-1010-1838/+919
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1080 b956fd51-792f-4845-bead-9b4dfca2ff2c
* added "inherited ..." to all constructors to assure that the base-class ↵tobigun2008-05-082-0/+6
| | | | | | | | constructor is called. Different to C or Java, the constructor or destructor of the base class (except that of TObject) is not called by default if "inherited ..." is not given (very strange). This is no problem with classes inherited directly from TObject, because the TObject constructor is always called (and sets the values of the fields to 0-values) but i added inherited to these constructors too because the base class may change from TObject to something different and the "inherited" will probably not added in this case and causing problems. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1070 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - added the {$H+} switch for FPC (was introduced for the MacOSX before). ↵tobigun2008-05-0816-6/+67
| | | | | | | | This will use AnsiString (no length restriction and passed as pointer) instead of ShortString (= array[0..255] of Char). This is the standard in Delphi so we should use it in FPC too. The FPC reference doc states that {$H-} is standard in FPC, but for any reason in my FPC 2.2.0 for win {$H+} is standard. Maybe the reference guide is somewhat outdated, so probably nothing changed because H+ was the default already. - removed DLL_CDECL from switches.inc and put it directly into the headers (used in bass and freeimage). Libs shouldn't be declared STDCALL or CDECL globally because it depends on how the libs are compiled. For windows, STDCALL and CDECL are possible, so please define this on a per library base. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1069 b956fd51-792f-4845-bead-9b4dfca2ff2c