aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* TLine.LyricWidth (width of the line in pixels) is marked as deprecated. Do ↵tobigun2008-07-141-2/+4
| | | | | | not use this as the stored width is not correct. Use TLyricsEngine.GetUpperLine().Width instead. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1191 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - cleanup/comments for TDisplay.Create tobigun2008-07-121-23/+11
| | | | | | | | - fading works now, it was broken because RenderW/H was not defined when SwapBuffers() was called for the first time. This caused glOrtho() to set the OpenGL error state. When fading was initialized in UDisplay this error-state was checked to see if glGenTextures failed. Although it didn't the error state was set because of the older error in glOrtho (Note: errors aren't reset after a successful OpenGL call), so it was wrongly assumed that no texture could be allocated. This problem was fixed by defining RenderW/H before the first call of SwapBuffers and resetting OpenGL's error state before calling an OpenGL function whose error state is to be checked. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1188 b956fd51-792f-4845-bead-9b4dfca2ff2c
* cleanup + commentstobigun2008-07-121-6/+19
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1187 b956fd51-792f-4845-bead-9b4dfca2ff2c
* unit UScreenStatMain;GogolNr12008-07-121-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Text has a new property -> Z (default is 0)mogguh2008-07-122-81/+95
| | | | | | | | | Selects on the options have been exchanged for SelectSlides (OptionsScreens are looking less broken (more to come)) Solmization has been banned from the options (it's still available via config.ini and is working) Uncommented poc ttf code [Back] button in OptionsRecord is skineable again git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1183 b956fd51-792f-4845-bead-9b4dfca2ff2c
* 64bit compatibility fixtobigun2008-07-031-4/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1162 b956fd51-792f-4845-bead-9b4dfca2ff2c
* indenting and cleanuptobigun2008-07-022-42/+38
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1158 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Audio/Video engine update:tobigun2008-07-0225-2299/+4681
| | | | | | | | | | | | | | | - lyrics<->audio synchronisation (TSyncSource) - better resampling (optional support for libsamplerate) - cleaner termination of audio/video streams/devices - improved decoders and decoder infrastructure - many other improvements/cleanups Currently just for testing (not enabled by default): - Background music - Voice-Passthrough (hear what you sing) - Video VSync git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1157 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Disabled Alt+Tab screen-mode switching for Windows and MacOSX. ↵tobigun2008-07-011-6/+5
| | | | | | SDL_SetVideoMode creates a new OpenGL RC (all textures are invalidated) so we have to reload all texture data (-> whitescreen bug or scrambled screen). Only Linux is able to handle screen-switching this way. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1156 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Delphi 7 compatibility fix:tobigun2008-06-163-60/+63
| | | | | | | - "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
* code improvement: conversion of case statements to boolean assignmentsk-m_schindler2008-06-141-30/+11
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1149 b956fd51-792f-4845-bead-9b4dfca2ff2c
* corrected String index to start from 1 and not from 0k-m_schindler2008-06-131-4/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1146 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - all references to the libc unit removed. The Libc unit (not the library) ↵tobigun2008-06-093-71/+83
| | | | | | | | | 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-0826-13356/+13356
| | | | | | - 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-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1143 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Added missing private section. Without defining it, methods are public by ↵tobigun2008-06-081-13/+14
| | | | | | default. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1142 b956fd51-792f-4845-bead-9b4dfca2ff2c
* clean uptobigun2008-06-082-331/+324
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1140 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Sakrileg (goto and label) replacement. Please check.k-m_schindler2008-06-082-109/+65
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1138 b956fd51-792f-4845-bead-9b4dfca2ff2c
* just some cleanuptobigun2008-06-078-503/+580
| | | | | | | | | | | - replaced many German and Polish comments - replaced many cryptic var-names - IlNut replaced with LengthNote - renamed the global var "Filename" to "ConversionFilename" to prevent unintended use of it - more readable code (hopefully), especially NewNote and OnSentenceEnd - added some comments on elementary classes/records and their fields git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1137 b956fd51-792f-4845-bead-9b4dfca2ff2c
* final removal of Macresourcesk-m_schindler2008-05-241-5/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1135 b956fd51-792f-4845-bead-9b4dfca2ff2c
* final removal of Macresources, indentationk-m_schindler2008-05-241-39/+45
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1134 b956fd51-792f-4845-bead-9b4dfca2ff2c
* AnsiContainsText for darwin removed - not needed any more; reworked some if ↵k-m_schindler2008-05-241-101/+98
| | | | | | statements; code indentation. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1133 b956fd51-792f-4845-bead-9b4dfca2ff2c
* just a test if bamboo works again if {$I switches.inc} is used instead of ↵tobigun2008-05-231-1/+1
| | | | | | {$I ../switches.inc} git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1129 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style unified and propset, indentationk-m_schindler2008-05-221-238/+245
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1126 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style unified and propsetk-m_schindler2008-05-221-10/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1125 b956fd51-792f-4845-bead-9b4dfca2ff2c
* mistake correction: compound occurences of string capitalized again.k-m_schindler2008-05-221-97/+97
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1123 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style set and unified, nicer code but no actual changek-m_schindler2008-05-221-89/+49
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1122 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style unified, nicer sourcek-m_schindler2008-05-221-114/+111
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1121 b956fd51-792f-4845-bead-9b4dfca2ff2c
* eol-style set and unified, no actual code changek-m_schindler2008-05-221-8/+8
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1120 b956fd51-792f-4845-bead-9b4dfca2ff2c
* unused variable commente, eol corrected and property setk-m_schindler2008-05-221-64/+64
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1117 b956fd51-792f-4845-bead-9b4dfca2ff2c
* unused variable removed, eol-style set to native, nicer codek-m_schindler2008-05-221-813/+817
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1116 b956fd51-792f-4845-bead-9b4dfca2ff2c
* unused variables removed, nicer code, eol-style set to nativek-m_schindler2008-05-211-129/+125
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1115 b956fd51-792f-4845-bead-9b4dfca2ff2c
* "whitescreen on window resizing" bug fixedtobigun2008-05-211-2/+8
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1114 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Video Aspect-Ratio fix (e.g. for 16:9 displays)tobigun2008-05-211-11/+23
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1113 b956fd51-792f-4845-bead-9b4dfca2ff2c
* adjustments for building with make, some editorial changes ...k-m_schindler2008-05-171-54/+55
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1106 b956fd51-792f-4845-bead-9b4dfca2ff2c
* MacResources commented out for now, property eol-style set to nativek-m_schindler2008-05-162-1/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1105 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Change IFDEF LINUX to UNIX in order to include darwink-m_schindler2008-05-161-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1101 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - bugfix: LoadTexture() did not initialize the TTexture result before it was ↵tobigun2008-05-142-95/+98
| | | | | | | | returned in an error case, so for example the TexNum field was set to some undefined result. This bugfix also fixes the videoBG whitescreen bug. Probably it is better to convert TTexture from a record to a class, so we can do the initialization stuff in a constructor and free assigned textures (TexNum) in the destructor with glDeleteTextures. This may help with theme-switching too. - added glext in UVideo.pas for GL_BGR, needed for accelerated colorspace conversion with swscale. This is disabled by default because it did not speed up that much in windows (also it was not slower). In Linux it seems to speeds up very well. 3ms instead of 7ms per frame. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1091 b956fd51-792f-4845-bead-9b4dfca2ff2c
* This was not supposed for check-intobigun2008-05-131-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1089 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - fixed video-backgroundtobigun2008-05-134-55/+134
| | | | | | | - fixed buggy SkipTime (using TRelativeTimer now) - TLineState is a class now. TLineState.CurrentTime is now automatically updated using TRelativeTimer git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1088 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - speedup patch for video playback. Should be a little faster than before.tobigun2008-05-131-468/+610
| | | | | | | | - use of video pts-info for better sync - some cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1087 b956fd51-792f-4845-bead-9b4dfca2ff2c
* cleanuptobigun2008-05-131-12/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1086 b956fd51-792f-4845-bead-9b4dfca2ff2c
* TRelativeTimer added. A replace for the buggy TimeSkip/SkipTime stuff. It ↵tobigun2008-05-131-10/+68
| | | | | | works like a simple stopwatch. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1085 b956fd51-792f-4845-bead-9b4dfca2ff2c
* increased possible parallel benchmark count from 8 to 32tobigun2008-05-131-2/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1084 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - removed useless for loops in UScreenSingf1fth_freed0m2008-05-121-0/+2
| | | | | | - added cmdline switch "window" for windowmode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1082 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Volumes are floating point values (single) now. The range changed from [0 .. ↵tobigun2008-05-109-91/+83
| | | | | | 100] to [0.0 .. 1.0] git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1081 b956fd51-792f-4845-bead-9b4dfca2ff2c
* Update to Bass 2.4. Do not forget to replace the old with the new dll.tobigun2008-05-105-110/+168
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1080 b956fd51-792f-4845-bead-9b4dfca2ff2c
* - input-source selection works now (with bass or portaudio with portmixer)tobigun2008-05-0915-970/+2189
| | | | | | | | | | | | | | | | - audio-effects (DSP) interface for audio-playback plus a simple voice removal example (does not sound that good) - FFMpeg support for BASS - audio-clock for FFMpeg for GetPosition and synchronisation - more compatible seeking in FFMpeg - clean termination of the audio interfaces/streams (especially ffmpeg) - Audio output device enumeration (selection will be added later to the sounds option screen) - display of threshold and volume in the record-options screen - threshold and volume can be changed with the 'T' (threshold) and '+'/'-' (source volume) keys - added a FadeIn() method to the IAudioPlayback interface - some minor changes to the audio classes/screens - new base-class for audio-playback classes (used by bass, portaudio and sdl) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1078 b956fd51-792f-4845-bead-9b4dfca2ff2c
* BugFix: ScoreScreen works again, starting to simplify / tidy up the whole thingmogguh2008-05-091-2/+2
| | | | | | Feature: Eight ratings instead of seven, rating for points reached changed (should be more fair now) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1072 b956fd51-792f-4845-bead-9b4dfca2ff2c
* set some non-error logs from error to statustobigun2008-05-082-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1071 b956fd51-792f-4845-bead-9b4dfca2ff2c