diff --git a/BizHawk.MultiClient/RenderPanel.cs b/BizHawk.MultiClient/RenderPanel.cs
index 870c1b29a1..1733764e4d 100644
--- a/BizHawk.MultiClient/RenderPanel.cs
+++ b/BizHawk.MultiClient/RenderPanel.cs
@@ -419,11 +419,11 @@ namespace BizHawk.MultiClient
}
//TODO: read subtitle positioning, implement multiple subtitles at once feature
- MessageFont.DrawString(null, Global.MainForm.UserMovie.Subtitles.GetSubtitle(Global.Emulator.Frame), 0 + 1,
- 0 + 1, new Color4(Color.Black));
- MessageFont.DrawString(null, Global.MainForm.UserMovie.Subtitles.GetSubtitle(Global.Emulator.Frame), 0 ,
- 0, new Color4(Color.White));
-
+ Subtitle s = new Subtitle(Global.MainForm.UserMovie.Subtitles.GetSubtitle(Global.Emulator.Frame));
+ MessageFont.DrawString(null, s.Message, s.X + 1,
+ s.Y + 1, new Color4(Color.Black));
+ MessageFont.DrawString(null, s.Message, s.X,
+ s.Y, new Color4(Color.White));//Color.FromArgb((int)s.Color));
}
private string MakeFrameCounter()
diff --git a/BizHawk.MultiClient/movie/SubtitleList.cs b/BizHawk.MultiClient/movie/SubtitleList.cs
index 4c47a7c4ed..451a13c116 100644
--- a/BizHawk.MultiClient/movie/SubtitleList.cs
+++ b/BizHawk.MultiClient/movie/SubtitleList.cs
@@ -57,7 +57,7 @@ namespace BizHawk.MultiClient
///
///
///
- public string GetSubtitle(int frame)
+ public string GetSubtitleMessage(int frame)
{
if (subs.Count == 0) return "";
@@ -69,6 +69,18 @@ namespace BizHawk.MultiClient
return "";
}
+ public Subtitle GetSubtitle(int frame)
+ {
+ if (subs.Count == 0) return new Subtitle();
+
+ for (int x = 0; x < subs.Count; x++)
+ {
+ if (frame >= subs[x].Frame && frame <= subs[x].Frame + subs[x].Duration)
+ return subs[x];
+ }
+ return new Subtitle();
+ }
+
public int Count()
{
return subs.Count;
@@ -141,9 +153,34 @@ namespace BizHawk.MultiClient
return false;
}
- s.Duration = 120;
+ x = str.IndexOf(' ');
+ if (x <= 0) return false;
+ string Duration = str.Substring(0, x);
+ str = str.Substring(x + 1, str.Length - x - 1);
+ try
+ {
+ s.Duration = int.Parse(Duration);
+ }
+ catch
+ {
+ return false;
+ }
+
+ //TODO: parse hex!
+ x = str.IndexOf(' ');
+ if (x <= 0) return false;
+ string Color = str.Substring(0, x);
+ str = str.Substring(x + 1, str.Length - x - 1);
+ try
+ {
+ s.Color = uint.Parse(Color);
+ }
+ catch
+ {
+ return false;
+ }
+
s.Message = str;
- s.Color = 0xFFFFFFFF;
subs.Add(s);
return true;