aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-10-10 14:52:10 +0200
committerEugene Sandulenko2014-10-10 14:52:10 +0200
commit3899532440d2d532fda60cc6fb8568e1e6d9eeb3 (patch)
tree27e30fc79b4e2b39dc53fa8c0f3e5f9839fad7ff
parent0afaf44409cb87c453d06dc728fe233f9a650810 (diff)
downloadscummvm-rg350-3899532440d2d532fda60cc6fb8568e1e6d9eeb3.tar.gz
scummvm-rg350-3899532440d2d532fda60cc6fb8568e1e6d9eeb3.tar.bz2
scummvm-rg350-3899532440d2d532fda60cc6fb8568e1e6d9eeb3.zip
PRINCE: Revert incorrect const'ness at printAt()
-rw-r--r--engines/prince/prince.cpp13
-rw-r--r--engines/prince/prince.h2
2 files changed, 6 insertions, 9 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 7aa4ef145d..afa5f34a95 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1125,21 +1125,18 @@ int PrinceEngine::checkMob(Graphics::Surface *screen, Common::Array<Mob> &mobLis
return mobNumber;
}
-void PrinceEngine::printAt(uint32 slot, uint8 color, const char *s, uint16 x, uint16 y) {
+void PrinceEngine::printAt(uint32 slot, uint8 color, char *s, uint16 x, uint16 y) {
debugC(1, DebugChannel::kEngine, "PrinceEngine::printAt slot %d, color %d, x %02d, y %02d, str %s", slot, color, x, y, s);
- char tmpStr[1024];
- strncpy(tmpStr, s, 1024);
-
if (getLanguage() == Common::DE_DEU)
- correctStringDEU(tmpStr);
+ correctStringDEU(s);
Text &text = _textSlots[slot];
- text._str = tmpStr;
+ text._str = s;
text._x = x;
text._y = y;
text._color = color;
- int lines = calcTextLines(tmpStr);
+ int lines = calcTextLines(s);
text._time = calcTextTime(lines);
}
@@ -2473,7 +2470,7 @@ void PrinceEngine::inventoryLeftMouseButton() {
int invObjExamEvent = _script->scanMobEvents(_invMobList[_selectedMob]._mask, _script->_scriptInfo.invObjExam);
if (invObjExamEvent == -1) {
// do_standard
- printAt(0, 216, _invMobList[_selectedMob]._examText.c_str(), kNormalWidth / 2, _invExamY);
+ printAt(0, 216, (char *)_invMobList[_selectedMob]._examText.c_str(), kNormalWidth / 2, _invExamY);
_interpreter->setCurrentString(_invMobList[_selectedMob]._mask + 70000);
setVoice(0, 28, 1);
playSample(28, 0);
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index 7143251b4f..0e5bf97dde 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -308,7 +308,7 @@ public:
virtual GUI::Debugger *getDebugger();
void changeCursor(uint16 curId);
- void printAt(uint32 slot, uint8 color, const char *s, uint16 x, uint16 y);
+ void printAt(uint32 slot, uint8 color, char *s, uint16 x, uint16 y);
int calcTextLines(const char *s);
int calcTextTime(int numberOfLines);
void correctStringDEU(char *s);