aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-07 21:09:02 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-07 21:09:02 +0000
commit247cbdca4eb8af228fa1753f1185e85077b5befa (patch)
tree22b670adb1ab675521904be290a60d9cc166dda8 /Game/Code/Classes
parentaddda3536d0d82714e826994b3a10c6b468c3252 (diff)
downloadusdx-247cbdca4eb8af228fa1753f1185e85077b5befa.tar.gz
usdx-247cbdca4eb8af228fa1753f1185e85077b5befa.tar.xz
usdx-247cbdca4eb8af228fa1753f1185e85077b5befa.zip
UScreenSing.pas, UScreenSingModi.pas: removed Uffmpeg and USmpeg, added UVideo
UGraphic.pas: prepared for possible loading animation UGraphicClasses.pas, ULCD.pas, ULight.pas, UMain.pas, USkins.pas, UDisplay.pas, UMenuButton.pas, UMenuSelect.pas, UMenuSelectSlide.pas, UMenuStatic.pas, UScreenCredits.pas, UScreenEditSub.pas, UScreenOpen.pas, UScreenPopup.pas: some fixes to get rid of some compiler infos/warnings git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@374 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UGraphic.pas60
-rw-r--r--Game/Code/Classes/UGraphicClasses.pas2
-rw-r--r--Game/Code/Classes/ULCD.pas10
-rw-r--r--Game/Code/Classes/ULight.pas4
-rw-r--r--Game/Code/Classes/UMain.pas1
-rw-r--r--Game/Code/Classes/USkins.pas6
-rw-r--r--Game/Code/Classes/UVideo.pas (renamed from Game/Code/SMpeg/Uffmpeg.pas)2
7 files changed, 72 insertions, 13 deletions
diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas
index cf1a0c5a..068ed715 100644
--- a/Game/Code/Classes/UGraphic.pas
+++ b/Game/Code/Classes/UGraphic.pas
@@ -23,6 +23,9 @@ type
var
Screen: PSDL_Surface;
+ LoadingThread: PSDL_Thread;
+ Mutex: PSDL_Mutex;
+
RenderW: integer;
RenderH: integer;
ScreenW: integer;
@@ -174,8 +177,11 @@ procedure SwapBuffers;
procedure LoadTextures;
procedure InitializeScreen;
+procedure LoadLoadingScreen;
procedure LoadScreens;
+function LoadingThreadFunction: integer;
+
implementation
uses UMain, UIni, UDisplay, UCommandLine, Graphics, Classes, Windows;
@@ -240,6 +246,7 @@ var
Res: TResourceStream;
ISurface: PSDL_Surface;
Pixel: PByteArray;
+ I: Integer;
begin
Log.LogStatus('LoadOpenGL', 'Initialize3D');
Log.BenchmarkStart(2);
@@ -302,7 +309,42 @@ begin
Log.LogStatus('Loading Screens', 'Initialize3D');
Log.BenchmarkStart(3);
+ LoadLoadingScreen;
+ // now that we have something to display while loading,
+ // start thread that loads the rest of ultrastar
+// Mutex := SDL_CreateMutex;
+// SDL_UnLockMutex(Mutex);
+
+ // funktioniert so noch nicht, da der ladethread unverändert auf opengl zugreifen will
+ // siehe dazu kommentar unten
+ //LoadingThread := SDL_CreateThread(@LoadingThread, nil);
+
+ // das hier würde dann im ladethread ausgeführt
LoadScreens;
+
+
+ // TODO!!!!!!1
+ // hier käme jetzt eine schleife, die
+ // * den ladescreen malt (ab und zu)
+ // * den "fortschritt" des ladescreens steuert
+ // * zwischendrin schaut, ob der ladethread texturen geladen hat (mutex prüfen) und
+ // * die texturen in die opengl lädt, sowie
+ // * dem ladethread signalisiert, dass der speicher für die textur
+ // zum laden der nächsten textur weiterverwendet werden kann (über weiteren mutex)
+ // * über einen 3. mutex so lange läuft, bis der ladethread signalisiert,
+ // dass er alles geladen hat fertig ist
+ //
+ // dafür muss loadtexture so umgeschrieben werden, dass es, statt selbst irgendwelche
+ // opengl funktionen aufzurufen, entsprechend mutexe verändert
+ // der hauptthread muss auch irgendwoher erfahren, was an opengl funktionen auszuführen ist,
+ // mit welchen parametern (texturtyp, entspr. texturobjekt, textur-zwischenspeicher-adresse, ...
+
+
+ //wait for loading thread to finish
+ // funktioniert so auch noch nicht
+ //SDL_WaitThread(LoadingThread, I);
+// SDL_DestroyMutex(Mutex);
+
Display.ActualScreen^.FadeTo(@ScreenMain);
Log.BenchmarkEnd(2);
@@ -397,7 +439,7 @@ begin
ScreenH := H;
end;
-procedure LoadScreens;
+procedure LoadLoadingScreen;
begin
ScreenLoading := TScreenLoading.Create;
ScreenLoading.onShow;
@@ -405,7 +447,17 @@ begin
ScreenLoading.Draw;
Display.Draw;
SwapBuffers;
+end;
+procedure LoadScreens;
+begin
+{ ScreenLoading := TScreenLoading.Create;
+ ScreenLoading.onShow;
+ Display.ActualScreen := @ScreenLoading;
+ ScreenLoading.Draw;
+ Display.Draw;
+ SwapBuffers;
+}
Log.BenchmarkEnd(3); Log.LogBenchmark('====> Screen Loading', 3); Log.BenchmarkStart(3);
{ ScreenWelcome := TScreenWelcome.Create; //'BG', 4, 3);
Log.BenchmarkEnd(3); Log.LogBenchmark('====> Screen Welcome', 3); Log.BenchmarkStart(3);}
@@ -480,4 +532,10 @@ begin
end;
+function LoadingThreadFunction: integer;
+begin
+ LoadScreens;
+ Result:= 1;
+end;
+
end.
diff --git a/Game/Code/Classes/UGraphicClasses.pas b/Game/Code/Classes/UGraphicClasses.pas
index 032830b9..83d192d6 100644
--- a/Game/Code/Classes/UGraphicClasses.pas
+++ b/Game/Code/Classes/UGraphicClasses.pas
@@ -29,7 +29,7 @@ type
SurviveSentenceChange : Boolean;
Constructor Create(cX,cY: Real; cScreen: Integer; cLive: Byte; cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; Player: Cardinal);
- Destructor Destroy();
+ Destructor Destroy(); override;
procedure Draw;
procedure LiveOn;
end;
diff --git a/Game/Code/Classes/ULCD.pas b/Game/Code/Classes/ULCD.pas
index a127c689..a3cdac73 100644
--- a/Game/Code/Classes/ULCD.pas
+++ b/Game/Code/Classes/ULCD.pas
@@ -106,9 +106,9 @@ begin
end;
procedure TLCD.Enable;
-var
+{var
A: byte;
- B: byte;
+ B: byte;}
begin
Enabled := true;
if not HalfInterface then
@@ -191,7 +191,7 @@ end;
procedure TLCD.AddTextBR(S: string);
var
Word: string;
- W: integer;
+// W: integer;
P: integer;
L: integer;
begin
@@ -227,9 +227,9 @@ begin
end;
procedure TLCD.MoveCursorBR(Pos: integer);
-var
+{var
I: integer;
- L: integer;
+ L: integer;}
begin
if Enabled then begin
Pos := Pos - (StartPos-1);
diff --git a/Game/Code/Classes/ULight.pas b/Game/Code/Classes/ULight.pas
index 967d2ea1..1fc4aba8 100644
--- a/Game/Code/Classes/ULight.pas
+++ b/Game/Code/Classes/ULight.pas
@@ -89,12 +89,12 @@ end;
procedure TLight.Refresh;
var
Time: real;
- TimeSkip: real;
+// TimeSkip: real;
L: integer;
begin
if Enabled then begin
Time := GetTime;
- TimeSkip := Time - LastTime;
+// TimeSkip := Time - LastTime;
for L := 0 to 7 do begin
if Light[L] = true then begin
if LightTime[L] > Time then begin
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index b47047a5..3a1c9dd4 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -545,6 +545,7 @@ begin
// check if we can add new note
Mozna := false;
+ SDet:=SMin;
for S := SMin to SMax do
for Pet := 0 to Czesci[0].Czesc[S].HighNut do
if ((Czesci[0].Czesc[S].Nuta[Pet].Start <= Czas.AktBeatD)
diff --git a/Game/Code/Classes/USkins.pas b/Game/Code/Classes/USkins.pas
index 67b0ae93..3bcd9357 100644
--- a/Game/Code/Classes/USkins.pas
+++ b/Game/Code/Classes/USkins.pas
@@ -48,8 +48,8 @@ end;
procedure TSkin.LoadList;
var
SR: TSearchRec;
- SR2: TSearchRec;
- SLen: integer;
+// SR2: TSearchRec;
+// SLen: integer;
begin
if FindFirst('Skins\*', faDirectory, SR) = 0 then begin
repeat
@@ -63,7 +63,7 @@ end;
procedure TSkin.ParseDir(Dir: string);
var
SR: TSearchRec;
- SLen: integer;
+// SLen: integer;
begin
if FindFirst(Dir + '*.ini', faAnyFile, SR) = 0 then begin
repeat
diff --git a/Game/Code/SMpeg/Uffmpeg.pas b/Game/Code/Classes/UVideo.pas
index 6e08ca95..8e2fc446 100644
--- a/Game/Code/SMpeg/Uffmpeg.pas
+++ b/Game/Code/Classes/UVideo.pas
@@ -10,7 +10,7 @@
{$define Info}
-unit Uffmpeg;
+unit UVideo;
interface
uses SDL, UGraphicClasses, textgl, avcodec, avformat, avutil, math, OpenGL12, SysUtils, UIni, dialogs;