aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/mhwanh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/prince/mhwanh.cpp')
-rw-r--r--engines/prince/mhwanh.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/engines/prince/mhwanh.cpp b/engines/prince/mhwanh.cpp
index 4240ed4097..92a6a900f5 100644
--- a/engines/prince/mhwanh.cpp
+++ b/engines/prince/mhwanh.cpp
@@ -29,45 +29,45 @@
namespace Prince {
MhwanhDecoder::MhwanhDecoder()
- : _surface(NULL), _palette(0), _paletteColorCount(0) {
+ : _surface(NULL), _palette(0), _paletteColorCount(0) {
}
MhwanhDecoder::~MhwanhDecoder() {
- destroy();
+ destroy();
}
void MhwanhDecoder::destroy() {
- if (_surface) {
- _surface->free();
- delete _surface; _surface = 0;
- }
+ if (_surface) {
+ _surface->free();
+ delete _surface; _surface = 0;
+ }
- delete [] _palette; _palette = 0;
- _paletteColorCount = 0;
+ delete [] _palette; _palette = 0;
+ _paletteColorCount = 0;
}
bool MhwanhDecoder::loadStream(Common::SeekableReadStream &stream) {
- destroy();
- _paletteColorCount = 256;
- stream.seek(0);
- stream.skip(0x20);
- // Read the palette
- _palette = new byte[_paletteColorCount * 3];
- for (uint16 i = 0; i < _paletteColorCount; i++) {
- _palette[i * 3 + 0] = stream.readByte();
- _palette[i * 3 + 1] = stream.readByte();
- _palette[i * 3 + 2] = stream.readByte();
- }
-
- _surface = new Graphics::Surface();
- _surface->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
- for (int h = 0; h < 480; ++h) {
- stream.read(_surface->getBasePtr(0, h), 640);
- }
-
- return true;
+ destroy();
+ _paletteColorCount = 256;
+ stream.seek(0);
+ stream.skip(0x20);
+ // Read the palette
+ _palette = new byte[_paletteColorCount * 3];
+ for (uint16 i = 0; i < _paletteColorCount; i++) {
+ _palette[i * 3 + 0] = stream.readByte();
+ _palette[i * 3 + 1] = stream.readByte();
+ _palette[i * 3 + 2] = stream.readByte();
+ }
+
+ _surface = new Graphics::Surface();
+ _surface->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
+ for (int h = 0; h < 480; ++h) {
+ stream.read(_surface->getBasePtr(0, h), 640);
+ }
+
+ return true;
}
}
-
+/* vim: set tabstop=4 noexpandtab: */