From b97f726a3e79d11ca243ef48a8a6173d47366c7e Mon Sep 17 00:00:00 2001 From: lukaslw Date: Sat, 9 Aug 2014 05:37:57 +0200 Subject: PRINCE: scrollCredits() implementation, showLogo() update --- engines/prince/font.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/prince/font.cpp') diff --git a/engines/prince/font.cpp b/engines/prince/font.cpp index 0ac61f29be..42329d2606 100644 --- a/engines/prince/font.cpp +++ b/engines/prince/font.cpp @@ -25,6 +25,7 @@ #include "common/stream.h" #include "prince/font.h" +#include "prince/prince.h" namespace Prince { @@ -72,6 +73,7 @@ int Font::getCharWidth(uint32 chr) const { void Font::drawChar(Graphics::Surface *dst, uint32 chr, int posX, int posY, uint32 color) const { const ChrData chrData = getChrData(chr); + Common::Rect screenRect(0, 0, PrinceEngine::kNormalWidth, PrinceEngine::kNormalHeight); for (int y = 0; y < chrData._height; y++) { for (int x = 0; x < chrData._width; x++) { @@ -81,7 +83,9 @@ void Font::drawChar(Graphics::Surface *dst, uint32 chr, int posX, int posY, uint else if (d == 2) d = color; else if (d == 3) d = 0; if (d != 255) { - *(byte *)dst->getBasePtr(posX + x, posY + y) = d; + if (screenRect.contains(posX + x, posY + y)) { + *(byte *)dst->getBasePtr(posX + x, posY + y) = d; + } } } } -- cgit v1.2.3