VOYEUR: Fix extra flag parameters for getBoltGroup and freeBoltGroup

This commit is contained in:
Paul Gilbert committed 2013-12-15 15:08:25 -05:00
1 parent 2f3bb44f5e
commit 28ecf5ba53
5 files changed
+39 -27

No files matched your search

+17 -10
View File
@@ -242,7 +242,7 @@ BoltFile::~BoltFile() {
_state._curFd = NULL;
}
BoltGroup *BoltFile::getBoltGroup(uint32 id) {
BoltGroup *BoltFile::getBoltGroup(uint16 id, bool process) {
++_state._fromGroupFlag;
_state._curLibPtr = this;
_state._curGroupPtr = &_groups[(id >> 8) & 0xff];
@@ -255,7 +255,8 @@ BoltGroup *BoltFile::getBoltGroup(uint32 id) {
if (_state._curGroupPtr->_callInitGro)
initGro();
if ((id >> 8) != 0) {
if (process) {
// Pre-process the resources
id &= 0xff00;
for (int idx = 0; idx < _state._curGroupPtr->_count; ++idx, ++id) {
byte *member = getBoltMember(id);
@@ -272,7 +273,9 @@ BoltGroup *BoltFile::getBoltGroup(uint32 id) {
return _state._curGroupPtr;
}
void BoltFile::freeBoltGroup(uint32 id) {
void BoltFile::freeBoltGroup(uint16 id, bool freeEntries) {
// TODO: I currently ignore freeEntries flag, in favour of always
// freeing. Need to check whether this can really ever be false.
_state._curLibPtr = this;
_state._curGroupPtr = &_groups[(id >> 8) & 0xff];
@@ -691,9 +694,13 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src) {
_imgData = NULL;
int nbytes = _bounds.width() * _bounds.height();
if (_flags & 0x20) {
error("TODO: sInitPic flags&0x20");
} else if (_flags & 8) {
if (_flags & PICFLAG_20) {
if (_flags & (PICFLAG_80 | PICFLAG_40)) {
error("TODO: sInitPic");
} else {
error("TODO: sInitPic");
}
} else if (_flags & PICFLAG_8) {
int mode = 0;
if (_bounds.width() == 320) {
mode = 147;
@@ -724,15 +731,15 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src) {
}
// byte *imgData = _imgData;
if (_flags & 0x10) {
if (_flags & PICFLAG_10) {
// TODO: Figure out what it's doing. Looks like a direct clearing
// of the screen directly
} else {
// TODO: Figure out direct screen loading
}
} else {
if (_flags & 0x1000) {
if (!(_flags & 0x10))
if (_flags & PICFLAG_1000) {
if (!(_flags & PICFLAG_10))
nbytes = state._curMemberPtr->_size - 24;
int mask = (nbytes + 0x3FFF) >> 14;
@@ -753,7 +760,7 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src) {
}
}
if (_flags & 0x10) {
if (_flags & PICFLAG_10) {
_imgData = new byte[nbytes];
Common::fill(_imgData, _imgData + nbytes, 0);
} else {
+5 -2
View File
@@ -119,8 +119,8 @@ public:
BoltFile(const Common::String &filename, BoltFilesState &state);
virtual ~BoltFile();
BoltGroup *getBoltGroup(uint32 id);
void freeBoltGroup(uint32 id);
BoltGroup *getBoltGroup(uint16 id, bool process = true);
void freeBoltGroup(uint16 id, bool freeEntries = true);
void freeBoltMember(uint32 id);
byte *memberAddr(uint32 id);
byte *memberAddrOffset(uint32 id);
@@ -241,6 +241,9 @@ public:
/* bvoy.blt resource types */
enum PictureFlag { PICFLAG_8 = 8, PICFLAG_10 = 0x10, PICFLAG_20 = 0x20,
PICFLAG_40 = 0x40, PICFLAG_80 = 0x80, PICFLAG_1000 = 0x1000 };
class PictureResource: public DisplayResource {
public:
byte _select;
+6 -4
View File
@@ -421,7 +421,7 @@ void ThreadResource::parsePlayCommands() {
_vm->_eventsManager.incrementTime(1);
_vm->_eventsManager.incrementTime(1);
_vm->_bVoy->freeBoltGroup(0x17F00);
_vm->_bVoy->freeBoltGroup(0x7F00);
_vm->_voy._field478 = -17;
_vm->_eventsManager._videoComputerBut4 = -1;
_vm->_voy._field470 = 129;
@@ -459,7 +459,7 @@ void ThreadResource::parsePlayCommands() {
_vm->_playStamp1 = -1;
if (_vm->_eventsManager._videoDead != -1) {
_vm->_bVoy->freeBoltGroup(0x10E00);
_vm->_bVoy->freeBoltGroup(0xE00);
_vm->_eventsManager._videoDead = -1;
(*_vm->_graphicsManager._vPort)->_flags |= 8;
@@ -1434,8 +1434,9 @@ void ThreadResource::freeTheApt() {
}
void ThreadResource::doAptAnim(int mode) {
_vm->_bVoy->freeBoltGroup(0x10100);
_vm->_bVoy->freeBoltGroup(0x100, true);
// Figure out the resource to use
int id = 0;
switch (_vm->_voy._field472) {
case 140:
@@ -1479,6 +1480,7 @@ void ThreadResource::doAptAnim(int mode) {
if (mode)
id += 0x100;
// Do the display
if (_vm->_bVoy->getBoltGroup(id)) {
CMapResource *pal = _vm->_bVoy->boltEntry(id)._cMapResource;
pal->_steps = 1;
@@ -1497,7 +1499,7 @@ void ThreadResource::doAptAnim(int mode) {
_vm->_bVoy->freeBoltGroup(id);
}
_vm->_bVoy->getBoltGroup(0x10100);
_vm->_bVoy->getBoltGroup(0x100);
}
} // End of namespace Voyeur
+9 -9
View File
@@ -124,8 +124,8 @@ void VoyeurEngine::globalInitBolt() {
initBolt();
_filesManager.openBoltLib("bvoy.blt", _bVoy);
_bVoy->getBoltGroup(0x10000);
_bVoy->getBoltGroup(0x10100);
_bVoy->getBoltGroup(0x000);
_bVoy->getBoltGroup(0x100);
_graphicsManager._fontPtr = &_defaultFontInfo;
_graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource;
@@ -163,7 +163,7 @@ bool VoyeurEngine::doHeadTitle() {
_eventsManager.startMainClockInt();
// Show starting screen
// if (_bVoy->getBoltGroup(0x10500))
// if (_bVoy->getBoltGroup(0x500))
// showConversionScreen();
if (shouldQuit())
return false;
@@ -236,7 +236,7 @@ void VoyeurEngine::showConversionScreen() {
_eventsManager.delay(1);
_graphicsManager.screenReset();
_bVoy->freeBoltGroup(0x10500);
_bVoy->freeBoltGroup(0x500);
}
@@ -253,7 +253,7 @@ bool VoyeurEngine::doLock() {
int keyCount;
int key;
if (_bVoy->getBoltGroup(0x10700)) {
if (_bVoy->getBoltGroup(0x700)) {
lock.getSysDate();
lock.getThePassword();
@@ -416,7 +416,7 @@ bool VoyeurEngine::doLock() {
lock.saveThePassword();
_voy._field4386 = NULL;
_bVoy->freeBoltGroup(0x10700);
_bVoy->freeBoltGroup(0x700);
}
_eventsManager.mouseOff();
@@ -428,7 +428,7 @@ bool VoyeurEngine::doLock() {
}
void VoyeurEngine::showTitleScreen() {
if (_bVoy->getBoltGroup(0x10500)) {
if (_bVoy->getBoltGroup(0x500)) {
_graphicsManager._backgroundPage = _bVoy->getPictureResource(0x500);
(*_graphicsManager._vPort)->setupViewPort();
@@ -468,7 +468,7 @@ void VoyeurEngine::showTitleScreen() {
playRL2Video("a1100100.rl2");
_graphicsManager.screenReset();
_bVoy->freeBoltGroup(0x10500);
_bVoy->freeBoltGroup(0x500);
}
}
@@ -476,7 +476,7 @@ void VoyeurEngine::doOpening() {
/*
_graphicsManager.screenReset();
if (!_bVoy->getBoltGroup(0x10200))
if (!_bVoy->getBoltGroup(0x200, true))
return;
byte *frameTable = _bVoy->memberAddr(0x215);
+2 -2
View File
@@ -39,7 +39,7 @@ void VoyeurEngine::playStamp() {
_stampLibPtr = NULL;
_filesManager.openBoltLib("stampblt.blt", _stampLibPtr);
_stampLibPtr->getBoltGroup(0x10000);
_stampLibPtr->getBoltGroup(0);
_resolvePtr = &RESOLVE_TABLE[0];
initStamp();
@@ -210,7 +210,7 @@ void VoyeurEngine::playStamp() {
_voy._field4386 = 0;
closeStamp();
_stampLibPtr->freeBoltGroup(0x10000);
_stampLibPtr->freeBoltGroup(0);
delete _stampLibPtr;
}