From 62c82114318ed04ce42617fa9ce2e179834dbda4 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 19 Sep 2007 11:44:10 +0000 Subject: added UCommon ( in classes ) for lazarus... common functions needed for lazarus ( and others ) can be put in here. also this now compiles on lazarus.. ( dosnt link yet... but I dont get any critical compiler errors ) tested to compile in my delphi, and basic functionality is fine. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@395 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/TextGL.pas | 11 +- Game/Code/Classes/UCommon.pas | 98 ++++++++ Game/Code/Classes/UCovers.pas | 4 + Game/Code/Classes/UDraw.pas | 1 - Game/Code/Classes/UFiles.pas | 9 + Game/Code/Classes/UGraphicClasses.pas | 14 +- Game/Code/Classes/ULog.pas | 4 + Game/Code/Classes/UMusic.pas | 26 ++- Game/Code/Classes/USongs.pas | 6 + Game/Code/Classes/UTexture.pas | 45 +++- Game/Code/Classes/UThemes.pas | 7 +- Game/Code/Classes/UVideo.pas | 9 +- Game/Code/Menu/UDisplay.pas | 20 +- Game/Code/Menu/UMenu.pas | 7 +- Game/Code/Screens/UScreenCredits.pas | 12 +- Game/Code/Screens/UScreenEditConvert.pas | 14 +- Game/Code/Screens/UScreenEditSub.pas | 12 +- Game/Code/Screens/UScreenScore.pas | 14 +- Game/Code/Screens/UScreenSing.pas | 10 +- Game/Code/Screens/UScreenSong.pas | 7 +- Game/Code/Screens/UScreenTop5.pas | 13 +- Game/Code/UltraStar.dpr | 1 + Game/Code/UltraStar.lpi | 389 ++++++++++++++----------------- Game/Code/UltraStar.lpr | 6 +- Game/Code/lib/midi/MidiFile.pas | 13 +- Game/Code/lib/midi/Midiin.pas | 4 +- 26 files changed, 482 insertions(+), 274 deletions(-) create mode 100644 Game/Code/Classes/UCommon.pas (limited to 'Game') diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas index 0f4ae82e..aa5fa18b 100644 --- a/Game/Code/Classes/TextGL.pas +++ b/Game/Code/Classes/TextGL.pas @@ -2,7 +2,16 @@ unit TextGL; interface -uses OpenGL12, SDL, UTexture, Classes, ULog; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + + +uses OpenGL12, + SDL, + UTexture, + Classes, + ULog; procedure BuildFont; // Build Our Bitmap Font procedure KillFont; // Delete The Font diff --git a/Game/Code/Classes/UCommon.pas b/Game/Code/Classes/UCommon.pas new file mode 100644 index 00000000..f25e025b --- /dev/null +++ b/Game/Code/Classes/UCommon.pas @@ -0,0 +1,98 @@ +unit UCommon; + +interface + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +uses + windows; + +{$IFDEF FPC} + +type + TWndMethod = procedure(var Message: TMessage) of object; + +function RandomRange(aMin: Integer; aMax: Integer) : Integer; +function AllocateHWnd(Method: TWndMethod): HWND; +procedure DeallocateHWnd(Wnd: HWND); + +function MaxValue(const Data: array of Double): Double; +function MinValue(const Data: array of Double): Double; +{$ENDIF} + +implementation + +{$IFDEF FPC} + +function MaxValue(const Data: array of Double): Double; +var + I: Integer; +begin + Result := Data[Low(Data)]; + for I := Low(Data) + 1 to High(Data) do + if Result < Data[I] then + Result := Data[I]; +end; + +function MinValue(const Data: array of Double): Double; +var + I: Integer; +begin + Result := Data[Low(Data)]; + for I := Low(Data) + 1 to High(Data) do + if Result > Data[I] then + Result := Data[I]; +end; + +function RandomRange(aMin: Integer; aMax: Integer) : Integer; +begin +RandomRange := Random(aMax-aMin) + aMin ; +end; + + + +// TODO : JB this is dodgey and bad... find a REAL solution ! +function AllocateHWnd(Method: TWndMethod): HWND; +var + TempClass: TWndClass; + ClassRegistered: Boolean; +begin +(* + UtilWindowClass.hInstance := HInstance; +{$IFDEF PIC} + UtilWindowClass.lpfnWndProc := @DefWindowProc; +{$ENDIF} + ClassRegistered := GetClassInfo(HInstance, UtilWindowClass.lpszClassName, TempClass); + if not ClassRegistered or (TempClass.lpfnWndProc <> @DefWindowProc) then + begin + if ClassRegistered then + Windows.UnregisterClass(UtilWindowClass.lpszClassName, HInstance); + Windows.RegisterClass(UtilWindowClass); + end; + Result := CreateWindowEx(WS_EX_TOOLWINDOW, UtilWindowClass.lpszClassName, '', WS_POPUP {+ 0}, 0, 0, 0, 0, 0, 0, HInstance, nil); +*) + Result := CreateWindowEx(WS_EX_TOOLWINDOW, '', '', WS_POPUP {+ 0}, 0, 0, 0, 0, 0, 0, HInstance, nil); + +(* + if Assigned(Method) then + SetWindowLong(Result, GWL_WNDPROC, Longint(MakeObjectInstance(Method))); +*) +end; + +procedure DeallocateHWnd(Wnd: HWND); +var + Instance: Pointer; +begin + Instance := Pointer(GetWindowLong(Wnd, GWL_WNDPROC)); + DestroyWindow(Wnd); + +// if Instance <> @DefWindowProc then +// FreeObjectInstance(Instance); +end; + +{$ENDIF} + + +end. diff --git a/Game/Code/Classes/UCovers.pas b/Game/Code/Classes/UCovers.pas index 4040b4d8..efed1435 100644 --- a/Game/Code/Classes/UCovers.pas +++ b/Game/Code/Classes/UCovers.pas @@ -2,6 +2,10 @@ unit UCovers; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses OpenGL12, Windows, Math, diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index cbfafbe6..a28f1efc 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -9,7 +9,6 @@ interface uses UThemes, ModiSDK, UGraphicClasses; - // dialogs; procedure SingDraw; procedure SingModiDraw (PlayerInfo: TPlayerInfo); diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index 008061a4..bbb22136 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -2,6 +2,10 @@ unit UFiles; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses SysUtils, ULog, UMusic, @@ -108,7 +112,12 @@ begin //Required Information Song.Mp3 := ''; + {$IFDEF FPC} + Song.BPM := NULL; + {$ELSE} Song.BPM := 0; + {$ENDIF} + Song.GAP := 0; Song.Start := 0; Song.Finish := 0; diff --git a/Game/Code/Classes/UGraphicClasses.pas b/Game/Code/Classes/UGraphicClasses.pas index 83d192d6..761ec058 100644 --- a/Game/Code/Classes/UGraphicClasses.pas +++ b/Game/Code/Classes/UGraphicClasses.pas @@ -3,6 +3,7 @@ unit UGraphicClasses; interface uses UTexture; + const DelayBetweenFrames : Cardinal = 60; type @@ -79,7 +80,18 @@ type var GoldenRec : TEffectManager; implementation -uses sysutils, Windows,OpenGl12, UIni, UMain, UThemes, USkins, UGraphic, UDrawTexture, math, dialogs; + +uses sysutils, + Windows, + OpenGl12, + UIni, + UMain, + UThemes, + USkins, + UGraphic, + UDrawTexture, + UCommon, + math; //TParticle Constructor TParticle.Create(cX,cY: Real; cScreen: Integer; cLive: Byte; cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; Player: Cardinal); diff --git a/Game/Code/Classes/ULog.pas b/Game/Code/Classes/ULog.pas index 2233ec1b..4a18b8e2 100644 --- a/Game/Code/Classes/ULog.pas +++ b/Game/Code/Classes/ULog.pas @@ -2,6 +2,10 @@ unit ULog; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses Classes; type diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index f9c6457d..be585ee1 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -2,6 +2,11 @@ unit UMusic; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + + uses Classes, Windows, Messages, @@ -180,7 +185,14 @@ const ModeStr: array[TMPModes] of string = ('Not ready', 'Stopped', 'Playing', 'Recording', 'Seeking', 'Paused', 'Open'); implementation -uses UGraphic, URecord, UFiles, UIni, UMain, UThemes; + +uses UCommon, + UGraphic, + URecord, + UFiles, + UIni, + UMain, + UThemes; procedure InitializeSound; begin @@ -195,12 +207,18 @@ var begin Log.BenchmarkStart(4); Log.LogStatus('Initializing Playback Subsystem', 'Music Initialize'); + Loaded := false; - Loop := false; - fHWND := AllocateHWND( nil); + Loop := false; + + fHWND := AllocateHWND( nil); // TODO : JB - can we do something different here ?? lazarus didnt like this function - if not BASS_Init(1, 44100, 0, fHWND, nil) then begin + if not BASS_Init(1, 44100, 0, fHWND, nil) then + begin + {$IFNDEF FPC} + // TODO : JB find a way to do this nice.. Application.MessageBox ('Could not initialize BASS', 'Error'); + {$ENDIF} Exit; end; diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 7065024b..f5afbee2 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -1,6 +1,12 @@ unit USongs; interface + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + uses SysUtils, ULog, UTexture, UCatCovers; type diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index d1ca0917..4eb00b4b 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -1,10 +1,5 @@ unit UTexture; -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - - // Plain (alpha = 1) // Transparent // Transparent Range @@ -17,16 +12,24 @@ unit UTexture; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + uses OpenGL12, Windows, Math, Classes, SysUtils, - {$IFNDEF FPC} Graphics, + + {$IFDEF FPC} + lazjpeg, + {$ELSE} JPEG, PNGImage, {$ENDIF} + UCommon, UThemes; @@ -192,11 +195,19 @@ var begin hls[0]:=hue; - clr[0]:=src[0]/255; clr[1]:=src[1]/255; clr[2]:=src[2]/255; + clr[0] := src[0]/255; + clr[1] := src[1]/255; + clr[2] := src[2]/255; + //calculate luminance and saturation from rgb - hls[1]:=maxvalue(clr); //l:=... - delta:=hls[1]-minvalue(clr); - if hls[1]=0.0 then hls[2]:=0.0 else hls[2]:=delta/hls[1]; //v:=... + hls[1] := maxvalue(clr); //l:=... + delta := hls[1] - minvalue(clr); + + if hls[1] = 0.0 then + hls[2] := 0.0 + else + hls[2] := delta/hls[1]; //v:=... + // calc new rgb from our hls (h from color, l ans s from pixel) // if (hls[1]<>0.0) and (hls[2]<>0.0) then // only if colorizing makes sense begin @@ -287,7 +298,10 @@ var Res: TResourceStream; TextureB: TBitmap; TextureJ: TJPEGImage; + {$IFNDEF FPC} TexturePNG: TPNGObject; + {$ENDIF} + TextureAlpha: array of byte; AlphaPtr: PByte; TransparentColor: TColor; @@ -306,6 +320,8 @@ var RGBPtr: PByte; myHue: Double; begin + {$IFNDEF FPC} // TODO : JB eeeew this is a nasty one... + // but lazarus implementation scanlines is different :( Log.BenchmarkStart(4); Mipmapping := true; @@ -347,7 +363,10 @@ begin TextureJ.Free; end - else if Format = 'PNG' then begin + else if Format = 'PNG' then + begin + {$IFNDEF FPC} + // TODO : JB - fix this for lazarus.. TexturePNG := TPNGObject.Create; if FromRegistry then TexturePNG.LoadFromStream(Res) else begin @@ -389,6 +408,7 @@ begin setlength(TextureAlpha,0); // just no special transparency for unimplemented transparency types (ptmBit) // transparent png hack end TexturePNG.Free; + {$ENDIF} end; if FromRegistry then Res.Free; @@ -872,7 +892,8 @@ begin if Log.BenchmarkTimeLength[4] >= 1 then Log.LogBenchmark('**********> Texture Load Time Warning - ' + Format + '/' + Identifier + '/' + Typ, 4); - end; // logerror + end; // logerror + {$ENDIF} end; {procedure ResizeTexture(s: pbytearray; d: pbytearray); diff --git a/Game/Code/Classes/UThemes.pas b/Game/Code/Classes/UThemes.pas index b2e2b01e..6436ee39 100644 --- a/Game/Code/Classes/UThemes.pas +++ b/Game/Code/Classes/UThemes.pas @@ -7,7 +7,9 @@ interface {$ENDIF} uses -IniFiles, SysUtils, Classes; + IniFiles, + SysUtils, + Classes; type TRGB = record @@ -739,7 +741,8 @@ uses {{$IFDEF TRANSLATE} ULanguage, {{$ENDIF} -USkins, UIni, Dialogs; + USkins, + UIni; constructor TTheme.Create(FileName: string); begin diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index c97057ac..4c8a4076 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -5,10 +5,6 @@ # based on 'An ffmpeg and SDL Tutorial' (http://www.dranger.com/ffmpeg/) # #############################################################################} -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - //{$define DebugDisplay} // uncomment if u want to see the debug stuff {$define DebugFrames} {$define Info} @@ -18,6 +14,11 @@ unit UVideo; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + uses SDL, UGraphicClasses, textgl, diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas index 6ad01406..160e8a73 100644 --- a/Game/Code/Menu/UDisplay.pas +++ b/Game/Code/Menu/UDisplay.pas @@ -2,7 +2,15 @@ unit UDisplay; interface -uses Windows, SDL, UMenu, OpenGL12, SysUtils; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +uses Windows, + SDL, + UMenu, + OpenGL12, + SysUtils; type TDisplay = class @@ -53,10 +61,12 @@ var implementation uses - {$IFNDEF FPC} - Graphics, + {$IFDEF FPC} + lazjpeg, + {$ELSE} JPEG, {$ENDIF} + graphics, TextGL, // UFiles, UMain, @@ -320,8 +330,8 @@ begin end; glReadPixels(0, 0, ScreenW, ScreenH, GL_RGBA, GL_UNSIGNED_BYTE, @PrintScreenData[0]); - Bitmap := TBitmap.Create; - Bitmap.Width := ScreenW; + Bitmap := TBitmap.Create; + Bitmap.Width := ScreenW; Bitmap.Height := ScreenH; for Y := 0 to ScreenH-1 do diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas index 3c50967d..1e6c1e87 100644 --- a/Game/Code/Menu/UMenu.pas +++ b/Game/Code/Menu/UMenu.pas @@ -154,7 +154,12 @@ const implementation -uses UMain, UDrawTexture, UGraphic, UDisplay, UCovers, USkins, Dialogs; +uses UMain, + UDrawTexture, + UGraphic, + UDisplay, + UCovers, + USkins; destructor TMenu.Destroy; begin diff --git a/Game/Code/Screens/UScreenCredits.pas b/Game/Code/Screens/UScreenCredits.pas index 21e164b9..3b1efc6e 100644 --- a/Game/Code/Screens/UScreenCredits.pas +++ b/Game/Code/Screens/UScreenCredits.pas @@ -104,24 +104,16 @@ const implementation -uses // Dialogs, - Windows, +uses Windows, UGraphic, UMain, UIni, USongs, Textgl, -// opengl, ULanguage, + UCommon, Math; -{$IFDEF FPC} -// TODO : JB - move this to a lazarus common file for ultrastar -function RandomRange(aMin: Integer; aMax: Integer) : Integer; -begin -RandomRange := Random(aMax-aMin) + aMin ; -end; -{$ENDIF} function TScreenCredits.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; begin diff --git a/Game/Code/Screens/UScreenEditConvert.pas b/Game/Code/Screens/UScreenEditConvert.pas index cb6aef6d..762f84c2 100644 --- a/Game/Code/Screens/UScreenEditConvert.pas +++ b/Game/Code/Screens/UScreenEditConvert.pas @@ -2,6 +2,10 @@ unit UScreenEditConvert; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + {$I switches.inc} uses UMenu, @@ -353,11 +357,13 @@ begin if ((ATrack[T].Status div 1) and 1) = 1 then Inc(Result); end; +{$IFDEF UseMIDIPort} procedure TScreenEditConvert.MidiFile1MidiEvent(event: PMidiEvent); begin // Log.LogStatus(IntToStr(event.event), 'MIDI'); MidiOut.PutShort(event.event, event.data1, event.data2); end; +{$ENDIF} constructor TScreenEditConvert.Create; var @@ -407,6 +413,7 @@ var C: integer; // channel CN: integer; // channel note begin +{$IFDEF UseMIDIPort} MidiOut := TMidiOutput.Create(nil); if Ini.Debug = 1 then MidiOut.ProductName := 'Microsoft GS Wavetable SW Synth'; // for my kxproject without midi table @@ -486,6 +493,7 @@ begin end; Interaction := 0; +{$ENDIF} end; function TScreenEditConvert.Draw: boolean; @@ -552,7 +560,9 @@ begin end; // playing line - X := 60+MidiFile.GetCurrentTime/MidiFile.GetTrackLength*730; + {$IFDEF UseMIDIPort} + X := 60 + MidiFile.GetCurrentTime/MidiFile.GetTrackLength*730; + {$ENDIF} DrawLine(X, Y, X, Bottom, 0.3, 0.3, 0.3); @@ -560,8 +570,10 @@ end; procedure TScreenEditConvert.onHide; begin +{$IFDEF UseMIDIPort} MidiOut.Close; MidiOut.Free; +{$ENDIF} end; end. diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 7184b0b6..3843fbf4 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -1169,11 +1169,12 @@ begin Exit; end else begin + {$IFDEF UseMIDIPort} MidiOut := TMidiOutput.Create(nil); if Ini.Debug = 1 then MidiOut.ProductName := 'Microsoft GS Wavetable SW Synth'; // for my kxproject without midi table MidiOut.Open; - + {$ENDIF} Text[TextTitle].Text := AktSong.Title; Text[TextArtist].Text := AktSong.Artist; Text[TextMp3].Text := AktSong.Mp3; @@ -1224,11 +1225,13 @@ begin if PlaySentenceMidi then begin MidiPos := USTime.GetTime - MidiTime + MidiStart; + {$IFDEF UseMIDIPort} // stop the music if (MidiPos > MidiStop) then begin MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[MidiLastNote].Ton + 60, 127); PlaySentenceMidi := false; end; + {$ENDIF} // click AktBeat := Floor(GetMidBeat(MidiPos - AktSong.GAP / 1000)); @@ -1236,13 +1239,16 @@ begin if AktBeat <> LastClick then begin for Pet := 0 to Czesci[0].Czesc[Czesci[0].Akt].HighNut do - if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Start = AktBeat) then begin + if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Start = AktBeat) then + begin + {$IFDEF UseMIDIPort} LastClick := AktBeat; if Pet > 0 then MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet-1].Ton + 60, 127); MidiOut.PutShort($91, Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Ton + 60, 127); MidiLastNote := Pet; + {$ENDIF} end; end; @@ -1312,8 +1318,10 @@ end; procedure TScreenEditSub.onHide; begin + {$IFDEF UseMIDIPort} MidiOut.Close; MidiOut.Free; + {$ENDIF} //Music.SetVolume(100); end; diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas index 19e934f4..42edf4c9 100644 --- a/Game/Code/Screens/UScreenScore.pas +++ b/Game/Code/Screens/UScreenScore.pas @@ -2,6 +2,10 @@ unit UScreenScore; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + uses UMenu, SDL, @@ -274,7 +278,7 @@ begin Text[TextName[PP]].Text := Ini.Name[P]; - {{$IFDEF TRANSLATE} + //{$IFDEF TRANSLATE} case (Player[P].ScoreTotalI) of 0..2000: Text[TextScore[PP]].Text := Language.Translate('SING_SCORE_TONE_DEAF'); 2010..4000: Text[TextScore[PP]].Text := Language.Translate('SING_SCORE_AMATEUR'); @@ -284,7 +288,7 @@ begin 9010..9800: Text[TextScore[PP]].Text := Language.Translate('SING_SCORE_SUPERSTAR'); 9810..10000: Text[TextScore[PP]].Text := Language.Translate('SING_SCORE_ULTRASTAR'); end; - {{$ELSE}{ + (* {$ELSE}{ case (Player[P].ScoreTotalI) of 0..2000: Text[TextScore[PP]].Text := 'Tone Deaf'; 2010..4000: Text[TextScore[PP]].Text := 'Amateur'; @@ -294,7 +298,7 @@ begin 9010..9800: Text[TextScore[PP]].Text := 'Superstar'; 9810..10000: Text[TextScore[PP]].Text := 'Ultrastar'; end; - {$ENDIF} + {$ENDIF} *) S := IntToStr(Player[P].ScoreI); while (Length(S)<4) do S := '0' + S; @@ -313,10 +317,12 @@ begin Text[TextTotalScore[PP]].Text := S; // Level bar length -{ Lev := ((Round(Player[P].Punkty) div 10) * 10) / 10000; +(* + Lev := ((Round(Player[P].Punkty) div 10) * 10) / 10000; Static[StaticLevel[PP]].Texture.H := Round(Static[StaticBackLevel[PP]].Texture.H * Lev); Static[StaticLevel[PP]].Texture.Y := Static[StaticBackLevel[PP]].Texture.Y + Static[StaticBackLevel[PP]].Texture.H - Static[StaticLevel[PP]].Texture.H; Static[StaticLevelRound[PP]].Texture.Y := Static[StaticLevel[PP]].Texture.Y - Static[StaticLevelRound[PP]].Texture.H;} +*) // doesn't align too much... (to fix) // hint: play with wrapping textures // resolution: setting TexY1 and TexY2 to 0.1 and 0.9 diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index a5f6a317..1dd31ae9 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,6 +2,11 @@ unit UScreenSing; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; @@ -364,8 +369,9 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -{ OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);} +(* OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) + // todo: VideoGap and Start time verwursten FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); FFmpegSkip(AktSong.VideoGAP + AktSong.Start); diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 2d10c9dc..7b16c315 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -1078,7 +1078,8 @@ begin end; end; -{procedure TScreenSong.SetScroll4; // rotate +(* +procedure TScreenSong.SetScroll4; // rotate var B: integer; Wsp: real; @@ -1158,7 +1159,7 @@ begin else Button[B].Visible := False; end; end; -end; } +end; *) procedure TScreenSong.SetScroll5; // rotate var @@ -2003,4 +2004,4 @@ FixSelected; } end; -end. \ No newline at end of file +end. diff --git a/Game/Code/Screens/UScreenTop5.pas b/Game/Code/Screens/UScreenTop5.pas index f9de4114..4971d12a 100644 --- a/Game/Code/Screens/UScreenTop5.pas +++ b/Game/Code/Screens/UScreenTop5.pas @@ -2,6 +2,11 @@ unit UScreenTop5; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + uses UMenu, SDL, SysUtils, UDisplay, UMusic, USongs, UThemes, ULCD; @@ -131,7 +136,7 @@ function TScreenTop5.Draw: boolean; C: integer;} begin // Singstar - let it be...... with 6 statics -{ if PlayersPlay = 6 then begin +(* if PlayersPlay = 6 then begin for Item := 4 to 6 do begin if ScreenAct = 1 then P := Item-4; if ScreenAct = 2 then P := Item-1; @@ -152,10 +157,10 @@ begin Static[StaticBoxLightest[Item]].Texture.ColG, Static[StaticBoxLightest[Item]].Texture.ColB, 'P4Dark'); - end;} + end; } -{ end; - end;} + end; + end; *) inherited Draw; end; diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr index df4846b3..474bf173 100644 --- a/Game/Code/UltraStar.dpr +++ b/Game/Code/UltraStar.dpr @@ -60,6 +60,7 @@ uses //------------------------------ //Includes - Classes //------------------------------ + UCommon in 'Classes\UCommon.pas', UGraphic in 'Classes\UGraphic.pas', UTexture in 'Classes\UTexture.pas', UMusic in 'Classes\UMusic.pas', diff --git a/Game/Code/UltraStar.lpi b/Game/Code/UltraStar.lpi index 43d4cd5c..519db01f 100644 --- a/Game/Code/UltraStar.lpi +++ b/Game/Code/UltraStar.lpi @@ -12,7 +12,7 @@ - + @@ -31,14 +31,22 @@ - + + + + + + + + + - - + + - + @@ -46,22 +54,25 @@ - + - - - + + + + + + - - + + @@ -69,183 +80,206 @@ - - + + - + - + + + - - + + + + - + - + - + + + - - + + - - - + + + + + - + + + - - + + + + - + - + - + + + - + - + - - - - - + + - - - + + + + + - + - + - + + + - - - + + + + + - + - + + + - - - + + + + + - + - + - + + + - - - - + + + + @@ -253,17 +287,17 @@ - - + + - - - - + + + + @@ -271,23 +305,25 @@ - - + + - + + + - - + + @@ -295,8 +331,8 @@ - - + + @@ -304,8 +340,8 @@ - - + + @@ -313,8 +349,8 @@ - - + + @@ -322,8 +358,8 @@ - - + + @@ -331,8 +367,8 @@ - - + + @@ -340,8 +376,8 @@ - - + + @@ -349,151 +385,80 @@ - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/Game/Code/UltraStar.lpr b/Game/Code/UltraStar.lpr index aebf549c..2e2a98a2 100644 --- a/Game/Code/UltraStar.lpr +++ b/Game/Code/UltraStar.lpr @@ -61,14 +61,16 @@ uses //------------------------------ //Includes - Classes //------------------------------ + + UCommon in 'Classes\UCommon.pas', UTime in 'Classes\UTime.pas', UCommandLine in 'Classes\UCommandLine.pas', ULog in 'Classes\ULog.pas', UMain in 'Classes\UMain.pas', - UIni in 'Classes\UIni.pas', - UTexture in 'Classes\UTexture.pas', + UIni in 'Classes\UIni.pas', + UTexture in 'Classes\UTexture.pas', UGraphic in 'Classes\UGraphic.pas', UMusic in 'Classes\UMusic.pas', diff --git a/Game/Code/lib/midi/MidiFile.pas b/Game/Code/lib/midi/MidiFile.pas index 5c15481e..10b64a80 100644 --- a/Game/Code/lib/midi/MidiFile.pas +++ b/Game/Code/lib/midi/MidiFile.pas @@ -91,8 +91,17 @@ unit MidiFile; interface uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - stdctrls, ExtCtrls, WinProcs; + Windows, + Messages, + SysUtils, + Classes, + Graphics, + Controls, + Forms, + stdctrls, + ExtCtrls, + WinProcs; + type TChunkType = (illegal, header, track); TFileFormat = (single, multi_synch, multi_asynch); diff --git a/Game/Code/lib/midi/Midiin.pas b/Game/Code/lib/midi/Midiin.pas index 2f2e76c0..32a17c51 100644 --- a/Game/Code/lib/midi/Midiin.pas +++ b/Game/Code/lib/midi/Midiin.pas @@ -212,7 +212,9 @@ procedure Register; {====================================================================} implementation -uses Graphics, Controls, Forms, Dialogs; +uses Controls, + Forms, + Graphics; (* Not used in Delphi 3 { This is the callback procedure in the external DLL. -- cgit v1.2.3