[Scummvm-cvs-logs] SF.net SVN: scummvm: [20654] scummvm/trunk/backends/PalmOS/Src

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Sun Feb 12 11:51:00 CET 2006


Revision: 20654
Author:   chrilith
Date:     2006-02-12 11:50:19 -0800 (Sun, 12 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20654&view=rev

Log Message:
-----------
- Splitted AppStartCheckScreenSize from app.cpp rev19461, here is the palm standard one : SonyScreenSize

ViewCVS Links:
-------------
    http://svn.sourceforge.net/scummvm?rev=19461&view=rev

Modified Paths:
--------------
    scummvm/trunk/backends/PalmOS/Src/init_sony.cpp
    scummvm/trunk/backends/PalmOS/Src/init_sony.h
Modified: scummvm/trunk/backends/PalmOS/Src/init_sony.cpp
===================================================================
--- scummvm/trunk/backends/PalmOS/Src/init_sony.cpp	2006-02-12 19:47:30 UTC (rev 20653)
+++ scummvm/trunk/backends/PalmOS/Src/init_sony.cpp	2006-02-12 19:50:19 UTC (rev 20654)
@@ -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 @@
 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;
+}

Modified: scummvm/trunk/backends/PalmOS/Src/init_sony.h
===================================================================
--- scummvm/trunk/backends/PalmOS/Src/init_sony.h	2006-02-12 19:47:30 UTC (rev 20653)
+++ scummvm/trunk/backends/PalmOS/Src/init_sony.h	2006-02-12 19:50:19 UTC (rev 20654)
@@ -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







More information about the Scummvm-git-logs mailing list