aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorFilippos Karapetis2017-03-22 04:07:33 +0200
committerFilippos Karapetis2017-03-22 04:07:33 +0200
commit728b23af2ad939e3da920a41b85730689a1aa71f (patch)
treecd083a2f12d5fb3371e9e7d50fb8bf451295d2ff /engines/fullpipe
parent93e93b56405cc395e723cd43e7ed0008173eab18 (diff)
downloadscummvm-rg350-728b23af2ad939e3da920a41b85730689a1aa71f.tar.gz
scummvm-rg350-728b23af2ad939e3da920a41b85730689a1aa71f.tar.bz2
scummvm-rg350-728b23af2ad939e3da920a41b85730689a1aa71f.zip
FULLPIPE: Change transCyrillic() to accept a Common::String
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/behavior.cpp12
-rw-r--r--engines/fullpipe/interaction.cpp2
-rw-r--r--engines/fullpipe/scene.cpp2
-rw-r--r--engines/fullpipe/stateloader.cpp2
-rw-r--r--engines/fullpipe/statics.cpp10
-rw-r--r--engines/fullpipe/utils.cpp5
-rw-r--r--engines/fullpipe/utils.h2
7 files changed, 18 insertions, 17 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index d0de11bd8c..80542afcb6 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -49,7 +49,7 @@ void BehaviorManager::clear() {
}
void BehaviorManager::initBehavior(Scene *sc, GameVar *var) {
- debugC(2, kDebugBehavior, "BehaviorManager::initBehavior(%d, %s)", sc->_sceneId, transCyrillic((byte *)var->_varName));
+ debugC(2, kDebugBehavior, "BehaviorManager::initBehavior(%d, %s)", sc->_sceneId, transCyrillic(var->_varName));
clear();
_scene = sc;
@@ -63,7 +63,7 @@ void BehaviorManager::initBehavior(Scene *sc, GameVar *var) {
debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. have Variable");
for (GameVar *subvar = behvar->_subVars; subvar; subvar = subvar->_nextVarObj) {
- debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. subVar %s", transCyrillic((byte *)subvar->_varName));
+ debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. subVar %s", transCyrillic(subvar->_varName));
if (!strcmp(subvar->_varName, "AMBIENT")) {
behinfo = new BehaviorInfo;
behinfo->initAmbientBehavior(subvar, sc);
@@ -151,7 +151,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *e
}
void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *bhe) {
- debugC(6, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
+ debugC(6, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic(ani->_objectName));
MessageQueue *mq = 0;
@@ -243,7 +243,7 @@ void BehaviorInfo::clear() {
}
void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
- debugC(4, kDebugBehavior, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
+ debugC(4, kDebugBehavior, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic(var->_varName));
clear();
_animsCount = 1;
@@ -267,8 +267,8 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
}
void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) {
- Common::String s((char *)transCyrillic((byte *)var->_varName));
- debugC(4, kDebugBehavior, "BehaviorInfo::initObjectBehavior(%s, %d, %s)", s.c_str(), sc->_sceneId, transCyrillic((byte *)ani->_objectName));
+ Common::String s((char *)transCyrillic(var->_varName));
+ debugC(4, kDebugBehavior, "BehaviorInfo::initObjectBehavior(%s, %d, %s)", s.c_str(), sc->_sceneId, transCyrillic(ani->_objectName));
clear();
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 8f6ec5dd72..84b8fbc3c5 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -128,7 +128,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
if (cinter->_messageQueue)
cinter->_messageQueue->calcDuration(subj);
- debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic((byte *)cinter->_actionName));
+ debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic(cinter->_actionName));
PicAniInfo aniInfo;
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 4e3678bfb4..f7a9458403 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -165,7 +165,7 @@ bool Scene::load(MfcArchive &file) {
_sceneId = file.readUint16LE();
_sceneName = file.readPascalString();
- debug(0, "scene: <%s> %d", transCyrillic((byte *)_sceneName), _sceneId);
+ debug(0, "scene: <%s> %d", transCyrillic(_sceneName), _sceneId);
int count = file.readUint16LE();
debugC(7, kDebugLoading, "scene.ani: %d", count);
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 86865f928a..fa663b27bc 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -467,7 +467,7 @@ bool GameVar::load(MfcArchive &file) {
for (int i = 0; i < file.getLevel(); i++)
debugCN(6, kDebugLoading, " ");
- debugCN(6, kDebugLoading, "<%s>: ", transCyrillic((byte *)_varName));
+ debugCN(6, kDebugLoading, "<%s>: ", transCyrillic(_varName));
switch (_varType) {
case 0:
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 25aef988b5..5dee183aff 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -605,7 +605,7 @@ void StaticANIObject::draw() {
Common::Point point;
Common::Rect rect;
- debugC(6, kDebugDrawing, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+ debugC(6, kDebugDrawing, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic(_objectName), _id, _ox, _oy);
if (_shadowsOn && g_fp->_currentScene && g_fp->_currentScene->_shadows
&& (getCurrDimensions(point)->x != 1 || getCurrDimensions(point)->y != 1)) {
@@ -665,7 +665,7 @@ void StaticANIObject::draw() {
}
void StaticANIObject::draw2() {
- debugC(6, kDebugDrawing, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+ debugC(6, kDebugDrawing, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic(_objectName), _id, _ox, _oy);
if ((_flags & 4) && (_flags & 0x10)) {
if (_movement) {
@@ -790,7 +790,7 @@ Common::Point *StaticANIObject::getSomeXY(Common::Point &p) {
void StaticANIObject::update(int counterdiff) {
int mqid;
- debugC(6, kDebugAnimation, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic((byte *)_objectName), _id, _ox, _oy, _flags);
+ debugC(6, kDebugAnimation, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic(_objectName), _id, _ox, _oy, _flags);
if (_flags & 2) {
_messageNum--;
@@ -1300,7 +1300,7 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
if (_flags & 0x80)
return false;
- debugC(4, kDebugAnimation, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic((byte *)_objectName), _id, _ox, _oy);
+ debugC(4, kDebugAnimation, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic(_objectName), _id, _ox, _oy);
if (_messageQueueId) {
updateGlobalMessageQueue(messageQueueId, _id);
@@ -1459,7 +1459,7 @@ bool Statics::load(MfcArchive &file) {
_staticsId = file.readUint16LE();
_staticsName = file.readPascalString();
- debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic((byte *)_staticsName.c_str()), _staticsId, _staticsId);
+ debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic(_staticsName), _staticsId, _staticsId);
_picture = new Picture();
_picture->load(file);
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index f58249c04e..d06354cb91 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -104,7 +104,7 @@ char *MfcArchive::readPascalString(bool twoByte) {
tmp = (char *)calloc(len + 1, 1);
read(tmp, len);
- debugC(9, kDebugLoading, "readPascalString: %d <%s>", len, transCyrillic((byte *)tmp));
+ debugC(9, kDebugLoading, "readPascalString: %d <%s>", len, transCyrillic(tmp));
return tmp;
}
@@ -498,7 +498,8 @@ char *genFileName(int superId, int sceneId, const char *ext) {
}
// Translates cp-1251..utf-8
-byte *transCyrillic(byte *s) {
+byte *transCyrillic(Common::String str) {
+ byte *s = (byte *)str.c_str();
static byte tmp[1024];
#ifndef WIN32
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index d2e069a6be..9630df6153 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -181,7 +181,7 @@ class DWordArray : public Common::Array<int32>, public CObject {
};
char *genFileName(int superId, int sceneId, const char *ext);
-byte *transCyrillic(byte *s);
+byte *transCyrillic(Common::String str);
} // End of namespace Fullpipe