From 9aceffb576be79695ef8248229763ef0d581e0c7 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 3 May 2007 17:19:50 +0000 Subject: [PATCH] Added some more Gabest logic to AssFile::GetResolution() Originally committed to SVN as r1158. --- aegisub/ass_file.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/aegisub/ass_file.cpp b/aegisub/ass_file.cpp index 1ab86c858..f012d2d9c 100644 --- a/aegisub/ass_file.cpp +++ b/aegisub/ass_file.cpp @@ -727,7 +727,7 @@ void AssFile::GetResolution(int &sw,int &sh) { // Height wxString temp = GetScriptInfo(_T("PlayResY")); if (temp.IsEmpty() || !temp.IsNumber()) { - sh = 288; + sh = 0; } else { long templ; @@ -738,13 +738,29 @@ void AssFile::GetResolution(int &sw,int &sh) { // Width temp = GetScriptInfo(_T("PlayResX")); if (temp.IsEmpty() || !temp.IsNumber()) { - sw = 384; + sw = 0; } else { long templ; temp.ToLong(&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; + } }