diff options
author | lukaslw | 2014-07-03 14:59:38 +0200 |
---|---|---|
committer | lukaslw | 2014-07-03 14:59:38 +0200 |
commit | a9a8eb0c98ee6402dc000c048188f79b99686add (patch) | |
tree | 31a1afd61ae2095bd5548504bef1810e3e9409a5 | |
parent | e853e44695d1d15898f3948a8cc8656e49b37d33 (diff) | |
download | scummvm-rg350-a9a8eb0c98ee6402dc000c048188f79b99686add.tar.gz scummvm-rg350-a9a8eb0c98ee6402dc000c048188f79b99686add.tar.bz2 scummvm-rg350-a9a8eb0c98ee6402dc000c048188f79b99686add.zip |
PRINCE: dialogDat loading
-rw-r--r-- | engines/prince/prince.cpp | 14 | ||||
-rw-r--r-- | engines/prince/prince.h | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 37c7ce46f6..b91155344b 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -117,6 +117,7 @@ PrinceEngine::~PrinceEngine() { delete _variaTxt; delete[] _talkTxt; delete[] _invTxt; + delete[] _dialogDat; delete _graph; delete _room; @@ -255,6 +256,17 @@ void PrinceEngine::init() { loadAllInv(); + Common::SeekableReadStream *dialogDatStream = SearchMan.createReadStreamForMember("dialog.dat"); + if (!dialogDatStream) { + error("Can't load dialogDatStream"); + return; + } + _dialogDatSize = dialogDatStream->size(); + _dialogDat = new byte[_dialogDatSize]; + dialogDatStream->read(_dialogDat, _dialogDatSize); + + delete dialogDatStream; + _optionsPic = new Graphics::Surface(); _optionsPic->create(_optionsWidth, _optionsHeight, Graphics::PixelFormat::createFormatCLUT8()); Common::Rect picRect(0, 0, _optionsWidth, _optionsHeight); @@ -2369,7 +2381,7 @@ void PrinceEngine::doTalkAnim(int animNumber, int slot, AnimType animType) { } } } else if (animType == kBackgroundAnimation) { - if (animNumber < _backAnimList.size()) { + if ((uint)animNumber < _backAnimList.size()) { int currAnim = _backAnimList[animNumber]._seq._currRelative; Anim &backAnim = _backAnimList[animNumber].backAnims[currAnim]; if (backAnim._animData != nullptr) { diff --git a/engines/prince/prince.h b/engines/prince/prince.h index d59e62a60e..165cc68c99 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -398,6 +398,9 @@ public: void inventoryRightMouseButton(); void dialogLeftMouseButton(int dialogSelected, const char *s); + uint32 _dialogDatSize; + byte *_dialogDat; + bool _dialogFlag; int _dialogWidth; int _dialogHeight; |