diff options
author | Matthew Stewart | 2018-02-24 13:59:08 -0500 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | 2dd96e044f46aed90ed1b6dbc682bc01f43e438c (patch) | |
tree | b0baea094d31ed729989c316750834f6a75c355e /engines/startrek/graphics.h | |
parent | 8cd5441959108b890d1433e70376c6cc1dd3bdb5 (diff) | |
download | scummvm-rg350-2dd96e044f46aed90ed1b6dbc682bc01f43e438c.tar.gz scummvm-rg350-2dd96e044f46aed90ed1b6dbc682bc01f43e438c.tar.bz2 scummvm-rg350-2dd96e044f46aed90ed1b6dbc682bc01f43e438c.zip |
STARTREK: Begin implementation of showText.
Also started using SharedPtrs.
Diffstat (limited to 'engines/startrek/graphics.h')
-rwxr-xr-x | engines/startrek/graphics.h | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/engines/startrek/graphics.h b/engines/startrek/graphics.h index cefbf70e5f..ef146a2d7a 100755 --- a/engines/startrek/graphics.h +++ b/engines/startrek/graphics.h @@ -27,12 +27,16 @@ #define STARTREK_GRAPHICS_H #include "startrek/bitmap.h" -#include "startrek/startrek.h" #include "startrek/font.h" +#include "startrek/startrek.h" +#include "startrek/sprite.h" +#include "common/ptr.h" #include "common/rect.h" #include "common/stream.h" +using Common::SharedPtr; + namespace StarTrek { class Font; @@ -44,24 +48,11 @@ const int SCREEN_HEIGHT = 200; const int MAX_SPRITES = 32; +const int TEXTBOX_WIDTH = 26; -struct Sprite { - uint16 x,y; - uint16 drawPriority; - uint16 field6; - uint16 field8; - Bitmap *bitmap; - uint16 drawMode; - uint16 textColor; - uint16 bitmapChanged; - uint16 redrawCondition2; - uint16 redrawCondition3; - uint16 field16; - Common::Rect rectangle1; - Common::Rect clickRectangle; - Common::Rect rectangle2; - uint16 drawX,drawY; -}; + +class Graphics; +typedef Common::String (Graphics::*TextGetterFunc)(int, int, Common::String *); class Graphics { @@ -75,6 +66,8 @@ public: void loadPalette(const Common::String &paletteFile); void loadPri(const char *priFile); + SharedPtr<Bitmap> loadBitmap(Common::String basename); + void redrawScreen(); void drawSprite(const Sprite &sprite); void drawSprite(const Sprite &sprite, const Common::Rect &rect); @@ -102,6 +95,32 @@ private: Sprite *_sprites[MAX_SPRITES]; int _numSprites; + + Common::Point _mousePos; + Sprite _mouseSprite; + + + // text.cpp (TODO: separate class) +public: + int showText(TextGetterFunc textGetter, int var, int xoffset, int yoffset, int textColor, int argC, int maxTextLines, int arg10); + Common::String tmpFunction(int choiceIndex, int var, Common::String *speakerTextOutput); + SharedPtr<TextBitmap> initTextSprite(int *xoffsetPtr, int *yoffsetPtr, byte textColor, int numTextLines, bool withHeader, Sprite *sprite); + +private: + Common::String skipOverAudioPrompt(const Common::String &str); + int getNumLines(const Common::String &str); + Common::String readLineFormattedText(TextGetterFunc textGetter, int var, int choiceIndex, SharedPtr<TextBitmap> textBitmap, int numTextboxLines, int *numLines); + void loadTextButtons(Common::String mnuFilename, int xpos, int ypos); + void warpMousePosition(int x, int y); + + uint16 _textboxVar1; + uint32 _textboxVar2; + uint32 _textboxVar3; + uint16 _textboxVar4; + uint16 _textboxVar5; + uint16 _textboxVar6; + uint16 _textboxVar7; + bool _textboxHasMultipleChoices; }; } |