From 950676bf4c8576f63db8dc21a0c89e06981378d5 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 20 Feb 2011 02:31:34 -0500 Subject: PEGASUS: Add my very WIP Pegasus Prime engine --- engines/pegasus/graphics.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 engines/pegasus/graphics.h (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h new file mode 100644 index 0000000000..c184172394 --- /dev/null +++ b/engines/pegasus/graphics.h @@ -0,0 +1,86 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef PEGASUS_GRAPHICS_H +#define PEGASUS_GRAPHICS_H + +#include "common/rect.h" +#include "common/str.h" +#include "common/system.h" +#include "graphics/pict.h" +#include "graphics/surface.h" + +#include "pegasus/pegasus.h" + +namespace Pegasus { + +enum { + // The main cursors + kMainCursor = 128, + kZoomInCursor = 129, + kZoomOutCursor = 130, + kPointingCursor = 131, + kInteractHand = 132, + kGrabbingHand = 133, + + // Reticles when using the Mars shuttle + kTargetingReticle1 = 900, + kTargetingReticle2 = 901 +}; + +enum { + kImageCacheSize = 10 +}; + +struct ImageCache { + Common::String filename; + Graphics::Surface *surface; + uint32 lastUsed; +}; + +class PegasusEngine; + +class GraphicsManager { +public: + GraphicsManager(PegasusEngine *vm); + ~GraphicsManager(); + + void drawPict(Common::String filename, int x, int y, bool updateScreen = true); + void drawPictTransparent(Common::String filename, int x, int y, uint32 transparency, bool updateScreen = true); + void setCursor(uint16 cursor); + uint32 getColor(byte r, byte g, byte b); + +private: + PegasusEngine *_vm; + Graphics::PictDecoder *_pictDecoder; + + Graphics::Surface *decodeImage(const Common::String &filename); + ImageCache _cache[kImageCacheSize]; + int getImageSlot(const Common::String &filename); +}; + +} // End of namespace Pegasus + +#endif -- cgit v1.2.3 From 3b2283daf850605ca897002afbafe44489c35473 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 21 Feb 2011 18:42:03 -0500 Subject: PEGASUS: Remove the rest of the svn keywords from the copyright --- engines/pegasus/graphics.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index c184172394..7607c626d5 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PEGASUS_GRAPHICS_H -- cgit v1.2.3 From 5a7ca3553ca480021c0992e83e9644eeeba2f724 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 8 Sep 2011 20:38:12 -0400 Subject: PEGASUS: Create separate Cursor class for cursors --- engines/pegasus/graphics.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 7607c626d5..41353735b1 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -33,20 +33,6 @@ namespace Pegasus { -enum { - // The main cursors - kMainCursor = 128, - kZoomInCursor = 129, - kZoomOutCursor = 130, - kPointingCursor = 131, - kInteractHand = 132, - kGrabbingHand = 133, - - // Reticles when using the Mars shuttle - kTargetingReticle1 = 900, - kTargetingReticle2 = 901 -}; - enum { kImageCacheSize = 10 }; @@ -66,7 +52,6 @@ public: void drawPict(Common::String filename, int x, int y, bool updateScreen = true); void drawPictTransparent(Common::String filename, int x, int y, uint32 transparency, bool updateScreen = true); - void setCursor(uint16 cursor); uint32 getColor(byte r, byte g, byte b); private: -- cgit v1.2.3 From bbda19ab8033d67d2f2ea72e2ddb9a0b925fa0ac Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 9 Sep 2011 14:02:23 -0400 Subject: PEGASUS: Add DisplayElement class and begin porting over the graphics API --- engines/pegasus/graphics.h | 66 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 41353735b1..6778adb323 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -4,6 +4,9 @@ * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * + * Additional copyright for this file: + * Copyright (C) 1995-1997 Presto Studios, Inc. + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -30,9 +33,55 @@ #include "graphics/surface.h" #include "pegasus/pegasus.h" +#include "pegasus/util.h" namespace Pegasus { +class DisplayElement : public IDObject { +friend class GraphicsManager; +public: + DisplayElement(const tDisplayElementID); + virtual ~DisplayElement(); + + void setDisplayOrder(const tDisplayOrder); + tDisplayOrder getDisplayOrder() const { return _elementOrder; } + + bool validToDraw(tDisplayOrder, tDisplayOrder); + + virtual void draw(const Common::Rect&) {} + bool isDisplaying() { return _elementIsDisplaying; } + virtual void startDisplaying(); + virtual void stopDisplaying(); + + virtual void show(); + virtual void hide(); + bool isVisible() { return _elementIsVisible; } + + // triggerRedraw only triggers a draw if the element is displaying and visible. + void triggerRedraw(); + void setTriggeredElement(DisplayElement *); + + virtual void setBounds(const tCoordType, const tCoordType, const tCoordType, const tCoordType); + virtual void setBounds(const Common::Rect&); + virtual void getBounds(Common::Rect&) const; + virtual void sizeElement(const tCoordType, const tCoordType); + virtual void moveElementTo(const tCoordType, const tCoordType); + virtual void moveElement(const tCoordType, const tCoordType); + virtual void getLocation(tCoordType&, tCoordType&) const; + virtual void getCenter(tCoordType&, tCoordType&) const; + virtual void centerElementAt(const tCoordType, const tCoordType); + +protected: + Common::Rect _bounds; + bool _elementIsVisible; + DisplayElement *_triggeredElement; + + // Used only by PegasusEngine + bool _elementIsDisplaying; + tDisplayOrder _elementOrder; + DisplayElement *_nextElement; +}; + enum { kImageCacheSize = 10 }; @@ -50,17 +99,30 @@ public: GraphicsManager(PegasusEngine *vm); ~GraphicsManager(); + // Older "temporary" API void drawPict(Common::String filename, int x, int y, bool updateScreen = true); void drawPictTransparent(Common::String filename, int x, int y, uint32 transparency, bool updateScreen = true); uint32 getColor(byte r, byte g, byte b); - + + // Newer "to-be-used" API + void addDisplayElement(DisplayElement *element); + void removeDisplayElement(DisplayElement *element); + void invalRect(const Common::Rect &rect); + tDisplayOrder getBackOfActiveLayer() const { return _backLayer; } + tDisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } private: PegasusEngine *_vm; - Graphics::PictDecoder *_pictDecoder; + // Older "temporary" API + Graphics::PictDecoder *_pictDecoder; Graphics::Surface *decodeImage(const Common::String &filename); ImageCache _cache[kImageCacheSize]; int getImageSlot(const Common::String &filename); + + // Newer "to-be-used" API + Common::Rect _dirtyRect; + tDisplayOrder _backLayer, _frontLayer; + DisplayElement *_firstDisplayElement, *_lastDisplayElement; }; } // End of namespace Pegasus -- cgit v1.2.3 From d3fde69770b5a3065fa3ae1da76e443d6d185147 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 10 Sep 2011 10:41:36 -0400 Subject: PEGASUS: Implement two of the primitive-based DisplayElements --- engines/pegasus/graphics.h | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 6778adb323..d8919e5b5c 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -37,51 +37,6 @@ namespace Pegasus { -class DisplayElement : public IDObject { -friend class GraphicsManager; -public: - DisplayElement(const tDisplayElementID); - virtual ~DisplayElement(); - - void setDisplayOrder(const tDisplayOrder); - tDisplayOrder getDisplayOrder() const { return _elementOrder; } - - bool validToDraw(tDisplayOrder, tDisplayOrder); - - virtual void draw(const Common::Rect&) {} - bool isDisplaying() { return _elementIsDisplaying; } - virtual void startDisplaying(); - virtual void stopDisplaying(); - - virtual void show(); - virtual void hide(); - bool isVisible() { return _elementIsVisible; } - - // triggerRedraw only triggers a draw if the element is displaying and visible. - void triggerRedraw(); - void setTriggeredElement(DisplayElement *); - - virtual void setBounds(const tCoordType, const tCoordType, const tCoordType, const tCoordType); - virtual void setBounds(const Common::Rect&); - virtual void getBounds(Common::Rect&) const; - virtual void sizeElement(const tCoordType, const tCoordType); - virtual void moveElementTo(const tCoordType, const tCoordType); - virtual void moveElement(const tCoordType, const tCoordType); - virtual void getLocation(tCoordType&, tCoordType&) const; - virtual void getCenter(tCoordType&, tCoordType&) const; - virtual void centerElementAt(const tCoordType, const tCoordType); - -protected: - Common::Rect _bounds; - bool _elementIsVisible; - DisplayElement *_triggeredElement; - - // Used only by PegasusEngine - bool _elementIsDisplaying; - tDisplayOrder _elementOrder; - DisplayElement *_nextElement; -}; - enum { kImageCacheSize = 10 }; @@ -92,6 +47,7 @@ struct ImageCache { uint32 lastUsed; }; +class DisplayElement; class PegasusEngine; class GraphicsManager { -- cgit v1.2.3 From dc0254c1ce10647f179a674e924d17a62640007f Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 15 Sep 2011 20:50:21 -0400 Subject: PEGASUS: Implement very basic screen updating (new API) --- engines/pegasus/graphics.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index d8919e5b5c..d4f9628fa1 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -66,6 +66,9 @@ public: void invalRect(const Common::Rect &rect); tDisplayOrder getBackOfActiveLayer() const { return _backLayer; } tDisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } + void updateDisplay(); + Graphics::Surface *getWorkArea() { return &_workArea; } + private: PegasusEngine *_vm; @@ -79,6 +82,7 @@ private: Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; + Graphics::Surface _workArea; }; } // End of namespace Pegasus -- cgit v1.2.3 From 802fb1a97b04a1b6613dd00b700fb0a42b3eaef7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 21 Sep 2011 21:33:33 -0400 Subject: PEGASUS: Add very simple mouse movement update checking --- engines/pegasus/graphics.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index d4f9628fa1..b72137bf1e 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -83,6 +83,7 @@ private: tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; Graphics::Surface _workArea; + Common::Point _lastMousePosition; }; } // End of namespace Pegasus -- cgit v1.2.3 From 5b23d33a29f501236b164ee7de3013ae41c289a0 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 21 Sep 2011 21:35:55 -0400 Subject: PEGASUS: Remove old graphics API --- engines/pegasus/graphics.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index b72137bf1e..ebaaeb2c6c 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -37,16 +37,6 @@ namespace Pegasus { -enum { - kImageCacheSize = 10 -}; - -struct ImageCache { - Common::String filename; - Graphics::Surface *surface; - uint32 lastUsed; -}; - class DisplayElement; class PegasusEngine; @@ -55,12 +45,6 @@ public: GraphicsManager(PegasusEngine *vm); ~GraphicsManager(); - // Older "temporary" API - void drawPict(Common::String filename, int x, int y, bool updateScreen = true); - void drawPictTransparent(Common::String filename, int x, int y, uint32 transparency, bool updateScreen = true); - uint32 getColor(byte r, byte g, byte b); - - // Newer "to-be-used" API void addDisplayElement(DisplayElement *element); void removeDisplayElement(DisplayElement *element); void invalRect(const Common::Rect &rect); @@ -72,13 +56,6 @@ public: private: PegasusEngine *_vm; - // Older "temporary" API - Graphics::PictDecoder *_pictDecoder; - Graphics::Surface *decodeImage(const Common::String &filename); - ImageCache _cache[kImageCacheSize]; - int getImageSlot(const Common::String &filename); - - // Newer "to-be-used" API Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; -- cgit v1.2.3 From 85e7d2d9a99a0b7663881c6b5e1ce066d2efc49c Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 26 Sep 2011 00:17:21 -0400 Subject: PEGASUS: Update the GraphicsManager a bit - Only update the screen if we drew something to it, not if a dirty rect was present. - Add ability to clear the screen. --- engines/pegasus/graphics.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index ebaaeb2c6c..90d0f33a73 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -52,10 +52,12 @@ public: tDisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } void updateDisplay(); Graphics::Surface *getWorkArea() { return &_workArea; } + void clearScreen(); private: PegasusEngine *_vm; + bool _modifiedScreen; Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; -- cgit v1.2.3 From 54dd0c266eb8f5fe0d067f2298e6964e1ab9032f Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 28 Sep 2011 14:25:55 -0400 Subject: PEGASUS: Import a bunch more code in preparation for actual gameplay --- engines/pegasus/graphics.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 90d0f33a73..fffa3a6292 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -53,6 +53,7 @@ public: void updateDisplay(); Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); + DisplayElement *findDisplayElement(const tDisplayElementID id); private: PegasusEngine *_vm; -- cgit v1.2.3 From c4c83e2346e9a281e84c423717c0fc23d402d698 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 29 Sep 2011 20:12:51 -0400 Subject: PEGASUS: Resolve some TODO's and cleanup --- engines/pegasus/graphics.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index fffa3a6292..874524304e 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -54,6 +54,8 @@ public: Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); + void doFadeOutSync(); + void doFadeInSync(); private: PegasusEngine *_vm; -- cgit v1.2.3 From 23c7b9f0dc93181a388fb577e26fb9505c8f852f Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 30 Sep 2011 01:14:11 -0400 Subject: PEGASUS: Introduce better cursor update code --- engines/pegasus/graphics.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 874524304e..7aeb3c9b38 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -37,10 +37,12 @@ namespace Pegasus { +class Cursor; class DisplayElement; class PegasusEngine; class GraphicsManager { +friend class Cursor; public: GraphicsManager(PegasusEngine *vm); ~GraphicsManager(); @@ -57,6 +59,9 @@ public: void doFadeOutSync(); void doFadeInSync(); +protected: + void markCursorAsDirty(); + private: PegasusEngine *_vm; @@ -65,7 +70,6 @@ private: tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; Graphics::Surface _workArea; - Common::Point _lastMousePosition; }; } // End of namespace Pegasus -- cgit v1.2.3 From 8c7ebc803383a87cf3199b12d5b3485b2685a873 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 2 Oct 2011 20:52:09 -0400 Subject: PEGASUS: Add the basic Caldoria neighborhood Does not include the end-of-game timers and sequence yet. It's currently hooked up to the full game, but does not go beyond the first frame of the wake-up sequence right now. --- engines/pegasus/graphics.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 7aeb3c9b38..e1b339843f 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -32,6 +32,7 @@ #include "graphics/pict.h" #include "graphics/surface.h" +#include "pegasus/constants.h" #include "pegasus/pegasus.h" #include "pegasus/util.h" @@ -56,8 +57,10 @@ public: Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); - void doFadeOutSync(); - void doFadeInSync(); + + // These default to black + void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); + void doFadeInSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); protected: void markCursorAsDirty(); -- cgit v1.2.3 From 0dada6e231460c9acd61fff03b97858d26424e75 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 16 Oct 2011 23:44:48 -0400 Subject: PEGASUS: Implement screen shaking Would be great to be able to use OSystem's stuff, but that only handles vertical shaking. --- engines/pegasus/graphics.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index e1b339843f..c68c2dec76 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -57,6 +57,7 @@ public: Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); + void shakeTheWorld(TimeValue time, TimeScale scale); // These default to black void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); @@ -73,6 +74,11 @@ private: tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; Graphics::Surface _workArea; + + // Shake Shake Shake! + static const int kMaxShakeOffsets = 17; + Common::Point _shakeOffsets[kMaxShakeOffsets]; + void newShakePoint(int32 index1, int32 index2, int32 maxRadius); }; } // End of namespace Pegasus -- cgit v1.2.3 From 4af1fe25af35ccd484e3ff4650cad74cf903e30b Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 18 Oct 2011 09:37:56 -0400 Subject: PEGASUS: Add our TGWorldSaver replacement The scoring on the death/pause screens are now shown --- engines/pegasus/graphics.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index c68c2dec76..18dfd3f262 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -54,6 +54,8 @@ public: tDisplayOrder getBackOfActiveLayer() const { return _backLayer; } tDisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } void updateDisplay(); + Graphics::Surface *getCurSurface() { return _curSurface; } + void setCurSurface(Graphics::Surface *surface) { _curSurface = surface; } Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); @@ -73,7 +75,7 @@ private: Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; - Graphics::Surface _workArea; + Graphics::Surface _workArea, *_curSurface; // Shake Shake Shake! static const int kMaxShakeOffsets = 17; -- cgit v1.2.3 From 59f7d432d11f7527a01e04be09c8afaef3d1cb1d Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 28 Oct 2011 01:43:05 -0400 Subject: PEGASUS: Implement dirty rect erase code (as used by the space chase) --- engines/pegasus/graphics.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 18dfd3f262..0e5de47d95 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -60,6 +60,8 @@ public: void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); void shakeTheWorld(TimeValue time, TimeScale scale); + void enableErase(); + void disableErase(); // These default to black void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); @@ -71,7 +73,7 @@ protected: private: PegasusEngine *_vm; - bool _modifiedScreen; + bool _modifiedScreen, _erase; Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; -- cgit v1.2.3 From 12efb47b536d2f663c9cde2739a1fd40599da669 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 16 Dec 2011 14:17:50 -0500 Subject: PEGASUS: Remove t prefix from typedefs Some other minor cleanup too --- engines/pegasus/graphics.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 0e5de47d95..7c5bd69a69 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -51,14 +51,14 @@ public: void addDisplayElement(DisplayElement *element); void removeDisplayElement(DisplayElement *element); void invalRect(const Common::Rect &rect); - tDisplayOrder getBackOfActiveLayer() const { return _backLayer; } - tDisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } + DisplayOrder getBackOfActiveLayer() const { return _backLayer; } + DisplayOrder getFrontOfActiveLayer() const { return _frontLayer; } void updateDisplay(); Graphics::Surface *getCurSurface() { return _curSurface; } void setCurSurface(Graphics::Surface *surface) { _curSurface = surface; } Graphics::Surface *getWorkArea() { return &_workArea; } void clearScreen(); - DisplayElement *findDisplayElement(const tDisplayElementID id); + DisplayElement *findDisplayElement(const DisplayElementID id); void shakeTheWorld(TimeValue time, TimeScale scale); void enableErase(); void disableErase(); @@ -75,7 +75,7 @@ private: bool _modifiedScreen, _erase; Common::Rect _dirtyRect; - tDisplayOrder _backLayer, _frontLayer; + DisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; Graphics::Surface _workArea, *_curSurface; -- cgit v1.2.3 From 3860f341365a59ff96ec41e61e3952be01915b40 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 5 Jul 2012 20:36:34 -0400 Subject: PEGASUS: Implement screen fading This does linear instead of gamma for speed and complexity reasons. --- engines/pegasus/graphics.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 502304409a..2d66cd9aaa 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -40,6 +40,7 @@ namespace Pegasus { class Cursor; class DisplayElement; class PegasusEngine; +class ScreenFader; class GraphicsManager { friend class Cursor; @@ -61,6 +62,8 @@ public: void shakeTheWorld(TimeValue time, TimeScale scale); void enableErase(); void disableErase(); + void enableUpdates(); + void disableUpdates(); // These default to black void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); @@ -82,6 +85,9 @@ private: static const int kMaxShakeOffsets = 17; Common::Point _shakeOffsets[kMaxShakeOffsets]; void newShakePoint(int32 index1, int32 index2, int32 maxRadius); + + bool _updatesEnabled; + ScreenFader *_screenFader; }; } // End of namespace Pegasus -- cgit v1.2.3 From b625df161248582f5f0eb6b011029922aa4c84f0 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 5 Jul 2012 20:41:01 -0400 Subject: PEGASUS: Cleanup doFadeOutSync/doFadeInSync calls --- engines/pegasus/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/pegasus/graphics.h') diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 2d66cd9aaa..799f996e16 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -66,8 +66,8 @@ public: void disableUpdates(); // These default to black - void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); - void doFadeInSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); + void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true); + void doFadeInSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true); protected: void markCursorAsDirty(); -- cgit v1.2.3