aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2007-01-26 23:21:04 +0000
committerNicola Mettifogo2007-01-26 23:21:04 +0000
commitb5a04fc2df4b29cedd03770960a434e45cca5665 (patch)
tree25b7a16fd00957ffb6ee8efdb4fcad9a70124b76 /engines/parallaction
parent221e9e77dd5eed76359f5c4f31544d99da285216 (diff)
downloadscummvm-rg350-b5a04fc2df4b29cedd03770960a434e45cca5665.tar.gz
scummvm-rg350-b5a04fc2df4b29cedd03770960a434e45cca5665.tar.bz2
scummvm-rg350-b5a04fc2df4b29cedd03770960a434e45cca5665.zip
added NULLity checks
svn-id: r25213
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/graphics.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 28bcfdd563..b3de7916e0 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -352,7 +352,7 @@ void Graphics::floodFill(byte color, uint16 left, uint16 top, uint16 right, uint
void Graphics::flatBlit(uint16 w, uint16 h, int16 x, int16 y, byte *data, Graphics::Buffers buffer) {
-// printf("Graphics::flatBlit(%i, %i, %i, %i)\n", w, h, x, y);
+ printf("Graphics::flatBlit(%i, %i, %i, %i)\n", w, h, x, y);
// source coordinates
int16 left = 0, top = 0;
@@ -376,6 +376,8 @@ void Graphics::flatBlit(uint16 w, uint16 h, int16 x, int16 y, byte *data, Graphi
byte *s = data + left + top * w;
byte *d = _buffers[buffer] + x + y * SCREEN_WIDTH;
+ printf("Graphics::flatBlit CLIPPED (%i, %i, %i, %i) -> (%i, %i) %x %x\n", left, top, right, bottom, x, y, (uint32)s, (uint32)d);
+
for (uint16 i = top; i < bottom; i++) {
for (uint16 j = left; j < right; j++) {
if (*s != 0) *d = *s;
@@ -387,8 +389,12 @@ void Graphics::flatBlit(uint16 w, uint16 h, int16 x, int16 y, byte *data, Graphi
d += (SCREEN_WIDTH - right + left);
}
+ printf("Graphics::flatBlit BLITTED\n");
+
if (buffer == kBitFront) updateScreen();
+ printf("Graphics::flatBlit DONE\n");
+
return;
}
@@ -614,6 +620,7 @@ void Graphics::restoreCnvBackground(StaticCnv *cnv, int16 x, int16 y) {
// strings
//
void Graphics::displayString(uint16 x, uint16 y, const char *text) {
+ if (text == NULL) return;
uint16 len = strlen(text);
StaticCnv tmp;
@@ -718,6 +725,8 @@ bool Graphics::displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwi
uint16 Graphics::getStringWidth(const char *text) {
+ if (text == NULL) return 0;
+
uint16 len = strlen(text);
if (_proportionalFont == 0) {