diff options
author | Chris Apers | 2003-11-28 09:18:32 +0000 |
---|---|---|
committer | Chris Apers | 2003-11-28 09:18:32 +0000 |
commit | 95aff6d5b9486334dca5b29c887c6c539c78733f (patch) | |
tree | dac4180c24872db53a3af4c34a620731dae1e2a5 /backends/PalmOS | |
parent | 801c9adb1558d544f8030a99e2f5bba3cd1c94d8 (diff) | |
download | scummvm-rg350-95aff6d5b9486334dca5b29c887c6c539c78733f.tar.gz scummvm-rg350-95aff6d5b9486334dca5b29c887c6c539c78733f.tar.bz2 scummvm-rg350-95aff6d5b9486334dca5b29c887c6c539c78733f.zip |
Correct handling of screen size and pitch
svn-id: r11388
Diffstat (limited to 'backends/PalmOS')
-rw-r--r-- | backends/PalmOS/Src/app.cpp | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/backends/PalmOS/Src/app.cpp b/backends/PalmOS/Src/app.cpp index b79e01cdda..7932507e13 100644 --- a/backends/PalmOS/Src/app.cpp +++ b/backends/PalmOS/Src/app.cpp @@ -173,15 +173,59 @@ static void AppStopMathLib() { } } +// Set the screen pitch for direct screen access +// avaliable only before a game start +void WinScreenGetPitch() { + if (gVars->HRrefNum == sysInvalidRefNum) // TODO : better to check if Hi-Density feature is present (?) + WinScreenGetAttribute(winScreenRowBytes, &(gVars->screenPitch)); + else + gVars->screenPitch = gVars->screenFullWidth; +} + +void PINGetScreenDimensions() { + UInt32 ftr; + + gVars->pinUpdate = false; + + // if feature set, not set on Garmin iQue3600 + if (!(FtrGet(sysFtrCreator, sysFtrNumInputAreaFlags, &ftr))) { + if (ftr & grfFtrInputAreaFlagCollapsible) { + + RectangleType r; + UInt16 curOrientation = SysGetOrientation(); + + gVars->options |= optIsCollapsible; + // reset previous options if any + gVars->options &= ~optHasWideMode; + gVars->options &= ~optHasLandscapeMode; + gVars->options &= ~optIsLandscapeDisplay; + + PINSetInputAreaState(pinInputAreaClosed); + StatHide(); + + WinGetBounds(WinGetDisplayWindow(), &r); + gVars->screenFullWidth = r.extent.x << 1; + gVars->screenFullHeight = r.extent.y << 1; + + gVars->options |= optHasWideMode; + + if (curOrientation == sysOrientationLandscape || + curOrientation == sysOrientationReverseLandscape + ) + gVars->options |= optHasLandscapeMode; + + StatShow(); + PINSetInputAreaState(pinInputAreaOpen); + } + } + + gVars->pinUpdate = true; +} + static Err AppStartCheckScreenSize() { SonySysFtrSysInfoP sonySysFtrSysInfoP; Err error = errNone; - UInt32 ftr = 0; -// WinGetDisplayExtent(&gVars->screenWidth, &gVars->screenHeight); - -// gVars->screenWidth <<= 1; -// gVars->screenHeight <<= 1; gVars->screenWidth = 320; gVars->screenHeight = 320; @@ -216,7 +260,7 @@ static Err AppStartCheckScreenSize() { error = VskOpen(gVars->slkRefNum); if(!error) { VskSetState(gVars->slkRefNum, vskStateEnable, (gVars->slkVersion == vskVersionNum2 ? vskResizeVertically : vskResizeHorizontally)); - gVars->options |= (gVars->slkVersion == vskVersionNum2 ? optIsLandscapeMode : 0); + gVars->options |= (gVars->slkVersion == vskVersionNum2 ? optHasLandscapeMode : 0); VskSetState(gVars->slkRefNum, vskStateResize, vskResizeNone); HRWinGetWindowExtent(gVars->HRrefNum, &gVars->screenFullWidth, &gVars->screenFullHeight); VskSetState(gVars->slkRefNum, vskStateResize, vskResizeMax); @@ -231,31 +275,12 @@ static Err AppStartCheckScreenSize() { else gVars->options |= optHasWideMode; } + // Tapwave Zodiac and other DIA API compatible devies + // get max screen size + if (error) + PINGetScreenDimensions(); - // Tapwave Zodiac and other DIA API compatible devies, TODO : a better handler, read the doc - if (error) { - if (!(error = FtrGet(sysFtrCreator, sysFtrNumInputAreaFlags, &ftr))) { - if (ftr & grfFtrInputAreaFlagLandscape) { - UInt16 old = SysGetOrientation(); - error = SysSetOrientation(sysOrientationLandscape); - error = (error) ? error : PINSetInputAreaState(pinInputAreaClosed); - error = (error) ? error : StatHide(); - - if (!error) { - RectangleType r; - WinGetBounds(WinGetDisplayWindow(), &r); - gVars->screenFullWidth = r.extent.x << 1; - gVars->screenFullHeight = r.extent.y << 1; - gVars->options |= optHasWideMode|optIsLandscapeMode; - } - - error = StatShow(); - error = PINSetInputAreaState(pinInputAreaOpen); - error = SysSetOrientation(old); - } - } - } - + WinScreenGetPitch(); return error; } @@ -414,4 +439,4 @@ void AppStop(void) { if (autoReset) SysReset(); } -}
\ No newline at end of file +} |