aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/window.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-03-08 08:45:21 +0000
committerTravis Howell2009-03-08 08:45:21 +0000
commit2620d6836c001f2f295cb6efd6beab78f5a3c50f (patch)
tree81d5055b74abfc7b0be105bee13b39e6505fce91 /engines/agos/window.cpp
parent7bfab75a0814d0655a2504bf4c461df0000da0e4 (diff)
downloadscummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.tar.gz
scummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.tar.bz2
scummvm-rg350-2620d6836c001f2f295cb6efd6beab78f5a3c50f.zip
Add initial support for Personal Nightmare.
Thanks to dreammaster for file decompression and icon decoding code. NOTE: setjmp/longjmp code will require conversion for portability. svn-id: r39216
Diffstat (limited to 'engines/agos/window.cpp')
-rw-r--r--engines/agos/window.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index 9f1fc33bf0..31215f1f7c 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -71,10 +71,12 @@ WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags,
// Characters are 6 pixels
if (getGameType() == GType_ELVIRA2)
window->textMaxLength = (window->width * 8 - 4) / 6;
+ else if (getGameType() == GType_PN)
+ window->textMaxLength = window->width * 8 / 6 + 1;
else
window->textMaxLength = window->width * 8 / 6;
- if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
+ if (getGameType() == GType_PN || getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
clearWindow(window);
if (getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformAmiga && window->fillColor == 225)
@@ -202,9 +204,9 @@ void AGOSEngine::restoreWindow(WindowBlock *window) {
_restoreWindow6 = 0;
}
- restoreBlock(window->y + window->height * 8, (window->x + window->width) * 8, window->y, window->x * 8);
+ restoreBlock(window->x * 8, window->y, (window->x + window->width) * 8, window->y + window->height * 8);
} else if (getGameType() == GType_SIMON1) {
- restoreBlock(window->y + window->height * 8 + ((window == _windowArray[2]) ? 1 : 0), (window->x + window->width) * 8, window->y, window->x * 8);
+ restoreBlock(window->x * 8, window->y, (window->x + window->width) * 8, window->y + window->height * 8 + ((window == _windowArray[2]) ? 1 : 0));
} else {
uint16 x = window->x;
uint16 w = window->width;
@@ -220,13 +222,13 @@ void AGOSEngine::restoreWindow(WindowBlock *window) {
}
}
- restoreBlock(window->y + window->height * 8, (x + w) * 8, window->y, x * 8);
+ restoreBlock(x * 8, window->y, (x + w) * 8, window->y + window->height * 8);
}
_lockWord &= ~0x8000;
}
-void AGOSEngine::restoreBlock(uint16 h, uint16 w, uint16 y, uint16 x) {
+void AGOSEngine::restoreBlock(uint16 x, uint16 y, uint16 w, uint16 h) {
byte *dst, *src;
uint i;
@@ -266,7 +268,7 @@ void AGOSEngine::setTextColor(uint color) {
}
void AGOSEngine::sendWindow(uint a) {
- if (_textWindow != _windowArray[0]) {
+ if (getGameType() == GType_PN || _textWindow != _windowArray[0]) {
if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
if (!(_textWindow->flags & 1)) {
haltAnimation();