aboutsummaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--Game/Code/Menu/UDisplay.pas2
-rw-r--r--Game/Code/Menu/UMenuButton.pas9
-rw-r--r--Game/Code/Menu/UMenuSelect.pas4
-rw-r--r--Game/Code/Menu/UMenuSelectSlide.pas6
-rw-r--r--Game/Code/Menu/UMenuStatic.pas2
-rw-r--r--Game/Code/SMpeg/USmpeg.pas301
-rw-r--r--Game/Code/Screens/UScreenCredits.pas26
-rw-r--r--Game/Code/Screens/UScreenEditSub.pas2
-rw-r--r--Game/Code/Screens/UScreenOpen.pas2
-rw-r--r--Game/Code/Screens/UScreenPopup.pas10
-rw-r--r--Game/Code/Screens/UScreenSing.pas4
-rw-r--r--Game/Code/Screens/UScreenSingModi.pas7
-rw-r--r--Game/Code/UltraStar.dpr5
20 files changed, 106 insertions, 359 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;
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 70e678fb..82b4acc7 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -40,7 +40,7 @@ type
procedure PrintScreen;
constructor Create;
// fade mod
- destructor Destroy;
+ destructor Destroy; override;
// end
procedure ScreenShot;
diff --git a/Game/Code/Menu/UMenuButton.pas b/Game/Code/Menu/UMenuButton.pas
index cb343cf8..f3b00830 100644
--- a/Game/Code/Menu/UMenuButton.pas
+++ b/Game/Code/Menu/UMenuButton.pas
@@ -87,9 +87,9 @@ implementation
uses UDrawTexture, SysUtils, windows;
procedure TButton.SetX(Value: real);
-var
+{var
dx: real;
- T: integer; // text
+ T: integer; // text}
begin
{dY := Value - Texture.y;
@@ -105,9 +105,9 @@ begin
end;
procedure TButton.SetY(Value: real);
-var
+{var
dY: real;
- T: integer; // text
+ T: integer; // text}
begin
{dY := Value - PosY;
@@ -276,6 +276,7 @@ var
begin
if Visible then begin
//Fade Mod
+ T:=0;
if Fade then
begin
if (FadeProgress < 1) and (FadeProgress > 0) then
diff --git a/Game/Code/Menu/UMenuSelect.pas b/Game/Code/Menu/UMenuSelect.pas
index f7bb871f..72141a27 100644
--- a/Game/Code/Menu/UMenuSelect.pas
+++ b/Game/Code/Menu/UMenuSelect.pas
@@ -99,8 +99,8 @@ begin
end;
procedure TSelect.SetSelect(Value: boolean);
-var
- SO: integer;
+{var
+ SO: integer;}
begin // default 1, 0.4
SelectBool := Value;
if Value then begin
diff --git a/Game/Code/Menu/UMenuSelectSlide.pas b/Game/Code/Menu/UMenuSelectSlide.pas
index c1ccad6d..3659c00d 100644
--- a/Game/Code/Menu/UMenuSelectSlide.pas
+++ b/Game/Code/Menu/UMenuSelectSlide.pas
@@ -117,9 +117,9 @@ begin
end;
procedure TSelectSlide.SetSelect(Value: boolean);
-var
+{var
SO: integer;
- I: integer;
+ I: integer;}
begin
SelectBool := Value;
if Value then begin
@@ -187,7 +187,7 @@ procedure DoSelection(Sel: Cardinal);
TextOpt[I].ColB := STDColB;
TextOpt[I].Int := STDInt;
end;
- if (Sel <= high(TextOpt)) then
+ if (integer(Sel) <= high(TextOpt)) then
begin
TextOpt[Sel].ColR := STColR;
TextOpt[Sel].ColG := STColG;
diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas
index 5f19fbf3..cfa4a596 100644
--- a/Game/Code/Menu/UMenuStatic.pas
+++ b/Game/Code/Menu/UMenuStatic.pas
@@ -21,8 +21,6 @@ implementation
uses UDrawTexture;
procedure TStatic.Draw;
-var
- Pet: integer;
begin
if Visible then
begin
diff --git a/Game/Code/SMpeg/USmpeg.pas b/Game/Code/SMpeg/USmpeg.pas
deleted file mode 100644
index 317b04bb..00000000
--- a/Game/Code/SMpeg/USmpeg.pas
+++ /dev/null
@@ -1,301 +0,0 @@
-unit USmpeg;
-
-interface
-uses SDL, smpeg, OpenGL12, SysUtils, UIni;
-
-procedure OpenSmpeg(FileName: string);
-procedure SkipSmpeg(Time: single);
-procedure PlaySmpeg;
-procedure PauseSmpeg; //PauseMod
-procedure UpdateSmpeg;
-procedure CloseSmpeg;
-function glmovie_init(Width : GLuint; Height : TGLuint ) : TGLenum;
-procedure glmpeg_update(surface: PSDL_Surface; x: Sint32; y: Sint32; w: Uint32; h: Uint32); cdecl;
-procedure DrawSmpeg(frame: PGLubyte);
-procedure glmovie_resize( width : GLuint; height : GLuint );
-procedure glmovie_quit;
-
-var
- mpeg: PSMPEG;
- mpeg_info: TSMPEG_Info;
- surface: PSDL_Surface;
-
-type
- { Some data is redundant at this stage. }
- PGLMovieTexture = ^TGLMovieTexture;
- TGLMovieTexture = record
- id : TGLuint; (* OpenGL texture id. *)
- poly_width : TGLuint; (* Quad width for tile. *)
- poly_height : TGLuint; (* Quad height for tile. *)
- movie_width : TGLuint; (* Width of movie inside tile. *)
- movie_height : TGLuint; (* Height of movie inside tile. *)
- skip_rows : TGLuint; (* Number of rows of movie to skip *)
- skip_pixels : TGLuint; (* Number of columns of movie to skip *)
- row : TGLuint; (* Row number of tile in scheme. *)
- col : TGLuint; (* Column number of tile in scheme. *)
- end;
-
-type
- TGLuintArray = array of TGLuint;
- PGLuintArray = ^TGLuintArray;
- TGLMovieTextureArray = array of TGLMovieTexture;
- PGLMovieTextureArray = ^TGLMovieTextureArray;
-
-var
- (* Our evil maximum texture size. Boo 3Dfxnot *)
- texture_size : TGLuint = 1024;//512;
- texture_ids : TGLuint;
- textures: TGLMovieTexture;
- tiled_width : TGLuint = 0;
- tiled_height : TGLuint = 0;
- movie_width : TGLuint = 0;
- movie_height : TGLuint = 0;
-
-implementation
-
-procedure OpenSmpeg(FileName: string);
-begin
- mpeg := SMPEG_new(PChar(FileName), @mpeg_info, 0); // audio
- if ( mpeg = nil ) then begin
- SDL_Quit;
- Exit;
- end;
-
-// SMPEG_setvolume(mpeg, 50);
- SMPEG_enableaudio(mpeg, 0);
-
- (* Everything needs to be in RGB for GL, but needs to be 32-bit for SMPEG. *)
- surface := SDL_AllocSurface( SDL_SWSURFACE,
- mpeg_info.width,
- mpeg_info.height,
- 32,
- $000000FF,
- $0000FF00,
- $00FF0000,
- $FF000000 );
-
- if ( surface = nil ) then begin
- SDL_Quit;
- Exit;
- end;
-
- (* *Initialize* with mpeg size. *)
- if (glmovie_init( mpeg_info.width, mpeg_info.height ) <> GL_NO_ERROR ) then begin
- SDL_Quit;
- Exit;
- end;
-
- SMPEG_setdisplay(mpeg, surface, nil, @glmpeg_update);
-end;
-
-procedure SkipSmpeg(Time: single);
-begin
- SMPEG_skip(mpeg, Time);
-end;
-
-procedure PlaySmpeg;
-begin
- SMPEG_play(mpeg);
-end;
-
-//Pause Mod
-procedure PauseSmpeg;
-begin
- SMPEG_pause(mpeg);
-end;
-
-procedure UpdateSmpeg;
-begin
-// glmpeg_update(surface,0,0,0,0);
- DrawSmpeg( PGLubyte( surface.pixels ) );
-end;
-
-procedure CloseSmpeg;
-begin
- SMPEG_delete(mpeg);
- //Fixing the Memory Lag in earlyer Versions (X-Mas Mod, all Official Versions)
- glmovie_quit;
-end;
-
-function glmovie_init( Width : GLuint; Height : TGLuint ) : TGLenum;
-type
- PGLubyteArray = ^TGLubyteArray;
- TGLubyteArray = array of TGLubyte;
-var
- (* Initial black texels. *)
- pixels : TGLubyteArray;
- (* Absolute offsets from within tiled frame. *)
- //offset_x: GLuint;
- //offset_y: GLuint;
- skip_rows : GLuint;
- skip_pixels : GLuint;
- i, j, current : GLuint;
-begin
- skip_rows := 0;
- current := 0;
- (* Save original movie dimensions. *)
- movie_width := width;
- movie_height := height;
-
- (* Get the power of 2 dimensions. *)
- tiled_width := 1024{512};
- tiled_height := 1024{512};
-
- texture_size := 1024{512};
-
- (* Time for fun with data type = record *)
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glEnable(GL_TEXTURE_2D);
- glEnable(GL_DITHER);
-
- glGenTextures(1, @texture_ids);
-
- current := 0;
- (* Setup texture. *)
- textures.id := texture_ids;
- textures.poly_width := texture_size;
- textures.poly_height := texture_size;
- textures.movie_width := movie_width - 2;
- textures.movie_height := movie_height - 2;
- textures.row := i;
- textures.col := j;
- textures.skip_pixels := skip_pixels;
- textures.skip_rows := skip_rows;
-
- SetLength( pixels, textures.poly_width * textures.poly_height * 4 );
- if ( pixels = nil ) then
- begin
- glDeleteTextures(1, @texture_ids);
- result := GL_OUT_OF_MEMORY;
- exit;
- end;
- //FillChar( pixels^, textures[ current ].poly_width * textures[ current ].poly_height * 4, 0 );
-
- (* Do all of our useful binding. *)
- glBindTexture(GL_TEXTURE_2D, texture_ids);
-// glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
- (* Specify our 256x256 black texture. *)
- glTexImage2D( GL_TEXTURE_2D,
- 0,
- GL_RGB,
- 1024{512},//textures.poly_width,
- 1024{512},//textures.poly_height,
- 0,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- @pixels[0] );
- SetLength( pixels, 0 );
-
-
- (* Simple state setup at the end. *)
- result := glGetError( );
-end;
-
-procedure glmpeg_update( surface : PSDL_Surface; x : Sint32; y : Sint32; w : Uint32;
- h : Uint32 ); cdecl;
-var
- error : TGLenum;
-begin
- glClear( GL_COLOR_BUFFER_BIT );
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity;
- DrawSmpeg( PGLubyte( surface.pixels ) );
- error := glGetError( );
- if ( error <> GL_NO_ERROR ) then Exit;
- SDL_GL_SwapBuffers;
-end;
-
-procedure DrawSmpeg(frame: PGLubyte);
-var
- Shift: TGLdouble;
- CropT: real;
- CropB: real;
- TexT: real;
- TexB: real;
- TexL: real;
- TexR: real;
- Wide: boolean;
-begin
- (* full screen mpeg *)
-{ CropT := 0;
- CropB := 600;
- TexT := 0;
- TexB := 1;
- TexL := 0;
- TexW := 1;}
-
- // set movie texture crop
- Wide := false;
- if (textures.movie_width = 720-2) and (textures.movie_height = 344-2) then begin
- TexT := 0;
- TexB := 342/1024;
- Wide := true;
- end;
- if textures.movie_height = 304-2 then begin
- TexT := 0;
- TexB := 304/1024;
- Wide := true;
- end;
- if textures.movie_height = 152-2 then begin
- TexT := 0;
- TexB := 152/1024;
- Wide := true;
- end;
-
- CropT := 110; // (110/800 = 13,75% max crop)
- CropB := 490; // (110/800 = 13,75% max crop)
-
- if (textures.movie_height <> 304-2) and (textures.movie_height <> 152-2) and (textures.movie_height <> 344-2) then begin
- TexT := 110 / 600 * (textures.movie_height / 1024{512});
- TexB := 490 / 600 * (textures.movie_height / 1024{512});
-
- if Ini.MovieSize >= 1 then begin
- // full screen size
- CropT := 0;
- CropB := 600;
- TexT := 0;
- TexB := textures.movie_height / 1024{512};
- end;
- end;
-
- TexL := {10}0/600 * (textures.movie_width / 1024{512});
- TexR := {590}600/600 * (textures.movie_width / 1024{512});
-
- glEnable(GL_TEXTURE_2D);
- glDisable(GL_BLEND);
- glColor3f(1, 1, 1);
- glBindTexture( GL_TEXTURE_2D, texture_ids );
-// glPixelStorei( GL_UNPACK_ROW_LENGTH, movie_width );
- glPixelStorei( GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0);
- glTexSubImage2D( GL_TEXTURE_2D, 0, 0, (* offset_x *) 0, (* offset_y *) textures.movie_width + 2, textures.movie_height + 2, GL_RGBA, GL_UNSIGNED_BYTE, frame );
-
- // draw
- glBegin( GL_QUADS );
- glTexCoord2f(TexL, TexT); glVertex2f(0, CropT);
- glTexCoord2f(TexL, TexB); glVertex2f(0, CropB);
- glTexCoord2f(TexR, TexB); glVertex2f(800, CropB);
- glTexCoord2f(TexR, TexT); glVertex2f(800, CropT);
- glEnd;
- glDisable(GL_TEXTURE_2D);
-end;
-
-procedure glmovie_resize( width : GLuint; height : GLuint );
-begin
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- gluOrtho2D(0, 800, 600, 0);
-end;
-
-procedure glmovie_quit;
-begin
- glDeleteTextures(1, @texture_ids);
- SDL_FreeSurface(surface);
-end;
-
-end.
diff --git a/Game/Code/Screens/UScreenCredits.pas b/Game/Code/Screens/UScreenCredits.pas
index deaa042e..067414bd 100644
--- a/Game/Code/Screens/UScreenCredits.pas
+++ b/Game/Code/Screens/UScreenCredits.pas
@@ -165,6 +165,7 @@ end;
function TScreenCredits.Draw: boolean;
begin
DrawCredits;
+ Draw:=true;
end;
procedure TScreenCredits.onShow;
@@ -187,7 +188,7 @@ end;
Procedure TScreenCredits.Draw_FunkyText;
var
- S,I, Len: Integer;
+ S: Integer;
X,Y,A: Real;
visibleText: PChar;
begin
@@ -208,6 +209,7 @@ begin
for S := 0 to length(visibleText)-1 do begin
Y:=abs(sin((Credits_X+X)*0.93{*(((Credits_X+X))/1200)}/100*pi));
SetFontPos(Credits_X+X,538-Y*(Credits_X+X)*(Credits_X+X)*(Credits_X+X)/1000000);
+ A:=0;
if (Credits_X+X < 15) then A:=0;
if (Credits_X+X >=15) then A:=Credits_X+X-15;
if Credits_X+X > 32 then A:=17;
@@ -488,7 +490,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -511,7 +512,7 @@ Data := Music.GetFFTData;
gltranslatef(223,0,0);
if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
gltranslatef(223,0,0);
- glrotatef((CTime-(STime+Delay-10))*-9,0,0,1);
+ glrotatef((integer(CTime)-(integer(STime+Delay)-10))*-9,0,0,1);
gltranslatef(-223,0,0);
end;
glBindTexture(GL_TEXTURE_2D, credits_blindguard.TexNum);
@@ -541,7 +542,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -599,7 +599,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -652,7 +651,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -675,12 +673,11 @@ Data := Music.GetFFTData;
f:=258.0-25.8*(CTime-STime)
else
f:=0;
-
+ g:=0;
if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
j:=CTime-(STime+Delay-10);
g:=32.6*j;
- end else
- g:=0;
+ end;
glBindTexture(GL_TEXTURE_2D, credits_commandio.TexNum);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
@@ -742,7 +739,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -766,11 +762,11 @@ Data := Music.GetFFTData;
else
f:=0;
+ g:=0;
if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
j:=CTime-(STime+Delay-10);
g:=32.6*j;
- end else
- g:=0;
+ end;
glBindTexture(GL_TEXTURE_2D, credits_mog.TexNum);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
@@ -798,7 +794,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -856,7 +851,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -882,9 +876,8 @@ Data := Music.GetFFTData;
end;
if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
j:=CTime-(STime+Delay-10);
- f:=j*10.0;
gltranslatef(0,-223,0);
- glrotatef(j*-9,0,0,1);
+ glrotatef(integer(j)*-9,0,0,1);
gltranslatef(0,223,0);
glrotatef(j*9,0,0,1);
end;
@@ -915,7 +908,6 @@ Data := Music.GetFFTData;
if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas
index 948ff2cc..6eef8509 100644
--- a/Game/Code/Screens/UScreenEditSub.pas
+++ b/Game/Code/Screens/UScreenEditSub.pas
@@ -2,7 +2,7 @@ unit UScreenEditSub;
interface
-uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, UMenuText,
+uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, UMenuText,
ULyrics, Math, OpenGL12, UThemes, MidiOut;
type
diff --git a/Game/Code/Screens/UScreenOpen.pas b/Game/Code/Screens/UScreenOpen.pas
index 68667d87..c27ee762 100644
--- a/Game/Code/Screens/UScreenOpen.pas
+++ b/Game/Code/Screens/UScreenOpen.pas
@@ -2,7 +2,7 @@ unit UScreenOpen;
interface
-uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, UMenuText,
+uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, UMenuText,
ULyrics, Math, OpenGL12, UThemes;
type
diff --git a/Game/Code/Screens/UScreenPopup.pas b/Game/Code/Screens/UScreenPopup.pas
index f583eb90..cc1b4492 100644
--- a/Game/Code/Screens/UScreenPopup.pas
+++ b/Game/Code/Screens/UScreenPopup.pas
@@ -19,8 +19,8 @@ type
type
TScreenPopupError = class(TMenu)
- private
- CurMenu: Byte; //Num of the cur. Shown Menu
+{ private
+ CurMenu: Byte; //Num of the cur. Shown Menu}
public
Visible: Boolean; //Whether the Menu should be Drawn
@@ -124,7 +124,7 @@ end;
function TScreenPopupCheck.Draw: boolean;
begin
- inherited Draw;
+ Draw:=inherited Draw;
end;
procedure TScreenPopupCheck.onShow;
@@ -207,7 +207,7 @@ end;
function TScreenPopupError.Draw: boolean;
begin
- inherited Draw;
+ Draw:=inherited Draw;
end;
procedure TScreenPopupError.onShow;
@@ -216,12 +216,10 @@ begin
end;
procedure TScreenPopupError.onHide;
-var i: integer;
begin
end;
procedure TScreenPopupError.ShowPopup(msg: String);
-var i: integer;
begin
Interaction := 0; //Reset Interaction
Visible := True; //Set Visible
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index 8291a430..7a585cef 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -3,7 +3,7 @@ unit UScreenSing;
interface
uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics,
- TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, Uffmpeg;
+ TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo;
type
TScreenSing = class(TMenu)
@@ -224,7 +224,7 @@ begin
LyricMain := TLyric.Create;
LyricSub := TLyric.Create;
- Uffmpeg.Init;
+ UVideo.Init;
end;
procedure TScreenSing.onShow;
diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas
index e046e193..0305315f 100644
--- a/Game/Code/Screens/UScreenSingModi.pas
+++ b/Game/Code/Screens/UScreenSingModi.pas
@@ -2,7 +2,7 @@ unit UScreenSingModi;
interface
-uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics,
+uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics,
TextGL, OpenGL12, BASS, UThemes, ULCD, UScreenSing, ModiSDK;
type
@@ -943,10 +943,11 @@ end;
if (DllMan.Selected.LoadSong) AND (DllMan.Selected.LoadBack) then
SingDrawBackground;
+ // comment by blindy: wo zum henker wird denn in diesem screen ein video abgespielt?
// update and draw movie
- if ShowFinish and AktSong.VideoLoaded AND DllMan.Selected.LoadVideo then begin
+{ if ShowFinish and AktSong.VideoLoaded AND DllMan.Selected.LoadVideo then begin
UpdateSmpeg; // this only draws
- end;
+ end;}
// draw static menu (FG)
DrawFG;
diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr
index 30c03e7e..d39df45b 100644
--- a/Game/Code/UltraStar.dpr
+++ b/Game/Code/UltraStar.dpr
@@ -84,9 +84,8 @@ uses
//------------------------------
//Includes - Video Support
//------------------------------
- Uffmpeg in 'SMpeg\Uffmpeg.pas',
- USmpeg in 'SMpeg\USmpeg.pas',
-
+ UVideo in 'Classes\UVideo.pas',
+
//------------------------------
//Includes - Screens
//------------------------------