aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/mhwanh.cpp
diff options
context:
space:
mode:
authorKamil Zbróg2013-10-14 02:31:26 +0100
committerKamil Zbróg2013-10-14 02:31:26 +0100
commite63b902def40e38e9b5163894adad9017e4fe3cf (patch)
treede6dda5faf0a1751926195f9766114919ef74685 /engines/prince/mhwanh.cpp
parent30ad6df5fccbfcd1097d498e8dc01965e4e5cb2f (diff)
downloadscummvm-rg350-e63b902def40e38e9b5163894adad9017e4fe3cf.tar.gz
scummvm-rg350-e63b902def40e38e9b5163894adad9017e4fe3cf.tar.bz2
scummvm-rg350-e63b902def40e38e9b5163894adad9017e4fe3cf.zip
PRINCE: some opcodes in script added
Diffstat (limited to 'engines/prince/mhwanh.cpp')
-rw-r--r--engines/prince/mhwanh.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/prince/mhwanh.cpp b/engines/prince/mhwanh.cpp
index 0847220a70..4240ed4097 100644
--- a/engines/prince/mhwanh.cpp
+++ b/engines/prince/mhwanh.cpp
@@ -29,7 +29,7 @@
namespace Prince {
MhwanhDecoder::MhwanhDecoder()
- : _surface(0), _palette(0), _paletteColorCount(0) {
+ : _surface(NULL), _palette(0), _paletteColorCount(0) {
}
MhwanhDecoder::~MhwanhDecoder() {
@@ -39,7 +39,7 @@ MhwanhDecoder::~MhwanhDecoder() {
void MhwanhDecoder::destroy() {
if (_surface) {
_surface->free();
- _surface = 0;
+ delete _surface; _surface = 0;
}
delete [] _palette; _palette = 0;
@@ -47,6 +47,7 @@ void MhwanhDecoder::destroy() {
}
bool MhwanhDecoder::loadStream(Common::SeekableReadStream &stream) {
+ destroy();
_paletteColorCount = 256;
stream.seek(0);
stream.skip(0x20);
@@ -61,7 +62,7 @@ bool MhwanhDecoder::loadStream(Common::SeekableReadStream &stream) {
_surface = new Graphics::Surface();
_surface->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
for (int h = 0; h < 480; ++h) {
- stream.read(_surface->getBasePtr(0, h - 1), 640);
+ stream.read(_surface->getBasePtr(0, h), 640);
}
return true;