[Scummvm-cvs-logs] SF.net SVN: scummvm: [28835] scummvm/trunk/engines/agi

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Sep 3 00:47:53 CEST 2007


Revision: 28835
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28835&view=rev
Author:   thebluegr
Date:     2007-09-02 15:47:53 -0700 (Sun, 02 Sep 2007)

Log Message:
-----------
Text in Mickey is shown correctly now. Also, removed an obsolete function declaration of PutPixel()

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/font.h
    scummvm/trunk/engines/agi/graphics.cpp
    scummvm/trunk/engines/agi/graphics.h
    scummvm/trunk/engines/agi/preagi_common.cpp

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2007-09-02 22:45:02 UTC (rev 28834)
+++ scummvm/trunk/engines/agi/agi.h	2007-09-02 22:47:53 UTC (rev 28835)
@@ -1006,7 +1006,6 @@
 	void drawStr(int row, int col, int attr, const char *buffer);
 	void drawStrMiddle(int row, int attr, const char *buffer);
 	void clearTextArea();
-	void drawChar(int x, int y, int attr, int code, const char *fontdata);
 };
 
 } // End of namespace Agi

Modified: scummvm/trunk/engines/agi/font.h
===================================================================
--- scummvm/trunk/engines/agi/font.h	2007-09-02 22:45:02 UTC (rev 28834)
+++ scummvm/trunk/engines/agi/font.h	2007-09-02 22:47:53 UTC (rev 28835)
@@ -294,7 +294,7 @@
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x7E, 0x00
 };
 
-const uint8 mickey_fontdata[] = {
+static const uint8 mickey_fontdata[] = {
 	0x00, 0x36, 0x7F, 0x7F, 0x3E, 0x1C, 0x08, 0x00, 
 	0x00, 0x00, 0x3F, 0x20, 0x2F, 0x28, 0x28, 0x28, 
 	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2007-09-02 22:45:02 UTC (rev 28834)
+++ scummvm/trunk/engines/agi/graphics.cpp	2007-09-02 22:47:53 UTC (rev 28835)
@@ -612,11 +612,11 @@
 	free(_shakeH);
 }
 
-void GfxMgr::putTextCharacter(int l, int x, int y, unsigned int c, int fg, int bg, bool checkerboard) {
+void GfxMgr::putTextCharacter(int l, int x, int y, unsigned int c, int fg, int bg, bool checkerboard, const uint8 *font) {
 	int x1, y1, xx, yy, cc;
 	const uint8 *p;
 
-	p = Agi::curFont + ((unsigned int)c * CHAR_LINES);
+	p = font + ((unsigned int)c * CHAR_LINES);
 	for (y1 = 0; y1 < CHAR_LINES; y1++) {
 		for (x1 = 0; x1 < CHAR_COLS; x1++) {
 			xx = x + x1;

Modified: scummvm/trunk/engines/agi/graphics.h
===================================================================
--- scummvm/trunk/engines/agi/graphics.h	2007-09-02 22:45:02 UTC (rev 28834)
+++ scummvm/trunk/engines/agi/graphics.h	2007-09-02 22:47:53 UTC (rev 28835)
@@ -27,6 +27,7 @@
 #define AGI_GRAPHICS_H
 
 #include "common/stdafx.h"
+#include "agi/font.h"
 
 namespace Agi {
 
@@ -58,7 +59,7 @@
 
 	void gfxPutBlock(int x1, int y1, int x2, int y2);
 
-	void putTextCharacter(int, int, int, unsigned int, int, int, bool checkerboard = false);
+	void putTextCharacter(int, int, int, unsigned int, int, int, bool checkerboard = false, const uint8 *font = curFont);
 	void shakeScreen(int);
 	void shakeStart();
 	void shakeEnd();
@@ -88,7 +89,6 @@
 	int getAGIPalFileNum();
 	void drawFrame(int x1, int y1, int x2, int y2, int c1, int c2);
 
-	void putPixel(int, int, int);
 	void putBlock(int x1, int y1, int x2, int y2);
 	void gfxSetPalette();
 	void setCursor(bool amigaStyleCursor = false);

Modified: scummvm/trunk/engines/agi/preagi_common.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_common.cpp	2007-09-02 22:45:02 UTC (rev 28834)
+++ scummvm/trunk/engines/agi/preagi_common.cpp	2007-09-02 22:47:53 UTC (rev 28835)
@@ -62,7 +62,7 @@
 			break;
 
 		default:
-			drawChar(col * 8, row * 8, attr, code, (const char*)mickey_fontdata);
+			_gfx->putTextCharacter(1, col * 8 , row * 8, static_cast<char>(code), attr & 0x0f, (attr & 0xf0) / 0x10, false, mickey_fontdata);
 
 			if (++col == 320 / 8) {
 				col = 0;
@@ -78,28 +78,11 @@
 }
 
 void PreAgiEngine::clearTextArea() {
-	// FIXME: this causes crashes, I imagine it's because we're not currently locking the screen in drawStr
 	for (int row = IDI_MAX_ROW_PIC; row < 200 / 8; row++) {
-		//drawStr(row, 0, IDA_DEFAULT, "                                        ");	// 40 spaces
+		drawStr(row, 0, IDA_DEFAULT, "                                        ");	// 40 spaces
 	}
 }
 
-void PreAgiEngine::drawChar(int x, int y, int attr, int code, const char *fontdata) {
-	int cx, cy;
-	uint8 color;
-
-	for (cy = 0; cy < 8; cy++) {
-		for (cx = 0; cx < 8; cx++) {
-			if (fontdata[(code * 8) + cy] & (1 << (7 - cx)))
-				color = attr & 0x0f;			// foreground color
-			else
-				color = (attr & 0xf0) / 0x10;	// background color
-
-			_gfx->putPixelsA(x + cx, y + cy, 1, &color);
-		}
-	}
-}
-
 // Input functions
 
 void PreAgiEngine::waitAnyKeyAnim() {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list