aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorVincent Bénony2016-01-06 16:20:23 +0100
committerVincent Bénony2016-01-06 16:20:23 +0100
commitefdb5679ce6304dbc854afbbc511e633d7513338 (patch)
treee680a240e5f6018fc3a4cce53b50060caa22a929 /engines/sci/graphics
parent4687ff6d6d2863cc95c8137543ecf9c39bc01723 (diff)
parentb72c02bad44749a1355acefdb198e36b2e772575 (diff)
downloadscummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.gz
scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.bz2
scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.zip
IOS: Merge branch 'master' into ios-fix
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/compare.cpp4
-rw-r--r--engines/sci/graphics/frameout.cpp6
-rw-r--r--engines/sci/graphics/text16.cpp9
-rw-r--r--engines/sci/graphics/view.cpp2
4 files changed, 9 insertions, 12 deletions
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 3c2285a470..716a366b7c 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -130,7 +130,7 @@ void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
#ifdef ENABLE_SCI32
if (view->isSci2Hires())
view->adjustToUpscaledCoordinates(y, x);
- else if (getSciVersion() == SCI_VERSION_2_1)
+ else if ((getSciVersion() >= SCI_VERSION_2_1_EARLY) && (getSciVersion() <= SCI_VERSION_2_1_LATE))
_coordAdjuster->fromScriptToDisplay(y, x);
#endif
@@ -140,7 +140,7 @@ void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
if (view->isSci2Hires()) {
view->adjustBackUpscaledCoordinates(celRect.top, celRect.left);
view->adjustBackUpscaledCoordinates(celRect.bottom, celRect.right);
- } else if (getSciVersion() == SCI_VERSION_2_1) {
+ } else if ((getSciVersion() >= SCI_VERSION_2_1_EARLY) && (getSciVersion() <= SCI_VERSION_2_1_LATE)) {
_coordAdjuster->fromDisplayToScript(celRect.top, celRect.left);
_coordAdjuster->fromDisplayToScript(celRect.bottom, celRect.right);
}
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index ccc362dc37..61aeb00ac3 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -23,7 +23,7 @@
#include "common/algorithm.h"
#include "common/events.h"
#include "common/keyboard.h"
-#include "common/list_intern.h"
+#include "common/list.h"
#include "common/str.h"
#include "common/system.h"
#include "common/textconsole.h"
@@ -727,7 +727,7 @@ void GfxFrameout::kernelFrameout() {
if (view && view->isSci2Hires()) {
view->adjustToUpscaledCoordinates(itemEntry->y, itemEntry->x);
view->adjustToUpscaledCoordinates(itemEntry->z, dummyX);
- } else if (getSciVersion() >= SCI_VERSION_2_1) {
+ } else if (getSciVersion() >= SCI_VERSION_2_1_EARLY) {
_coordAdjuster->fromScriptToDisplay(itemEntry->y, itemEntry->x);
_coordAdjuster->fromScriptToDisplay(itemEntry->z, dummyX);
}
@@ -782,7 +782,7 @@ void GfxFrameout::kernelFrameout() {
view->adjustBackUpscaledCoordinates(nsRect.top, nsRect.left);
view->adjustBackUpscaledCoordinates(nsRect.bottom, nsRect.right);
g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
- } else if (getSciVersion() >= SCI_VERSION_2_1 && _resMan->detectHires()) {
+ } else if (getSciVersion() >= SCI_VERSION_2_1_EARLY && _resMan->detectHires()) {
_coordAdjuster->fromDisplayToScript(nsRect.top, nsRect.left);
_coordAdjuster->fromDisplayToScript(nsRect.bottom, nsRect.right);
g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index 89c9be59f0..b0f2c52791 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -83,8 +83,7 @@ void GfxText16::ClearChar(int16 chr) {
}
// This internal function gets called as soon as a '|' is found in a text. It
-// will process the encountered code and set new font/set color. We only support
-// one-digit codes currently, don't know if multi-digit codes are possible.
+// will process the encountered code and set new font/set color.
// Returns textcode character count.
int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int16 orgPenColor, bool doingDrawing) {
const char *textCode = text;
@@ -99,10 +98,8 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1
// c -> sets textColor to current port pen color
// cX -> sets textColor to _textColors[X-1]
curCode = textCode[0];
- curCodeParm = textCode[1];
- if (Common::isDigit(curCodeParm)) {
- curCodeParm -= '0';
- } else {
+ curCodeParm = strtol(textCode+1, NULL, 10);
+ if (!Common::isDigit(textCode[1])) {
curCodeParm = -1;
}
switch (curCode) {
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index da61ecf4c3..2ee18b5c9a 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -356,7 +356,7 @@ void GfxView::initData(GuiResourceId resourceId) {
for (loopNo = 0; loopNo < _loopCount; loopNo++)
for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++)
_screen->adjustBackUpscaledCoordinates(_loop[loopNo].cel[celNo].scriptWidth, _loop[loopNo].cel[celNo].scriptHeight, _sci2ScaleRes);
- } else if (getSciVersion() == SCI_VERSION_2_1) {
+ } else if ((getSciVersion() >= SCI_VERSION_2_1_EARLY) && (getSciVersion() <= SCI_VERSION_2_1_LATE)) {
for (loopNo = 0; loopNo < _loopCount; loopNo++)
for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++)
_coordAdjuster->fromDisplayToScript(_loop[loopNo].cel[celNo].scriptHeight, _loop[loopNo].cel[celNo].scriptWidth);