aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/font.cpp
diff options
context:
space:
mode:
authorlukaslw2014-08-09 05:37:57 +0200
committerlukaslw2014-08-09 05:37:57 +0200
commitb97f726a3e79d11ca243ef48a8a6173d47366c7e (patch)
tree95cbbdef921a010ff47e5c26023ceff2cdbbed7c /engines/prince/font.cpp
parent886cf189c66a9fa59f0317a25ccc5db9d75bf59a (diff)
downloadscummvm-rg350-b97f726a3e79d11ca243ef48a8a6173d47366c7e.tar.gz
scummvm-rg350-b97f726a3e79d11ca243ef48a8a6173d47366c7e.tar.bz2
scummvm-rg350-b97f726a3e79d11ca243ef48a8a6173d47366c7e.zip
PRINCE: scrollCredits() implementation, showLogo() update
Diffstat (limited to 'engines/prince/font.cpp')
-rw-r--r--engines/prince/font.cpp6
1 files changed, 5 insertions, 1 deletions
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;
+ }
}
}
}