Movie subtitles - implement ability to display multiple subtitles at once
This commit is contained in:
parent
3bae8da0b6
commit
48f65ac847
|
@ -448,14 +448,19 @@ namespace BizHawk.MultiClient
|
|||
|
||||
if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE && Global.Config.DisplaySubtitles)
|
||||
{
|
||||
//TODO: implement multiple subtitles at once feature
|
||||
Subtitle s = Global.MovieSession.Movie.Subtitles.GetSubtitle(Global.Emulator.Frame);
|
||||
g.DrawString(s.Message, MessageFont, Brushes.Black,
|
||||
s.X + 1, s.Y + 1);
|
||||
using(var brush = new SolidBrush(Color.FromArgb((int)s.Color)))
|
||||
g.DrawString(s.Message, MessageFont, brush,
|
||||
s.X , s.Y );
|
||||
|
||||
List<Subtitle> s = Global.MovieSession.Movie.Subtitles.GetSubtitles(Global.Emulator.Frame);
|
||||
if (s == null) return;
|
||||
for (int i = 0; i < s.Count; i++)
|
||||
{
|
||||
g.DrawString(s[i].Message, MessageFont, Brushes.Black,
|
||||
s[i].X + 1, s[i].Y + 1);
|
||||
using (var brush = new SolidBrush(Color.FromArgb((int)s[i].Color)))
|
||||
g.DrawString(s[i].Message, MessageFont, brush,
|
||||
s[i].X, s[i].Y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,22 @@ namespace BizHawk.MultiClient
|
|||
return new Subtitle();
|
||||
}
|
||||
|
||||
public List<Subtitle> GetSubtitles(int frame)
|
||||
{
|
||||
if (subs.Count == 0)
|
||||
return null;
|
||||
|
||||
List<Subtitle> s = new List<Subtitle>();
|
||||
|
||||
for (int x = 0; x < subs.Count; x++)
|
||||
{
|
||||
if (frame >= subs[x].Frame && frame <= subs[x].Frame + subs[x].Duration)
|
||||
s.Add(subs[x]);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
public int Count()
|
||||
{
|
||||
return subs.Count;
|
||||
|
|
Loading…
Reference in New Issue