[Scummvm-cvs-logs] CVS: scummvm/queen display.h,1.18,1.19 display.cpp,1.24,1.25 queen.cpp,1.39,1.40

Gregory Montoir cyx at users.sourceforge.net
Mon Nov 10 07:46:13 CET 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv10324

Modified Files:
	display.h display.cpp queen.cpp 
Log Message:
hack for special french character

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- display.h	8 Nov 2003 11:32:32 -0000	1.18
+++ display.h	10 Nov 2003 15:45:53 -0000	1.19
@@ -55,6 +55,7 @@
 	void drawString(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true);
 	void drawChar(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const uint8 *chr);
 
+	Language lang;
 	uint8 charWidth[256];
 	static const uint8 FONT[];
 };
@@ -63,7 +64,7 @@
 class Display {
 public:
 
-	Display(OSystem *system, Input *input);
+	Display(Language language, OSystem *system, Input *input);
 	~Display();
 
 	void dynalumInit(Resource *resource, const char *roomName, uint16 roomNum);

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- display.cpp	8 Nov 2003 23:45:45 -0000	1.24
+++ display.cpp	10 Nov 2003 15:45:53 -0000	1.25
@@ -57,9 +57,9 @@
 
 	const uint8 *str = (const uint8*)text;
 	while (*str && x < dstPitch) {
-		const uint8 *pchr = FONT + (*str) * 8;
 
-		// FIXME: handle 0x96 character in french version (replace with 0xFB)
+		uint8 c = (lang == FRENCH && *str == 0x96) ? 0xFB : *str;
+		const uint8 *pchr = FONT + c * 8;
 
 		if (outlined) {
 			drawChar(dstBuf, dstPitch, x - 1, y - 1, INK_OUTLINED_TEXT, pchr);
@@ -73,7 +73,7 @@
 		}
 		drawChar(dstBuf, dstPitch, x, y, color, pchr);
 
-		x += charWidth[ *str ];
+		x += charWidth[ c ];
 		++str;
 	}
 }
@@ -101,10 +101,11 @@
 
 
 
-Display::Display(OSystem *system, Input *input)
+Display::Display(Language language, OSystem *system, Input *input)
 	: _system(system), _input(input) {
 
 	_dynalum.prevColMask = 0xFF;
+	_textRenderer.lang = language;
 	_textRenderer.init();
 
 	_buffers[RB_BACKDROP] = new uint8[BACKDROP_W * BACKDROP_H];

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- queen.cpp	10 Nov 2003 12:32:46 -0000	1.39
+++ queen.cpp	10 Nov 2003 15:45:53 -0000	1.40
@@ -223,7 +223,7 @@
 void QueenEngine::initialise(void) {
 	_resource = new Resource(_gameDataPath, _detectname,  _system->get_savefile_manager(), getSavePath());
 	_input = new Input(_resource->getLanguage(), _system);
-	_display = new Display(_system, _input);
+	_display = new Display(_resource->getLanguage(), _system, _input);
 	_graphics = new Graphics(_display, _input, _resource);
 	_sound = Sound::giveSound(_mixer, _input, _resource, _resource->compression());
 	_logic = new Logic(_resource, _graphics, _display, _input, _sound);





More information about the Scummvm-git-logs mailing list