[Scummvm-cvs-logs] SF.net SVN: scummvm: [31821] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Fri May 2 17:21:51 CEST 2008
Revision: 31821
http://scummvm.svn.sourceforge.net/scummvm/?rev=31821&view=rev
Author: lordhoto
Date: 2008-05-02 08:21:51 -0700 (Fri, 02 May 2008)
Log Message:
-----------
- Renamed TextDisplayer_v2 to TextDisplayer_HoF
- Moved some character shape code to KyraEngine_v2
Modified Paths:
--------------
scummvm/trunk/engines/kyra/animator_mr.cpp
scummvm/trunk/engines/kyra/kyra_hof.cpp
scummvm/trunk/engines/kyra/kyra_mr.cpp
scummvm/trunk/engines/kyra/kyra_mr.h
scummvm/trunk/engines/kyra/kyra_v2.cpp
scummvm/trunk/engines/kyra/kyra_v2.h
scummvm/trunk/engines/kyra/saveload_hof.cpp
scummvm/trunk/engines/kyra/saveload_mr.cpp
scummvm/trunk/engines/kyra/scene_mr.cpp
scummvm/trunk/engines/kyra/script_hof.cpp
scummvm/trunk/engines/kyra/script_mr.cpp
scummvm/trunk/engines/kyra/sequences_mr.cpp
scummvm/trunk/engines/kyra/text_hof.cpp
scummvm/trunk/engines/kyra/text_hof.h
scummvm/trunk/engines/kyra/text_mr.cpp
Modified: scummvm/trunk/engines/kyra/animator_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/animator_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -422,7 +422,7 @@
};
char filename[14];
- snprintf(filename, 14, "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _malcolmShapes);
+ snprintf(filename, 14, "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _characterShapeFile);
if (_res->exists(filename))
runTemporaryScript(filename, 1, 1, 1, 1);
Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -192,7 +192,7 @@
_debugger = new Debugger_v2(this);
assert(_debugger);
- _text = new TextDisplayer_v2(this, _screen);
+ _text = new TextDisplayer_HoF(this, _screen);
assert(_text);
_gui = new GUI_v2(this);
assert(_gui);
@@ -355,8 +355,8 @@
initItemList(30);
loadButtonShapes();
resetItemList();
- _loadedZTable = 1;
- loadZShapes(_loadedZTable);
+ _characterShapeFile = 1;
+ loadCharacterShapes(_characterShapeFile);
initInventoryButtonList();
setupLangButtonShapes();
loadInventoryShapes();
@@ -1094,11 +1094,11 @@
_screen->_curPage = 0;
}
-void KyraEngine_HoF::loadZShapes(int shapes) {
+void KyraEngine_HoF::loadCharacterShapes(int shapes) {
char file[10];
strcpy(file, "_ZX.SHP");
- _loadedZTable = shapes;
+ _characterShapeFile = shapes;
file[2] = '0' + shapes;
uint8 *data = _res->fileData(file, 0);
@@ -1106,7 +1106,7 @@
addShapeToPool(data, i, i-9);
delete [] data;
- _loadedZTable = shapes;
+ _characterShapeFile = shapes;
}
void KyraEngine_HoF::loadInventoryShapes() {
@@ -1633,11 +1633,11 @@
zanthRandomIdleChat();
} else {
scriptAnimation = false;
- if (_loadedZTable > 8)
+ if (_characterShapeFile > 8)
return;
- int scriptMin = scriptMinTable[_loadedZTable-1];
- int scriptMax = scriptMaxTable[_loadedZTable-1];
+ int scriptMin = scriptMinTable[_characterShapeFile-1];
+ int scriptMax = scriptMaxTable[_characterShapeFile-1];
int script = 0;
if (scriptMin < scriptMax) {
Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -57,7 +57,6 @@
memset(_sceneShapes, 0, sizeof(_sceneShapes));
memset(_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
_gfxBackUpRect = 0;
- _malcolmShapes = 0;
_paletteOverlay = 0;
_sceneList = 0;
memset(&_mainCharacter, 0, sizeof(_mainCharacter));
@@ -597,7 +596,8 @@
musicUpdate(0);
loadExtrasShapes();
musicUpdate(0);
- loadMalcolmShapes(_malcolmShapes);
+ _characterShapeFile = 0;
+ loadCharacterShapes(_characterShapeFile);
musicUpdate(0);
initMainButtonList(true);
loadInterfaceShapes();
@@ -746,8 +746,8 @@
#pragma mark -
-void KyraEngine_MR::loadMalcolmShapes(int newShapes) {
- debugC(9, kDebugLevelMain, "KyraEngine_MR::loadMalcolmShapes(%d)", newShapes);
+void KyraEngine_MR::loadCharacterShapes(int newShapes) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCharacterShapes(%d)", newShapes);
static const uint8 numberOffset[] = { 3, 3, 4, 4, 3, 3 };
static const uint8 startShape[] = { 0x32, 0x58, 0x78, 0x98, 0xB8, 0xD8 };
static const uint8 endShape[] = { 0x57, 0x77, 0x97, 0xB7, 0xD7, 0xF7 };
@@ -788,17 +788,17 @@
}
}
- _malcolmShapes = newShapes;
+ _characterShapeFile = newShapes;
updateMalcolmShapes();
}
void KyraEngine_MR::updateMalcolmShapes() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::updateMalcolmShapes()");
- assert(_malcolmShapes >= 0 && _malcolmShapes < _shapeDescsSize);
- _malcolmShapeXOffset = _shapeDescs[_malcolmShapes].xOffset;
- _malcolmShapeYOffset = _shapeDescs[_malcolmShapes].yOffset;
- _animObjects[0].width = _shapeDescs[_malcolmShapes].width;
- _animObjects[0].height = _shapeDescs[_malcolmShapes].height;
+ assert(_characterShapeFile >= 0 && _characterShapeFile < _shapeDescsSize);
+ _malcolmShapeXOffset = _shapeDescs[_characterShapeFile].xOffset;
+ _malcolmShapeYOffset = _shapeDescs[_characterShapeFile].yOffset;
+ _animObjects[0].width = _shapeDescs[_characterShapeFile].width;
+ _animObjects[0].height = _shapeDescs[_characterShapeFile].height;
}
#pragma mark -
@@ -913,7 +913,7 @@
void KyraEngine_MR::updateCharPal(int unk1) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPal(%d)", unk1);
int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1) - 1;
- const uint8 *src = _costPalBuffer + _malcolmShapes * 72;
+ const uint8 *src = _costPalBuffer + _characterShapeFile * 72;
uint8 *dst = _screen->getPalette(0) + 432;
const int8 *sceneDatPal = &_sceneDatPalette[layer * 3];
@@ -1552,7 +1552,7 @@
memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
if (malcolmShapes >= 0)
- loadMalcolmShapes(malcolmShapes);
+ loadCharacterShapes(malcolmShapes);
enterNewScene(sceneId, facing, 0, 0, 0);
}
Modified: scummvm/trunk/engines/kyra/kyra_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.h 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/kyra_mr.h 2008-05-02 15:21:51 UTC (rev 31821)
@@ -299,8 +299,7 @@
// shapes
void initMouseShapes();
- int _malcolmShapes;
- void loadMalcolmShapes(int newShapes);
+ void loadCharacterShapes(int newShapes);
void updateMalcolmShapes();
int _malcolmShapeXOffset, _malcolmShapeYOffset;
Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -37,6 +37,8 @@
_itemList = 0;
_itemListSize = 0;
+
+ _characterShapeFile = -1;
}
KyraEngine_v2::~KyraEngine_v2() {
Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/kyra_v2.h 2008-05-02 15:21:51 UTC (rev 31821)
@@ -188,6 +188,9 @@
void addShapeToPool(const uint8 *data, int realIndex, int shape);
void addShapeToPool(uint8 *shpData, int index);
void remShapeFromPool(int idx);
+
+ int _characterShapeFile;
+ virtual void loadCharacterShapes(int shapes) = 0;
// pathfinder
int _movFacingTable[600];
Modified: scummvm/trunk/engines/kyra/saveload_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload_hof.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/saveload_hof.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -53,7 +53,7 @@
//out->writeUint16BE(word_2AB05);
out->writeSint16BE(_lastMusicCommand);
out->writeByte(_newChapterFile);
- out->writeByte(_loadedZTable);
+ out->writeByte(_characterShapeFile);
out->writeByte(_cauldronState);
out->writeByte(_colorCodeFlag1);
out->writeByte(_colorCodeFlag2);
@@ -152,7 +152,7 @@
_lastMusicCommand = -1;
}
- int loadedZTable = _loadedZTable;
+ int loadedZTable = _characterShapeFile;
Common::SeekableSubReadStreamEndian in(saveFile, saveFile->pos(), saveFile->size(), !header.originalSave, true);
@@ -172,7 +172,7 @@
in.readUint16();
_lastMusicCommand = in.readSint16();
_newChapterFile = in.readByte();
- _loadedZTable = in.readByte();
+ _characterShapeFile = in.readByte();
_cauldronState = in.readByte();
_colorCodeFlag1 = in.readByte();
_colorCodeFlag2 = in.readByte();
@@ -286,8 +286,8 @@
else
debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str());
- if (loadedZTable != _loadedZTable)
- loadZShapes(_loadedZTable);
+ if (loadedZTable != _characterShapeFile)
+ loadCharacterShapes(_characterShapeFile);
_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
if (!queryGameFlag(1))
Modified: scummvm/trunk/engines/kyra/saveload_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/saveload_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -48,7 +48,7 @@
out->writeSint16BE(_lastMusicCommand);
out->writeByte(_currentChapter);
- out->writeByte(_malcolmShapes);
+ out->writeByte(_characterShapeFile);
//XXX
out->writeSint16BE(_score);
out->writeSint16BE(_scoreMax);
@@ -142,7 +142,7 @@
if (!_unkSceneScreenFlag1)
_lastMusicCommand = -1;
- int curShapes = _malcolmShapes;
+ int curShapes = _characterShapeFile;
Common::SeekableSubReadStreamEndian in(saveFile, saveFile->pos(), saveFile->size(), !header.originalSave, true);
@@ -157,7 +157,7 @@
// usually we have to save the flag set by opcode 10 here
_lastMusicCommand = in.readSint16();
_currentChapter = in.readByte();
- _malcolmShapes = in.readByte();
+ _characterShapeFile = in.readByte();
//XXX
_score = in.readSint16();
_scoreMax = in.readSint16();
@@ -227,8 +227,8 @@
updateCharacterAnim(0);
_loadingState = false;
- if (curShapes != _malcolmShapes)
- loadMalcolmShapes(_malcolmShapes);
+ if (curShapes != _characterShapeFile)
+ loadCharacterShapes(_characterShapeFile);
_mainCharX = _mainCharacter.x2 = _mainCharacter.x1;
_mainCharY = _mainCharacter.y2 = _mainCharacter.y1;
Modified: scummvm/trunk/engines/kyra/scene_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/scene_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -350,7 +350,7 @@
_screen->generateOverlay(_screen->getPalette(2), _paletteOverlay, 0xF0, 0x19);
uint8 *palette = _screen->getPalette(2) + 432;
- const uint8 *costPal = _costPalBuffer + _malcolmShapes * 72;
+ const uint8 *costPal = _costPalBuffer + _characterShapeFile * 72;
memcpy(palette, costPal, 24*3);
}
Modified: scummvm/trunk/engines/kyra/script_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_hof.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/script_hof.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -677,7 +677,7 @@
int KyraEngine_HoF::o2_loadZShapes(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0));
- loadZShapes(stackPos(0));
+ loadCharacterShapes(stackPos(0));
return 0;
}
@@ -1318,7 +1318,7 @@
static const int zShapeList[] = { 1, 2, 2, 2, 4 };
assert(chapter > 1 && chapter <= ARRAYSIZE(zShapeList));
- loadZShapes(zShapeList[chapter-1]);
+ loadCharacterShapes(zShapeList[chapter-1]);
enterNewScene(scene, (chapter == 2) ? 2 : 0, 0, 0, 0);
Modified: scummvm/trunk/engines/kyra/script_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/script_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -37,7 +37,7 @@
int KyraEngine_MR::o3_getMalcolmShapes(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getMaloclmShapes(%p) ()", (const void *)script);
- return _malcolmShapes;
+ return _characterShapeFile;
}
int KyraEngine_MR::o3_setCharacterPos(EMCState *script) {
@@ -478,7 +478,7 @@
int KyraEngine_MR::o3_disguiseMalcolm(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_disguiseMalcolm(%p) (%d)", (const void *)script, stackPos(0));
- loadMalcolmShapes(stackPos(0));
+ loadCharacterShapes(stackPos(0));
updateDlgIndex();
return 0;
}
Modified: scummvm/trunk/engines/kyra/sequences_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/sequences_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -43,7 +43,7 @@
_badConscienceAnim = 6;
else if (_currentChapter == 5 && _rnd.getRandomNumberRng(1, 100) <= 25)
_badConscienceAnim = 7;
- else if (_malcolmShapes == 9)
+ else if (_characterShapeFile == 9)
_badConscienceAnim = 4;
_badConsciencePosition = (_mainCharacter.x1 <= 160);
@@ -250,7 +250,7 @@
setGameFlag(0x171);
- switch (_malcolmShapes-1) {
+ switch (_characterShapeFile-1) {
case 0:
runTemporaryScript("EELS01.EMC", 0, 0, 1, 1);
break;
Modified: scummvm/trunk/engines/kyra/text_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_hof.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/text_hof.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -32,19 +32,19 @@
namespace Kyra {
-TextDisplayer_v2::TextDisplayer_v2(KyraEngine_HoF *vm, Screen_v2 *screen)
+TextDisplayer_HoF::TextDisplayer_HoF(KyraEngine_HoF *vm, Screen_v2 *screen)
: TextDisplayer(vm, screen), _vm(vm) {
}
-void TextDisplayer_v2::backupTalkTextMessageBkgd(int srcPage, int dstPage) {
+void TextDisplayer_HoF::backupTalkTextMessageBkgd(int srcPage, int dstPage) {
_screen->copyRegion(_talkCoords.x, _talkMessageY, 0, 144, _talkCoords.w, _talkMessageH, srcPage, dstPage);
}
-void TextDisplayer_v2::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
+void TextDisplayer_HoF::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
_screen->copyRegion(0, 144, _talkCoords.x, _talkMessageY, _talkCoords.w, _talkMessageH, srcPage, dstPage);
}
-void TextDisplayer_v2::restoreScreen() {
+void TextDisplayer_HoF::restoreScreen() {
_vm->restorePage3();
_vm->drawAnimObjects();
_screen->hideMouse();
@@ -54,7 +54,7 @@
_vm->refreshAnimObjects(0);
}
-void TextDisplayer_v2::printCustomCharacterText(const char *text, int x, int y, uint8 c1, int srcPage, int dstPage) {
+void TextDisplayer_HoF::printCustomCharacterText(const char *text, int x, int y, uint8 c1, int srcPage, int dstPage) {
text = preprocessString(text);
int lineCount = buildMessageSubstrings(text);
int w = getWidestLineWidth(lineCount);
@@ -86,8 +86,8 @@
_screen->showMouse();
}
-char *TextDisplayer_v2::preprocessString(const char *str) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v2::preprocessString('%s')", str);
+char *TextDisplayer_HoF::preprocessString(const char *str) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_HoF::preprocessString('%s')", str);
if (str != _talkBuffer) {
assert(strlen(str) < sizeof(_talkBuffer) - 1);
@@ -129,8 +129,8 @@
return _talkBuffer;
}
-void TextDisplayer_v2::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v2::calcWidestLineBounds(%d, %d)", w, x);
+void TextDisplayer_HoF::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_HoF::calcWidestLineBounds(%d, %d)", w, x);
x1 = x;
x1 -= (w >> 1);
x2 = x1 + w + 1;
@@ -305,7 +305,7 @@
while (_emc->isValid(&_chatScriptState))
_emc->run(&_chatScriptState);
- _newShapeFilename[2] = _loadedZTable + '0';
+ _newShapeFilename[2] = _characterShapeFile + '0';
uint8 *shapeBuffer = _res->fileData(_newShapeFilename, 0);
if (shapeBuffer) {
int shapeCount = initNewShapes(shapeBuffer);
Modified: scummvm/trunk/engines/kyra/text_hof.h
===================================================================
--- scummvm/trunk/engines/kyra/text_hof.h 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/text_hof.h 2008-05-02 15:21:51 UTC (rev 31821)
@@ -33,10 +33,10 @@
class Screen_v2;
class KyraEngine_HoF;
-class TextDisplayer_v2 : public TextDisplayer {
+class TextDisplayer_HoF : public TextDisplayer {
friend class KyraEngine_HoF;
public:
- TextDisplayer_v2(KyraEngine_HoF *vm, Screen_v2 *screen);
+ TextDisplayer_HoF(KyraEngine_HoF *vm, Screen_v2 *screen);
void backupTalkTextMessageBkgd(int srcPage, int dstPage);
void restoreTalkTextMessageBkgd(int srcPage, int dstPage);
Modified: scummvm/trunk/engines/kyra/text_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_mr.cpp 2008-05-02 15:09:20 UTC (rev 31820)
+++ scummvm/trunk/engines/kyra/text_mr.cpp 2008-05-02 15:21:51 UTC (rev 31821)
@@ -576,11 +576,11 @@
static const uint8 dlgIndexMoodEvil[] = { 0x06, 0x08, 0x0A, 0x09, 0x0B };
if (_malcolmsMood == 0)
- dlgIndex = dlgIndexMoodNice[_malcolmShapes];
+ dlgIndex = dlgIndexMoodNice[_characterShapeFile];
else if (_malcolmsMood == 1)
- dlgIndex = dlgIndexMoodNormal[_malcolmShapes];
+ dlgIndex = dlgIndexMoodNormal[_characterShapeFile];
else if (_malcolmsMood == 2)
- dlgIndex = dlgIndexMoodEvil[_malcolmShapes];
+ dlgIndex = dlgIndexMoodEvil[_characterShapeFile];
} else if (_currentChapter == 2) {
if (dlgIndex >= 8)
dlgIndex -= 4;
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