-Fixed the infinite loop caused by Movie.FixMnemonic. That was dumb.
-Removed the FCEUX handling from SubtitleList.AddSubtitle; it didn't work at all, which is good because we no longer support FM2 natively anyway! -Added MovieImport.AddSubtitle, which parses FM2 subtitles and forwards them to the .TAS movie object. --For the color, I used 16777215 as it seems the subtitles use decimal instead of hexadecimal...why? --Even though I used this color, which is definitely the equivalent of FFFFFF (white), the subtitles show up as black. I don't think this has anything to do with the importer, but it's worth looking into.
This commit is contained in:
parent
145830d5a4
commit
213b347779
|
@ -335,6 +335,7 @@ namespace BizHawk.MultiClient
|
|||
while (frame < Log.Length())
|
||||
{
|
||||
// TODO: Correct mnemonics, using Log.GetFrame(frame))?
|
||||
break;
|
||||
}
|
||||
lastLog = frame;
|
||||
}
|
||||
|
|
|
@ -71,6 +71,25 @@ namespace BizHawk.MultiClient
|
|||
return str;
|
||||
}
|
||||
|
||||
private static bool AddSubtitle(ref Movie m, string subtitleStr)
|
||||
{
|
||||
if (subtitleStr.Length == 0)
|
||||
return false;
|
||||
Subtitle s = new Subtitle();
|
||||
int x = subtitleStr.IndexOf(' ');
|
||||
if (x <= 0)
|
||||
return false;
|
||||
// Remove the "subtitle" header from the string.
|
||||
string sub = subtitleStr.Substring(x + 1, subtitleStr.Length - x - 1);
|
||||
x = sub.IndexOf(' ');
|
||||
if (x <= 0)
|
||||
return false;
|
||||
// The frame and message are separated by a space.
|
||||
string frame = sub.Substring(0, x);
|
||||
string message = sub.Substring(x + 1, sub.Length - x - 1);
|
||||
m.Subtitles.AddSubtitle("subtitle " + frame + " 0 0 200 16777215 " + message);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Movie ImportText(string path, out string errorMsg, string emulator)
|
||||
{
|
||||
|
@ -130,7 +149,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else if (str.StartsWith("subtitle") || str.StartsWith("sub"))
|
||||
{
|
||||
m.Subtitles.AddSubtitle(str);
|
||||
AddSubtitle(ref m, str);
|
||||
}
|
||||
else if (str[0] == '|')
|
||||
{
|
||||
|
|
|
@ -136,9 +136,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
catch
|
||||
{
|
||||
s.Message = str; //Assume it is a FCEUX subtitle
|
||||
subs.Add(s);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
x = str.IndexOf(' ');
|
||||
|
|
Loading…
Reference in New Issue