From 57de01eb864e816b7dd2022501a40cc9ff629dcc Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 23 Nov 2008 23:49:15 +0000 Subject: [PATCH] Subtitles have their own message function. --- src/drawing.cpp | 18 ++++++++++++++++++ src/movie.cpp | 27 ++++++++++++++++++++++++++- src/movie.h | 1 + src/video.cpp | 1 + src/video.h | 3 ++- 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/drawing.cpp b/src/drawing.cpp index 5528b355..37ea02a2 100644 --- a/src/drawing.cpp +++ b/src/drawing.cpp @@ -159,6 +159,24 @@ void DrawMessage(bool beforeMovie) DrawTextTrans(ClipSidesOffset+t, 256, (uint8 *)guiMessage.errmsg, color+0x80); } } + + if(subtitleMessage.howlong) + { + uint8 *tt; + subtitleMessage.howlong--; + tt=XBuf+FCEU_TextScanlineOffsetFromBottom(216); + + if(tt>=XBuf) + { + int color = 0x20; + if(subtitleMessage.howlong == 39) color = 0x38; + if(subtitleMessage.howlong <= 30) color = 0x2C; + if(subtitleMessage.howlong <= 20) color = 0x1C; + if(subtitleMessage.howlong <= 10) color = 0x11; + if(subtitleMessage.howlong <= 5) color = 0x1; + DrawTextTrans(ClipSidesOffset+tt, 256, (uint8 *)subtitleMessage.errmsg, color+0x80); + } + } } diff --git a/src/movie.cpp b/src/movie.cpp index 15edbcc4..122e35c7 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -1216,6 +1216,31 @@ void ProcessSubtitles(void) for(uint32 i=0;i