diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/PalmOS/Src/init_sony.cpp | 73 | ||||
-rw-r--r-- | backends/PalmOS/Src/init_sony.h | 31 |
2 files changed, 102 insertions, 2 deletions
diff --git a/backends/PalmOS/Src/init_sony.cpp b/backends/PalmOS/Src/init_sony.cpp index 499294c667..3ba4e8b8d0 100644 --- a/backends/PalmOS/Src/init_sony.cpp +++ b/backends/PalmOS/Src/init_sony.cpp @@ -1,3 +1,27 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001-2006 The ScummVM project + * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include <PalmOS.h> #include <SonyClie.h> #include "init_sony.h" @@ -86,6 +110,53 @@ UInt16 SonyHRInit(UInt32 depth) { void SonyHRRelease(UInt16 HRrefNum) { if (HRrefNum != sysInvalidRefNum) { HRClose(HRrefNum); - //SysLibRemove(gVars->HRrefNum); // never call this !! + //SysLibRemove(HRrefNum); // never call this !! + } +} + +UInt8 SonyScreenSize(UInt16 HRrefNum, Coord *stdw, Coord *stdh, Coord *fullw, Coord *fullh) { + UInt32 version; + UInt16 slkRefNum; + UInt8 mode = 0; + + Coord sw = 160; + Coord sh = 160; + Coord fw = sw; + Coord fh = sh; + + if (HRrefNum != sysInvalidRefNum) { + sw = hrWidth; + sh = hrHeight; + fw = sw; + fh = sh; + + slkRefNum = SilkInit(&version); + + if (slkRefNum != sysInvalidRefNum) { + if (version == vskVersionNum1) { + SilkLibEnableResize(slkRefNum); + SilkLibResizeDispWin(slkRefNum, silkResizeMax); + HRWinGetWindowExtent(HRrefNum, &fw, &fh); + SilkLibResizeDispWin(slkRefNum, silkResizeNormal); + SilkLibDisableResize(slkRefNum); + mode = SONY_PORTRAIT; + + } else { + VskSetState(slkRefNum, vskStateEnable, (version == vskVersionNum2 ? vskResizeVertically : vskResizeHorizontally)); + VskSetState(slkRefNum, vskStateResize, vskResizeNone); + HRWinGetWindowExtent(HRrefNum, &fw, &fh); + VskSetState(slkRefNum, vskStateResize, vskResizeMax); + VskSetState(slkRefNum, vskStateEnable, vskResizeDisable); + mode = (version == vskVersionNum3 ? SONY_LANDSCAPE : SONY_PORTRAIT); + } + SilkRelease(slkRefNum); + } } + + *stdw = sw; + *stdh = sh; + *fullw = fw; + *fullh = fh; + + return mode; } diff --git a/backends/PalmOS/Src/init_sony.h b/backends/PalmOS/Src/init_sony.h index c88a272acc..ed783cc9ff 100644 --- a/backends/PalmOS/Src/init_sony.h +++ b/backends/PalmOS/Src/init_sony.h @@ -1,10 +1,39 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001-2006 The ScummVM project + * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #ifndef INIT_SONY_H #define INIT_SONY_H +#define SONY_PORTRAIT 1 +#define SONY_LANDSCAPE 2 + UInt16 SilkInit(UInt32 *retVersion); void SilkRelease(UInt16 slkRefNum); UInt16 SonyHRInit(UInt32 depth); void SonyHRRelease(UInt16 HRrefNum); -#endif +UInt8 SonyScreenSize(UInt16 HRrefNum, Coord *stdw, Coord *stdh, Coord *fullw, Coord *fullh); + +#endif
\ No newline at end of file |