diff options
author | Filippos Karapetis | 2019-12-27 14:00:02 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-12-27 16:54:57 +0200 |
commit | 454149c49d5897004c244f62b6325fc1b6c2829f (patch) | |
tree | b8dfae9de56f40e159eb14ba30208dc9acd31994 /engines | |
parent | 14a07a4871d27a9596e921c64034512c844d5566 (diff) | |
download | scummvm-rg350-454149c49d5897004c244f62b6325fc1b6c2829f.tar.gz scummvm-rg350-454149c49d5897004c244f62b6325fc1b6c2829f.tar.bz2 scummvm-rg350-454149c49d5897004c244f62b6325fc1b6c2829f.zip |
STARTREK: Reduce usage of SharedPtr
Diffstat (limited to 'engines')
-rw-r--r-- | engines/startrek/startrek.h | 6 | ||||
-rw-r--r-- | engines/startrek/textbox.cpp | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h index 5967283203..3ccdfb5641 100644 --- a/engines/startrek/startrek.h +++ b/engines/startrek/startrek.h @@ -477,7 +477,7 @@ public: * Draw a line of text to a standard bitmap (NOT a "TextBitmap", whose pixel array is * an array of characters, but an actual standard bitmap). */ - void drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap); + void drawTextLineToBitmap(const char *text, int textLen, int x, int y, Bitmap *bitmap); String centerTextboxHeader(String headerText); void getTextboxHeader(String *headerTextOutput, String speakerText, int choiceIndex); @@ -549,8 +549,8 @@ private: char _textInputBuffer[TEXT_INPUT_BUFFER_SIZE]; int16 _textInputCursorPos; char _textInputCursorChar; - SharedPtr<Bitmap> _textInputBitmapSkeleton; - SharedPtr<Bitmap> _textInputBitmap; + Bitmap *_textInputBitmapSkeleton; + Bitmap *_textInputBitmap; Sprite _textInputSprite; // menu.cpp diff --git a/engines/startrek/textbox.cpp b/engines/startrek/textbox.cpp index 007ab8f5af..4e5acfe6fa 100644 --- a/engines/startrek/textbox.cpp +++ b/engines/startrek/textbox.cpp @@ -80,7 +80,7 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput, return lastSpaceInput + 1; } -void StarTrekEngine::drawTextLineToBitmap(const char *text, int textLen, int x, int y, SharedPtr<Bitmap> bitmap) { +void StarTrekEngine::drawTextLineToBitmap(const char *text, int textLen, int x, int y, Bitmap *bitmap) { const int charWidth = 8; int textOffset = 0; @@ -850,8 +850,8 @@ void StarTrekEngine::initTextInputSprite(int16 textboxX, int16 textboxY, const C int16 width = headerLen * 8 + 8; int16 height = row * 8 + 8; - _textInputBitmapSkeleton = SharedPtr<Bitmap>(new Bitmap(width, height)); - _textInputBitmap = SharedPtr<Bitmap>(new Bitmap(width, height)); + _textInputBitmapSkeleton = new Bitmap(width, height); + _textInputBitmap = new Bitmap(width, height); _textInputBitmapSkeleton->xoffset = width / 2; if (textboxX + width / 2 >= SCREEN_WIDTH) @@ -908,7 +908,7 @@ void StarTrekEngine::initTextInputSprite(int16 textboxX, int16 textboxY, const C _gfx->addSprite(&_textInputSprite); _textInputSprite.drawMode = 2; _textInputSprite.field8 = "System"; - _textInputSprite.bitmap = _textInputBitmap; + _textInputSprite.bitmap = SharedPtr<Bitmap>(_textInputBitmap); _textInputSprite.setXYAndPriority(textboxX, textboxY, 15); _textInputSprite.drawPriority2 = 8; _gfx->drawAllSprites(); @@ -920,8 +920,8 @@ void StarTrekEngine::cleanupTextInputSprite() { _gfx->delSprite(&_textInputSprite); _textInputSprite.bitmap.reset(); - _textInputBitmapSkeleton.reset(); - _textInputBitmap.reset(); + delete _textInputBitmapSkeleton; + delete _textInputBitmap; } } // End of namespace StarTrek |