From 077250acfb09afb67a445fad30aef6af2e2af014 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 10 Mar 2016 21:52:17 -0500 Subject: TSAGE: Changed engine to use Graphics::ManagedSurface --- engines/tsage/graphics.h | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'engines/tsage/graphics.h') diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 25f7aea8cd..3b395b7625 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -28,7 +28,7 @@ #include "common/list.h" #include "common/rect.h" #include "common/system.h" -#include "graphics/surface.h" +#include "graphics/managed_surface.h" namespace TsAGE { @@ -73,20 +73,13 @@ public: enum FrameFlag { FRAME_FLIP_CENTROID_X = 4, FRAME_FLIP_CENTROID_Y = 8 }; -class GfxSurface { +class GfxSurface: virtual public Graphics::ManagedSurface { private: - Graphics::Surface *_customSurface; int _lockSurfaceCtr; + Graphics::ManagedSurface _rawSurface; bool _disableUpdates; Rect _bounds; - - bool _trackDirtyRects; - Common::List _dirtyRects; - - void mergeDirtyRects(); - bool unionRectangle(Common::Rect &destRect, const Rect &src1, const Rect &src2); - public: Common::Point _centroid; int _transColor; @@ -95,17 +88,13 @@ public: public: GfxSurface(); GfxSurface(const GfxSurface &s); - ~GfxSurface(); + virtual ~GfxSurface(); - void setScreenSurface(); - void updateScreen(); - void addDirtyRect(const Rect &r); - Graphics::Surface lockSurface(); + Graphics::ManagedSurface &lockSurface(); void unlockSurface(); void synchronize(Serializer &s); - void create(int width, int height); - void clear(); - void setBounds(const Rect &bounds) { _bounds = bounds; } + virtual void create(uint16 width, uint16 height); + void setBounds(const Rect &bounds); const Rect &getBounds() const { return _bounds; } void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, @@ -119,10 +108,9 @@ public: copyFrom(src, tempRect, priorityRegion); } void draw(const Common::Point &pt, Rect *rect = NULL); - void fillRect(const Rect &bounds, int color); GfxSurface &operator=(const GfxSurface &s); - static void loadScreenSection(Graphics::Surface &dest, int xHalf, int yHalf, int xSection, int ySection); + static void loadScreenSection(Graphics::ManagedSurface &dest, int xHalf, int yHalf, int xSection, int ySection); static bool displayText(const Common::String &msg, const Common::Point &pt = Common::Point(160, 100)); }; @@ -281,7 +269,7 @@ public: void getStringBounds(const char *s, Rect &bounds, int maxWidth); void setDialogPalette(); - Graphics::Surface lockSurface() { + Graphics::ManagedSurface lockSurface() { _surface.setBounds(_bounds); return _surface.lockSurface(); } -- cgit v1.2.3