aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-01 17:42:46 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-01 17:42:46 +0000
commitaf7100ef908a4ee1474a607ed255c707959222f1 (patch)
tree68d4666132ffed57651e1334b94b0f90a548f507 /Game/Code
parent840abe2817971ba4d69f0e36c26bde4f32a42998 (diff)
downloadusdx-af7100ef908a4ee1474a607ed255c707959222f1.tar.gz
usdx-af7100ef908a4ee1474a607ed255c707959222f1.tar.xz
usdx-af7100ef908a4ee1474a607ed255c707959222f1.zip
ffmpeg support now with dualscreen mode
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@359 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/SMpeg/Uffmpeg.pas19
-rw-r--r--Game/Code/Screens/UScreenSing.pas4
2 files changed, 13 insertions, 10 deletions
diff --git a/Game/Code/SMpeg/Uffmpeg.pas b/Game/Code/SMpeg/Uffmpeg.pas
index f10f40d3..25e3f5aa 100644
--- a/Game/Code/SMpeg/Uffmpeg.pas
+++ b/Game/Code/SMpeg/Uffmpeg.pas
@@ -5,7 +5,8 @@
# based on 'An ffmpeg and SDL Tutorial' (http://www.dranger.com/ffmpeg/) #
#############################################################################}
-//{$define DebugDisplay}
+//{$define DebugDisplay} // uncomment if u want to see the debug stuff
+//{$define DebugFrames}
unit Uffmpeg;
@@ -17,7 +18,7 @@ procedure Init;
procedure FFmpegOpenFile(FileName: pAnsiChar);
procedure FFmpegClose;
procedure FFmpegGetFrame(Time: Extended);
-procedure FFmpegDrawGL;
+procedure FFmpegDrawGL(Screen: integer);
procedure FFmpegTogglePause;
procedure FFmpegSkip(Time: Single);
@@ -197,7 +198,7 @@ begin
'TimeDiff: '+inttostr(floor(TimeDifference*1000)));
}
if (VideoTime <> 0) and (TimeDifference <= VideoTimeBase) then begin
-{$ifdef DebugDisplay}
+{$ifdef DebugFrames}
// frame delay debug display
GoldenRec.Spawn(200,15,1,16,0,-1,ColoredStar,$00ff00);
{$endif}
@@ -212,7 +213,7 @@ begin
VideoTime:=VideoTime+VideoTimeBase;
TimeDifference:=myTime-VideoTime;
if TimeDifference >= 3*VideoTimeBase then begin // skip frames
-{$ifdef DebugDisplay}
+{$ifdef DebugFrames}
//frame drop debug display
GoldenRec.Spawn(200,55,1,16,0,-1,ColoredStar,$ff0000);
{$endif}
@@ -257,7 +258,7 @@ begin
glTexImage2D(GL_TEXTURE_2D, 0, 3, dataX, dataY, 0, GL_RGB, GL_UNSIGNED_BYTE, TexData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-{$ifdef DebugDisplay}
+{$ifdef DebugFrames}
//frame decode debug display
GoldenRec.Spawn(200,35,1,16,0,-1,ColoredStar,$ffff00);
{$endif}
@@ -265,11 +266,13 @@ begin
end;
end;
-procedure FFmpegDrawGL;
+procedure FFmpegDrawGL(Screen: integer);
begin
if not VideoOpened then Exit;
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
+ if Screen=1 then begin
+ glClearColor(0,0,0,0);
+ glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
+ end;
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glColor4f(1, 1, 1, 1);
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index 4bf405f6..6ce19c17 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -744,7 +744,7 @@ begin
begin
try
FFmpegGetFrame(Czas.Teraz);
- FFmpegDrawGL;
+ FFmpegDrawGL(ScreenAct);
// PlaySmpeg;
except
//If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video
@@ -1072,7 +1072,7 @@ begin
// todo: find a way to determine, when a new frame is needed
// toto: same for the need to skip frames
FFmpegGetFrame(Czas.Teraz);
- FFmpegDrawGL;
+ FFmpegDrawGL(ScreenAct);
except
//If an Error occurs drawing: prevent Video from being Drawn again and Close Video
AktSong.VideoLoaded := False;