[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src/missing _stdio.cpp,1.7,1.8

Chris Apers chrilith at users.sourceforge.net
Tue Jan 20 06:33:00 CET 2004


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

Modified Files:
	_stdio.cpp 
Log Message:
Added DrawStatus function

Index: _stdio.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing/_stdio.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- _stdio.cpp	6 Jan 2004 12:45:25 -0000	1.7
+++ _stdio.cpp	20 Jan 2004 14:32:01 -0000	1.8
@@ -22,6 +22,27 @@
 
 #include "stdio.h"
 #include "extend.h"
+
+static void DrawStatus(Boolean show) {
+	if (OPTIONS_TST(kOptDisableOnScrDisp))
+		return;
+
+	UInt8 x,y;
+	UInt8 *screen = (UInt8 *)(BmpGetBits(WinGetBitmap(WinGetDisplayWindow())));
+	UInt8 color = (show? gVars->indicator.on : gVars->indicator.off);
+
+	if (gVars->screenLocked)
+		screen = (screen == gVars->flipping.pageAddr1) ? gVars->flipping.pageAddr2 : gVars->flipping.pageAddr1;
+
+	screen += gVars->screenPitch + 1;
+	for(y=0; y < 4; y++) {
+		for(x=0; x < 4; x++)
+			screen[x] = color;
+
+		screen += gVars->screenPitch;
+	}
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 //FileRef gLogFile;
 
@@ -70,7 +91,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 Char *fgets(Char *s, UInt32 n, FileRef *stream) {
 	UInt32 numBytesRead;
+	DrawStatus(true);
 	Err error = VFSFileRead(*stream, n, s, &numBytesRead);
+	DrawStatus(false);
 	if (error == errNone || error == vfsErrFileEOF) {
 		UInt32 reset = 0;
 		Char *endLine = StrChr(s, '\n');
@@ -196,7 +219,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 UInt32 fread(void *ptr, UInt32 size, UInt32 nitems, FileRef *stream) {
 	UInt32 numBytesRead;
+	DrawStatus(true);
 	Err error = VFSFileRead(*stream, size*nitems, ptr, &numBytesRead);
+	DrawStatus(false);
 	if (error == errNone || error == vfsErrFileEOF)
 		return (UInt32)(numBytesRead/size);
 
@@ -228,7 +253,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 UInt32 fwrite(const void *ptr, UInt32 size, UInt32 nitems, FileRef *stream) {
 	UInt32 numBytesWritten;
+	DrawStatus(true);
 	Err error = VFSFileWrite(*stream, size*nitems, ptr, &numBytesWritten);
+	DrawStatus(false);
 
 	if (error == errNone || error == vfsErrFileEOF)
 		return (UInt32)(numBytesWritten/size);
@@ -324,6 +351,7 @@
 	StrReplace(format, 256, "%02ld","%.2d");
 	StrReplace(format, 256, "%01ld","%.1d");
 	StrReplace(format, 256, "%02ld","%02d");
+	StrReplace(format, 256, "%02lx","%02x");
 
 	StrReplace(format, 256, "%2ld","%2d");
 	StrReplace(format, 256, "%3ld","%3d");





More information about the Scummvm-git-logs mailing list