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;
|
using std::list;
|
||||||
wxString ret;
|
wxString ret;
|
||||||
AssEntry *entry;
|
AssEntry *entry;
|
||||||
|
ret += 0xfeff;
|
||||||
for (list<AssEntry*>::iterator cur=Line.begin();cur!=Line.end();) {
|
for (list<AssEntry*>::iterator cur=Line.begin();cur!=Line.end();) {
|
||||||
entry = *cur;
|
entry = *cur;
|
||||||
ret += entry->GetEntryData();
|
ret += entry->GetEntryData();
|
||||||
ret += L"\n";
|
ret += L"\n";
|
||||||
|
cur++;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,11 +79,10 @@ SubtitleProviderASA::MyClass SubtitleProviderASA::me;
|
||||||
|
|
||||||
SubtitleProviderASA::SubtitleProviderASA(AssFile *_subs)
|
SubtitleProviderASA::SubtitleProviderASA(AssFile *_subs)
|
||||||
{
|
{
|
||||||
const wxChar *cstr;
|
|
||||||
|
|
||||||
subs = _subs;
|
subs = _subs;
|
||||||
cstr = subs->GetString().c_str();
|
wxString text = subs->GetString();
|
||||||
inst = asa_open_mem((const char *)cstr, wcslen(cstr), (enum asa_oflags)0);
|
|
||||||
|
inst = asa_open_mem((const char *)text.GetData(), sizeof(wchar_t) * text.Length(), (enum asa_oflags)0);
|
||||||
if (!inst)
|
if (!inst)
|
||||||
throw L"failed to load script with asa.";
|
throw L"failed to load script with asa.";
|
||||||
};
|
};
|
||||||
|
@ -111,7 +110,7 @@ void SubtitleProviderASA::Render(wxImage &frame, int ms)
|
||||||
aframe.csp = ASACSP_RGB;
|
aframe.csp = ASACSP_RGB;
|
||||||
aframe.bmp.rgb.fmt = ASACSPR_RGB;
|
aframe.bmp.rgb.fmt = ASACSPR_RGB;
|
||||||
aframe.bmp.rgb.d.d = frame.GetData();
|
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);
|
asa_render(inst, ms * 0.001, &aframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue