PRINCE: getLightX, getLightY, getShadowScale fix
This commit is contained in:
parent
3751e7ba25
commit
05ef38f7d9
3 changed files with 23 additions and 5 deletions
|
@ -291,7 +291,7 @@ bool PrinceEngine::loadLocation(uint16 locationNr) {
|
|||
_mainHero->_lightX = _script->getLightX(_locationNr);
|
||||
_mainHero->_lightY = _script->getLightY(_locationNr);
|
||||
debug("lightX: %d", _mainHero->_lightX);
|
||||
debug("lightY: %d", _mainHero->_lightX);
|
||||
debug("lightY: %d", _mainHero->_lightY);
|
||||
_mainHero->setShadowScale(_script->getShadowScale(_locationNr));
|
||||
|
||||
_mobList.clear();
|
||||
|
|
|
@ -142,6 +142,24 @@ bool Script::loadFromStream(Common::SeekableReadStream &stream) {
|
|||
return true;
|
||||
}
|
||||
|
||||
int16 Script::getLightX(int locationNr) {
|
||||
Common::MemoryReadStream readS(_data, _dataSize);
|
||||
readS.seek(4*15 + locationNr*8);
|
||||
return readS.readSint16LE();
|
||||
}
|
||||
|
||||
int16 Script::getLightY(int locationNr) {
|
||||
Common::MemoryReadStream readS(_data, _dataSize);
|
||||
readS.seek(4*15 + locationNr*8 + 2);
|
||||
return readS.readSint16LE();
|
||||
}
|
||||
|
||||
int32 Script::getShadowScale(int locationNr) {
|
||||
Common::MemoryReadStream readS(_data, _dataSize);
|
||||
readS.seek(4*15 + locationNr*8 + 4);
|
||||
return readS.readSint32LE();
|
||||
}
|
||||
|
||||
InterpreterFlags::InterpreterFlags() {
|
||||
resetAllFlags();
|
||||
}
|
||||
|
|
|
@ -90,9 +90,9 @@ public:
|
|||
// Some magic numbers for now, data stored in header
|
||||
uint32 getRoomTableOffset() { return read<uint32>(0); }
|
||||
uint32 getStartGameOffset() { return read<uint32>(4); }
|
||||
int8 getLightX(int locationNr) { return read<int8>(4*15 + locationNr*8); }
|
||||
int8 getLightY(int locationNr) { return read<int8>(4*15 + locationNr*8 + 2); }
|
||||
uint16 getShadowScale(int locationNr) { return read<uint16>(4*15 + locationNr*8 + 4); }
|
||||
int16 getLightX(int locationNr);
|
||||
int16 getLightY(int locationNr);
|
||||
int32 getShadowScale(int locationNr);
|
||||
|
||||
const char *getString(uint32 offset) {
|
||||
return (const char *)(&_data[offset]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue