[Scummvm-cvs-logs] SF.net SVN: scummvm: [25664] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sat Feb 17 21:54:26 CET 2007
Revision: 25664
http://scummvm.svn.sourceforge.net/scummvm/?rev=25664&view=rev
Author: peres001
Date: 2007-02-17 12:54:25 -0800 (Sat, 17 Feb 2007)
Log Message:
-----------
changed mapChar to use unsigned (byte) instead of char, to avoid possible sign issues
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-02-17 20:50:50 UTC (rev 25663)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-02-17 20:54:25 UTC (rev 25664)
@@ -641,7 +641,7 @@
StaticCnv tmp;
for (uint16 i = 0; i < len; i++) {
- char c = mapChar(text[i]);
+ byte c = mapChar(text[i]);
tmp._width = _font._width;
tmp._height = _font._height;
@@ -663,7 +663,7 @@
for (uint16 i = 0; i < len; i++) {
- char c = mapChar(text[i]);
+ byte c = mapChar(text[i]);
uint16 w = _proportionalFont ? _glyphWidths[(int)c] : 8;
byte *s = _font._array[c];
byte *d = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
@@ -752,7 +752,7 @@
// proportional font
uint16 w = 0;
for (uint16 i = 0; i < len; i++) {
- char c = mapChar(text[i]);
+ byte c = mapChar(text[i]);
w += _glyphWidths[(int)c];
}
@@ -915,7 +915,7 @@
cnv->_data0 = (byte*)memAlloc(cnv->_width * cnv->_height);
for (uint16 i = 0; i < len; i++) {
- char c = mapChar(text[i]);
+ byte c = mapChar(text[i]);
byte *s = _font._array[c];
byte *d = cnv->_data0 + _font._width * i;
@@ -934,15 +934,14 @@
//
// internal character mapping
//
-char Graphics::mapChar(char c) {
- byte b = (byte)c;
+byte Graphics::mapChar(byte c) {
- if (b == 0xA5) return 0x5F;
- if (b == 0xDF) return 0x60;
+ if (c == 0xA5) return 0x5F;
+ if (c == 0xDF) return 0x60;
- if (b > 0x7F) return b - 0x7F;
+ if (c > 0x7F) return c - 0x7F;
- return b - 0x20;
+ return c - 0x20;
}
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2007-02-17 20:50:50 UTC (rev 25663)
+++ scummvm/trunk/engines/parallaction/graphics.h 2007-02-17 20:54:25 UTC (rev 25664)
@@ -165,7 +165,7 @@
//
// maps a character for representation
//
- char mapChar(char c);
+ byte mapChar(byte c);
void flatBlit(uint16 w, uint16 h, int16 x, int16 y, byte *data, Graphics::Buffers buffer);
void blit(uint16 w, uint16 h, int16 x, int16 y, uint16 z, byte *data, Graphics::Buffers buffer, Graphics::Buffers mask);
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