[Scummvm-cvs-logs] SF.net SVN: scummvm: [23148] scummvm/trunk/engines/saga/actor.cpp
h00ligan at users.sourceforge.net
h00ligan at users.sourceforge.net
Fri Jun 16 20:42:20 CEST 2006
Revision: 23148
Author: h00ligan
Date: 2006-06-16 11:41:24 -0700 (Fri, 16 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23148&view=rev
Log Message:
-----------
fix bug id 1507216 "ITE: 15 second freeze in Prince's bedroom"
Modified Paths:
--------------
scummvm/trunk/engines/saga/actor.cpp
Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp 2006-06-16 13:16:11 UTC (rev 23147)
+++ scummvm/trunk/engines/saga/actor.cpp 2006-06-16 18:41:24 UTC (rev 23148)
@@ -1139,8 +1139,7 @@
if (_activeSpeech.slowModeCharIndex >= stringLength)
error("Wrong string index");
- warning("Slow string encountered");
- _activeSpeech.playingTime = stringLength * 1000 / 4;
+ _activeSpeech.playingTime = 1000 / 8;
} else {
sampleLength = _vm->_sndRes->getVoiceLength(_activeSpeech.sampleResourceId);
@@ -1793,20 +1792,20 @@
Point textPoint;
ActorData *actor;
int width, height;
- char oneChar[2];
- oneChar[1] = 0;
- const char *outputString;
+ int stringLength;
Surface *backBuffer;
+ char *outputString;
backBuffer = _vm->_gfx->getBackBuffer();
if (_activeSpeech.speechFlags & kSpeakSlow) {
- outputString = oneChar;
- oneChar[0] = _activeSpeech.strings[0][_activeSpeech.slowModeCharIndex];
+ stringLength = strlen(_activeSpeech.strings[0]);
+ outputString = (char*)calloc(stringLength + 1, 1);
+ strncpy(outputString, _activeSpeech.strings[0], _activeSpeech.slowModeCharIndex + 1);
} else {
- outputString = _activeSpeech.strings[0];
+ outputString = (char*)_activeSpeech.strings[0];
}
-
+
if (_activeSpeech.actorsCount > 1) {
height = _vm->_font->getHeight(kKnownFontScript);
width = _vm->_font->getStringWidth(kKnownFontScript, _activeSpeech.strings[0], 0, kFontNormal);
@@ -1818,13 +1817,16 @@
textPoint.x = clamp(10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);
textPoint.y = clamp(10, actor->_screenPosition.y - 58, _vm->_scene->getHeight() - 10 - height);
- _vm->_font->textDraw(kKnownFontScript, backBuffer, _activeSpeech.strings[0], textPoint,
+ _vm->_font->textDraw(kKnownFontScript, backBuffer, outputString, textPoint,
_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
}
} else {
- _vm->_font->textDrawRect(kKnownFontScript, backBuffer, _activeSpeech.strings[0], _activeSpeech.drawRect, _activeSpeech.speechColor[0],
+ _vm->_font->textDrawRect(kKnownFontScript, backBuffer, outputString, _activeSpeech.drawRect, _activeSpeech.speechColor[0],
_activeSpeech.outlineColor[0], _activeSpeech.getFontFlags(0));
}
+ if (_activeSpeech.speechFlags & kSpeakSlow) {
+ free(outputString);
+ }
}
bool Actor::followProtagonist(ActorData *actor) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list