diff options
| author | lukaslw | 2014-05-01 16:40:12 +0200 | 
|---|---|---|
| committer | lukaslw | 2014-06-22 20:07:53 +0200 | 
| commit | 05ef38f7d9f912f8613d56764aa93c85e3365bbc (patch) | |
| tree | fab266f9242ecd6e53893be58f49fe976c90f5d2 | |
| parent | 3751e7ba25088b941eed55ee56e7a67593e32b8d (diff) | |
| download | scummvm-rg350-05ef38f7d9f912f8613d56764aa93c85e3365bbc.tar.gz scummvm-rg350-05ef38f7d9f912f8613d56764aa93c85e3365bbc.tar.bz2 scummvm-rg350-05ef38f7d9f912f8613d56764aa93c85e3365bbc.zip | |
PRINCE: getLightX, getLightY, getShadowScale fix
| -rw-r--r-- | engines/prince/prince.cpp | 2 | ||||
| -rw-r--r-- | engines/prince/script.cpp | 20 | ||||
| -rw-r--r-- | engines/prince/script.h | 6 | 
3 files changed, 23 insertions, 5 deletions
| diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 61d1ce5ef5..7bb51411f1 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -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(); diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 264d5bbae2..5070236c72 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -132,7 +132,7 @@ bool Script::loadFromStream(Common::SeekableReadStream &stream) {  		return false;  	stream.read(_data, _dataSize); -	 +  	Common::MemoryReadStream scriptDataStream(_data, _dataSize);  	scriptDataStream.seek(getRoomTableOffset()+64);  	debug("room table offset %d", scriptDataStream.pos()); @@ -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();  } diff --git a/engines/prince/script.h b/engines/prince/script.h index 2a3bb64245..4d3c822ad6 100644 --- a/engines/prince/script.h +++ b/engines/prince/script.h @@ -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]); | 
