From 454149c49d5897004c244f62b6325fc1b6c2829f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Dec 2019 14:00:02 +0200 Subject: STARTREK: Reduce usage of SharedPtr --- engines/startrek/startrek.h | 6 +++--- engines/startrek/textbox.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engines/startrek') 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); + 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 _textInputBitmapSkeleton; - SharedPtr _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) { +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(new Bitmap(width, height)); - _textInputBitmap = SharedPtr(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(_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 -- cgit v1.2.3