Added some more Gabest logic to AssFile::GetResolution()

Originally committed to SVN as r1158.
This commit is contained in:
Niels Martin Hansen 2007-05-03 17:19:50 +00:00
parent e9284e5f88
commit 9aceffb576

View file

@ -727,7 +727,7 @@ void AssFile::GetResolution(int &sw,int &sh) {
// Height // Height
wxString temp = GetScriptInfo(_T("PlayResY")); wxString temp = GetScriptInfo(_T("PlayResY"));
if (temp.IsEmpty() || !temp.IsNumber()) { if (temp.IsEmpty() || !temp.IsNumber()) {
sh = 288; sh = 0;
} }
else { else {
long templ; long templ;
@ -738,13 +738,29 @@ void AssFile::GetResolution(int &sw,int &sh) {
// Width // Width
temp = GetScriptInfo(_T("PlayResX")); temp = GetScriptInfo(_T("PlayResX"));
if (temp.IsEmpty() || !temp.IsNumber()) { if (temp.IsEmpty() || !temp.IsNumber()) {
sw = 384; sw = 0;
} }
else { else {
long templ; long templ;
temp.ToLong(&templ); temp.ToLong(&templ);
sw = templ; sw = templ;
} }
// Gabest logic?
if (sw == 0 && sh == 0) {
sw = 384;
sh = 288;
} else if (sw == 0) {
if (sh == 1024)
sw = 1280;
else
sw = sh * 4 / 3;
} else if (sh == 0) {
if (sw == 1280)
sh = 1024;
else
sh = sw * 3 / 4;
}
} }