mirror of https://github.com/odrling/Aegisub
fix AssFile::GetString / asa
Originally committed to SVN as r369.
This commit is contained in:
parent
77545ee654
commit
c289ad21a3
|
@ -187,10 +187,12 @@ wxString AssFile::GetString() {
|
|||
using std::list;
|
||||
wxString ret;
|
||||
AssEntry *entry;
|
||||
ret += 0xfeff;
|
||||
for (list<AssEntry*>::iterator cur=Line.begin();cur!=Line.end();) {
|
||||
entry = *cur;
|
||||
ret += entry->GetEntryData();
|
||||
ret += L"\n";
|
||||
cur++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -79,11 +79,10 @@ SubtitleProviderASA::MyClass SubtitleProviderASA::me;
|
|||
|
||||
SubtitleProviderASA::SubtitleProviderASA(AssFile *_subs)
|
||||
{
|
||||
const wxChar *cstr;
|
||||
|
||||
subs = _subs;
|
||||
cstr = subs->GetString().c_str();
|
||||
inst = asa_open_mem((const char *)cstr, wcslen(cstr), (enum asa_oflags)0);
|
||||
wxString text = subs->GetString();
|
||||
|
||||
inst = asa_open_mem((const char *)text.GetData(), sizeof(wchar_t) * text.Length(), (enum asa_oflags)0);
|
||||
if (!inst)
|
||||
throw L"failed to load script with asa.";
|
||||
};
|
||||
|
@ -111,7 +110,7 @@ void SubtitleProviderASA::Render(wxImage &frame, int ms)
|
|||
aframe.csp = ASACSP_RGB;
|
||||
aframe.bmp.rgb.fmt = ASACSPR_RGB;
|
||||
aframe.bmp.rgb.d.d = frame.GetData();
|
||||
aframe.bmp.rgb.d.stride = frame.GetWidth();
|
||||
aframe.bmp.rgb.d.stride = 3 * frame.GetWidth();
|
||||
asa_render(inst, ms * 0.001, &aframe);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue