[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src extend.cpp,1.4,1.5 extend.h,1.5,1.6

Chris Apers chrilith at users.sourceforge.net
Tue Sep 23 08:55:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1:/tmp/cvs-serv11060

Modified Files:
	extend.cpp extend.h 
Log Message:
Moved PalmFatalError here

Index: extend.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/extend.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- extend.cpp	18 Aug 2003 10:43:41 -0000	1.4
+++ extend.cpp	23 Sep 2003 15:54:20 -0000	1.5
@@ -23,12 +23,23 @@
 #include <PalmOS.h>
 #include "extend.h"
 #include "string.h"
-#include "palm.h"
+#include "globals.h"
+#include "starterrsc.h"
 
 const Char *SCUMMVM_SAVEPATH = "/PALM/Programs/ScummVM/Saved/";
 
-UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Char *fndParamStr)
-{
+void PalmFatalError(const Char *err) {
+	WinPalette(winPaletteSetToDefault,0,0,0);
+
+	if (gVars->screenLocked)
+		WinScreenUnlock();
+
+	WinEraseWindow();
+	FrmCustomAlert(FrmFatalErrorAlert, err, 0,0);
+	SysReset();
+}
+
+UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Char *fndParamStr) {
 	Char *found;
 	Boolean quit = false;
 	UInt16 occurences = 0;
@@ -41,23 +52,20 @@
 	if (inParamStr)
 		l2 = StrLen(inParamStr); // can be null to know how many occur.
 	
-	while (((found = StrStr(ioStr+next, fndParamStr)) != NULL) && (!quit))
-	{
+	while (((found = StrStr(ioStr+next, fndParamStr)) != NULL) && (!quit)) {
 		occurences++;
 		newLength = (StrLen(ioStr) - l1 + l2);
 
-		if ( newLength > inMaxLen )
-		{
+		if ( newLength > inMaxLen ) {
 			quit = true;
 			occurences--;
-		}
-		else if (inParamStr)
-		{
+
+		} else if (inParamStr) {
 			MemMove(found + l2, found + l1, inMaxLen-(found-ioStr+l2));
 			MemMove(found, inParamStr, l2);
 			next = found - ioStr + l2;
-		}
-		else
+
+		} else
 			next = found - ioStr + l1;
 	}
 	
@@ -67,8 +75,7 @@
 	return occurences;
 }
 
-void WinDrawWarpChars(const Char *chars, Int16 len, Coord x, Coord y, Coord maxWidth)
-{
+void WinDrawWarpChars(const Char *chars, Int16 len, Coord x, Coord y, Coord maxWidth) {
 	Char *part = (Char *)chars;
 	Coord x2 = x;
 	Int16 next;
@@ -78,11 +85,9 @@
 
 	part = StrTok(part," ");
 
-	while ( part )
-	{
+	while ( part ) 	{
 		next = FntLineWidth (part, StrLen(part)) + FntLineWidth (" ",1);
-		if ((x2 + next - x) > maxWidth)
-		{
+		if ((x2 + next - x) > maxWidth) {
 			x2 = x;
 			y += FntLineHeight();
 		}
@@ -92,4 +97,4 @@
 
 		part = StrTok(NULL," ");
 	}
-}
\ No newline at end of file
+}

Index: extend.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/extend.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- extend.h	6 Aug 2003 08:31:36 -0000	1.5
+++ extend.h	23 Sep 2003 15:54:20 -0000	1.6
@@ -30,7 +30,8 @@
 #define DISABLE_SIMON
 #define DISABLE_SWORD2
 
-#define appFileCreator			'ScVM'
+// PalmOS
+//#define DISABLE_TAPWAVE
 
 int main(int argc, char **argv);
 





More information about the Scummvm-git-logs mailing list