[Scummvm-cvs-logs] scummvm master -> 3899532440d2d532fda60cc6fb8568e1e6d9eeb3
sev-
sev at scummvm.org
Fri Oct 10 14:53:03 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3899532440 PRINCE: Revert incorrect const'ness at printAt()
Commit: 3899532440d2d532fda60cc6fb8568e1e6d9eeb3
https://github.com/scummvm/scummvm/commit/3899532440d2d532fda60cc6fb8568e1e6d9eeb3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-10-10T14:52:10+02:00
Commit Message:
PRINCE: Revert incorrect const'ness at printAt()
Changed paths:
engines/prince/prince.cpp
engines/prince/prince.h
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 7aa4ef1..afa5f34 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 7143251b..0e5bf97 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);
More information about the Scummvm-git-logs
mailing list