diff options
-rw-r--r-- | engines/startrek/bitmap.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/bitmap.h | 3 | ||||
-rwxr-xr-x | engines/startrek/graphics.cpp | 6 | ||||
-rwxr-xr-x | engines/startrek/graphics.h | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp index 43aee81487..61e5bcee03 100644 --- a/engines/startrek/bitmap.cpp +++ b/engines/startrek/bitmap.cpp @@ -24,7 +24,7 @@ namespace StarTrek { -Bitmap::Bitmap(Common::ReadStreamEndian *stream) { +Bitmap::Bitmap(SharedPtr<Common::ReadStreamEndian> stream) { xoffset = stream->readUint16(); yoffset = stream->readUint16(); width = stream->readUint16(); diff --git a/engines/startrek/bitmap.h b/engines/startrek/bitmap.h index d30aee1e79..7d3f2fdaf5 100644 --- a/engines/startrek/bitmap.h +++ b/engines/startrek/bitmap.h @@ -1,6 +1,7 @@ #ifndef STARTREK_BITMAP_H #define STARTREK_BITMAP_H +#include "common/ptr.h" #include "common/stream.h" namespace StarTrek { @@ -12,7 +13,7 @@ struct Bitmap { uint16 height; byte *pixels; - Bitmap(Common::ReadStreamEndian *stream); + Bitmap(Common::SharedPtr<Common::ReadStreamEndian> stream); Bitmap(int w, int h); ~Bitmap(); diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp index 66b1cf3d7c..41bc6f2231 100755 --- a/engines/startrek/graphics.cpp +++ b/engines/startrek/graphics.cpp @@ -46,11 +46,12 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) { if (_vm->getGameType() == GType_ST25 && _vm->getPlatform() == Common::kPlatformDOS) _font = new Font(_vm); - _backgroundImage = new Bitmap(_vm->openFile("DEMON0.BMP").get()); + _backgroundImage = loadBitmap("DEMON0"); _numSprites = 0; _textDisplayMode = TEXTDISPLAY_WAIT; + setMouseCursor(loadBitmap("pushbtn")); CursorMan.showMouse(true); } @@ -60,7 +61,6 @@ Graphics::~Graphics() { delete[] _lutData; delete _font; - delete _backgroundImage; } @@ -138,7 +138,7 @@ void Graphics::loadPri(const char *priFile) { } SharedPtr<Bitmap> Graphics::loadBitmap(Common::String basename) { - return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP").get())); + return SharedPtr<Bitmap>(new Bitmap(_vm->openFile(basename+".BMP"))); } Common::Point Graphics::getMousePos() { diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h index 9d2c59a6e1..b684ced05e 100755 --- a/engines/startrek/graphics.h +++ b/engines/startrek/graphics.h @@ -105,7 +105,7 @@ private: byte *_lutData; Common::Rect _screenRect; - Bitmap *_backgroundImage; + SharedPtr<Bitmap> _backgroundImage; Sprite *_sprites[MAX_SPRITES]; int _numSprites; |