aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-08-22 08:27:02 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-08-22 08:27:02 +0000
commit7c7e9d3ce5bb706ae0edd0e6802fed873aab1bb0 (patch)
treeb9715c63bff452c3b710b7e769f7a2b331059d36 /Game
parent29b3c603197f197bf400577547d374a0bc016909 (diff)
downloadusdx-7c7e9d3ce5bb706ae0edd0e6802fed873aab1bb0.tar.gz
usdx-7c7e9d3ce5bb706ae0edd0e6802fed873aab1bb0.tar.xz
usdx-7c7e9d3ce5bb706ae0edd0e6802fed873aab1bb0.zip
black background for videos
debug display off credit to the ffmpeg&SDL tutorial git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@350 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/SMpeg/Uffmpeg.pas18
1 files changed, 14 insertions, 4 deletions
diff --git a/Game/Code/SMpeg/Uffmpeg.pas b/Game/Code/SMpeg/Uffmpeg.pas
index d6e8cc81..2b8f1f44 100644
--- a/Game/Code/SMpeg/Uffmpeg.pas
+++ b/Game/Code/SMpeg/Uffmpeg.pas
@@ -1,3 +1,10 @@
+{############################################################################
+# FFmpeg support for UltraStar deluxe #
+# #
+# Created by b1indy #
+# based on 'An ffmpeg and SDL Tutorial' (http://www.dranger.com/ffmpeg/) #
+#############################################################################}
+
unit Uffmpeg;
interface
@@ -31,7 +38,7 @@ var
implementation
-const DebugDisplay=True;
+const DebugDisplay=False;
procedure Init;
begin
@@ -86,8 +93,9 @@ begin
end else showmessage('no matching codec found');
if(errnum >=0) then
begin
- showmessage('Found a matching Codec:'+#13#10#13#10+
- 'Width='+inttostr(VideoCodecContext^.width)+
+ if DebugDisplay then
+ showmessage('Found a matching Codec:'+#13#10#13#10+
+ 'Width='+inttostr(VideoCodecContext^.width)+
', Height='+inttostr(VideoCodecContext^.height)+#13#10+
'Aspect: '+inttostr(VideoCodecContext^.sample_aspect_ratio.num)+'/'+inttostr(VideoCodecContext^.sample_aspect_ratio.den)+#13#10+
'Framerate: '+inttostr(VideoCodecContext^.time_base.num)+'/'+inttostr(VideoCodecContext^.time_base.den));
@@ -129,7 +137,7 @@ begin
ScaledVideoWidth:=600.0*VideoAspect;
end;
VideoTimeBase:=VideoCodecContext^.time_base.num/VideoCodecContext^.time_base.den;
- if (VideoAspect*VideoCodecContext^.width*VideoCodecContext^.height)>200000 then
+ if (DebugDisplay) and ((VideoAspect*VideoCodecContext^.width*VideoCodecContext^.height)>200000) then
showmessage('you are trying to play a rather large video'+#13#10+
'be prepared to experience some timing problems');
end;
@@ -238,6 +246,8 @@ end;
procedure FFmpegDrawGL;
begin
if not VideoOpened then Exit;
+ glClearColor(0,0,0,0);
+ glClear(GL_COLOR_BUFFER_BIT and GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glColor4f(1, 1, 1, 1);