From ace0e5e88f63f34dad94962c95f57f3ec42258ae Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Sat, 14 Jun 2014 15:18:24 +0700 Subject: ZVISION: Fix compilation errors with latest scummvm --- engines/zvision/graphics/render_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 668c8acc41..ca2e715e8a 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -23,8 +23,8 @@ #ifndef ZVISION_RENDER_MANAGER_H #define ZVISION_RENDER_MANAGER_H -#include "zvision/render_table.h" -#include "zvision/truetype_font.h" +#include "zvision/graphics/render_table.h" +#include "zvision/fonts/truetype_font.h" #include "common/rect.h" #include "common/hashmap.h" -- cgit v1.2.3 From b9103b8d19a5da396d217e8d9bcc5c1502b89837 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Sat, 12 Jul 2014 19:09:08 +0000 Subject: ZVISION: Implement functions for system messaging. --- engines/zvision/graphics/render_manager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index ca2e715e8a..b4c6c76a6e 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -233,6 +233,7 @@ public: void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, uint32 colorkey); uint16 createSubArea(const Common::Rect &area); + uint16 createSubArea(); void deleteSubArea(uint16 id); void deleteSubArea(uint16 id, int16 delay); void updateSubArea(uint16 id, const Common::String &txt); -- cgit v1.2.3 From 21d6fddab43ff4adbd8c8b3d10b110576c197108 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Wed, 27 Aug 2014 14:57:35 +0700 Subject: ZVISION: Added scaled blitter to bkg --- engines/zvision/graphics/render_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index b4c6c76a6e..24234e28e1 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -229,6 +229,8 @@ public: void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y, uint32 colorkey); void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y); void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y, uint32 colorkey); + void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect); + void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, uint32 colorkey); void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y); void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, uint32 colorkey); -- cgit v1.2.3 From cf63da941cf7b7162551f6d660f5dbbda3150239 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 10 Oct 2014 16:40:46 +0700 Subject: ZVISION: Action:region and visual effects implemented. --- engines/zvision/graphics/render_manager.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 24234e28e1..665a27bf64 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -31,6 +31,8 @@ #include "graphics/surface.h" +#include "effect.h" + class OSystem; @@ -68,6 +70,7 @@ private: // }; // typedef Common::HashMap subMap; + typedef Common::List effectsList; private: ZVision *_engine; @@ -93,6 +96,8 @@ private: Common::Rect _menuWndDirtyRect; + Graphics::Surface _effectWnd; + // A buffer the exact same size as the workingWindow // This buffer stores everything un-warped, then does a warp at the end of the frame @@ -151,6 +156,8 @@ private: /** Holds any 'leftover' milliseconds between frames */ //uint _accumulatedVelocityMilliseconds; + effectsList _effects; + public: void initialize(); @@ -267,6 +274,13 @@ public: */ void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination); void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination, bool transposed); + + void addEffect(Effect *_effect); + void deleteEffect(uint32 ID); + EffectMap *makeEffectMap(const Common::Point &xy, int16 depth, const Common::Rect &rect, int8 *minD, int8 *maxD); + EffectMap *makeEffectMap(const Graphics::Surface &surf, uint16 transp); + + Common::Rect bkgRectToScreen(const Common::Rect &src); }; } // End of namespace ZVision -- cgit v1.2.3 From 678f47f043fc5498daae5d4331e02d23a2186528 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Thu, 23 Oct 2014 17:09:58 +0700 Subject: ZVISION: Implement action:distort and distort sidefx node --- engines/zvision/graphics/render_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 665a27bf64..e0fc5c248c 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -281,6 +281,8 @@ public: EffectMap *makeEffectMap(const Graphics::Surface &surf, uint16 transp); Common::Rect bkgRectToScreen(const Common::Rect &src); + + void markDirty(); }; } // End of namespace ZVision -- cgit v1.2.3 From b8ef942f692d7354fed3fd889994c499db714ba7 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Sat, 8 Nov 2014 12:58:11 +0600 Subject: ZVISION: Implement action:dissolve --- engines/zvision/graphics/render_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index e0fc5c248c..ae24ce4f58 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -283,6 +283,8 @@ public: Common::Rect bkgRectToScreen(const Common::Rect &src); void markDirty(); + + void bkgFill(uint8 r, uint8 g, uint8 b); }; } // End of namespace ZVision -- cgit v1.2.3 From 7d92b44e09809f559db96ec029a6258d23d84fd0 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Wed, 12 Nov 2014 14:36:30 +0600 Subject: ZVISION: Nemesis and GI has difference in set_partial_screen color mask --- engines/zvision/graphics/render_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index ae24ce4f58..d34ecf8ce0 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -185,6 +185,8 @@ public: */ void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, uint32 colorkey); + void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, int16 keyX, int16 keyY); + /** * Sets the current background image to be used by the RenderManager and immediately * blits it to the screen. (It won't show up until the end of the frame) -- cgit v1.2.3 From 5b352da304931bafcfcddbe08461488335c7ad57 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Thu, 20 Nov 2014 14:48:24 +0600 Subject: ZVISION: More CamelCase and a bit of comments cleanup --- engines/zvision/graphics/render_manager.h | 120 ++++++++++++++++++++---------- 1 file changed, 81 insertions(+), 39 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index d34ecf8ce0..7723c3d0f3 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -54,21 +54,13 @@ public: private: struct oneSub { - Common::Rect _r; - Common::String _txt; + Common::Rect r; + Common::String txt; int16 timer; bool todelete; bool redraw; }; -// struct AlphaDataEntry { -// Graphics::Surface *data; -// uint16 alphaColor; -// uint16 destX; -// uint16 destY; -// uint16 width; -// uint16 height; -// }; -// + typedef Common::HashMap subMap; typedef Common::List effectsList; @@ -82,37 +74,25 @@ private: Common::Rect _wrkWndDirtyRect; + // A buffer for mutate image by tilt or panorama renderers Graphics::Surface _outWnd; - Common::Rect _outWndDirtyRect; - Common::Rect _bkgDirtyRect; + // A buffer for subtitles Graphics::Surface _subWnd; Common::Rect _subWndDirtyRect; + // A buffer for menu drawing Graphics::Surface _menuWnd; Common::Rect _menuWndDirtyRect; + // A buffer used for apply graphics effects Graphics::Surface _effectWnd; - // A buffer the exact same size as the workingWindow - // This buffer stores everything un-warped, then does a warp at the end of the frame - //Graphics::Surface _workingWindowBuffer; - // A buffer representing the entire screen. Any graphical updates are first done with this buffer - // before actually being blitted to the screen - //Graphics::Surface _backBuffer; - // A list of Alpha Entries that need to be blitted to the backbuffer - //AlphaEntryMap _alphaDataEntries; - - // A rectangle representing the portion of the working window where the pixels have been changed since last frame - //Common::Rect _workingWindowDirtyRect; - // A rectangle representing the portion of the backbuffer where the pixels have been changed since last frame - //Common::Rect _backBufferDirtyRect; - /** Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() */ const int _wrkWidth; /** Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() */ @@ -129,13 +109,16 @@ private: */ const Common::Rect _workingWindow; + // Recatangle for subtitles area Common::Rect _subWndRect; + // Recatangle for menu area Common::Rect _menuWndRect; /** Used to warp the background image */ RenderTable _renderTable; + // A buffer for background image Graphics::Surface _curBkg; /** The (x1,y1) coordinates of the subRectangle of the background that is currently displayed on the screen */ int16 _bkgOff; @@ -144,18 +127,13 @@ private: /** The height of the current background image */ uint16 _bkgHeight; + // Internal subtitles counter uint16 _subid; + // Subtitle list subMap _subsList; - /** - * The "velocity" at which the background image is panning. We actually store the inverse of velocity (ms/pixel instead of pixels/ms) - * because it allows you to accumulate whole pixels 'steps' instead of rounding pixels every frame - */ - //int _backgroundInverseVelocity; - /** Holds any 'leftover' milliseconds between frames */ - //uint _accumulatedVelocityMilliseconds; - + // Visual effects list effectsList _effects; public: @@ -178,13 +156,22 @@ public: /** * Blits the image or a portion of the image to the background. * - * @param fileName Name of the image file - * @param destinationX X position where the image should be put. Coords are in working window space, not screen space! - * @param destinationY Y position where the image should be put. Coords are in working window space, not screen space! + * @param fileName Name of the image file + * @param destX X position where the image should be put. Coords are in working window space, not screen space! + * @param destY Y position where the image should be put. Coords are in working window space, not screen space! * @param colorkey Transparent color */ void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, uint32 colorkey); + /** + * Blits the image or a portion of the image to the background. + * + * @param fileName Name of the image file + * @param destX X position where the image should be put. Coords are in working window space, not screen space! + * @param destY Y position where the image should be put. Coords are in working window space, not screen space! + * @param keyX X position of transparent color + * @param keyY Y position of transparent color + */ void renderImageToBackground(const Common::String &fileName, int16 destX, int16 destY, int16 keyX, int16 keyY); /** @@ -215,7 +202,10 @@ public: */ const Common::Point screenSpaceToImageSpace(const Common::Point &point); + // Return pointer of RenderTable object RenderTable *getRenderTable(); + + // Return current background offset uint32 getCurrentBackgroundOffset(); /** @@ -229,39 +219,64 @@ public: */ static Graphics::Surface *tranposeSurface(const Graphics::Surface *surface); + // Scale buffer (nearest) void scaleBuffer(const void *src, void *dst, uint32 srcWidth, uint32 srcHeight, byte bytesPerPixel, uint32 dstWidth, uint32 dstHeight); - + // Blitting surface-to-surface methods void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int x, int y); void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int _x, int _y, uint32 colorkey); void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y); void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y, uint32 colorkey); + + // Blitting surface-to-background methods void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y); void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y, uint32 colorkey); + + // Blitting surface-to-background methods with scale void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect); void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, uint32 colorkey); + + // Blitting surface-to-menu methods void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y); void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, uint32 colorkey); + // Subtitles methods + + // Create subtitle area and return ID uint16 createSubArea(const Common::Rect &area); uint16 createSubArea(); + + // Delete subtitle by ID void deleteSubArea(uint16 id); void deleteSubArea(uint16 id, int16 delay); + + // Update subtitle area void updateSubArea(uint16 id, const Common::String &txt); + + // Processing subtitles void processSubs(uint16 deltatime); + + // Return background size Common::Point getBkgSize(); + // Return portion of background as new surface Graphics::Surface *getBkgRect(Common::Rect &rect); + + // Load image into new surface Graphics::Surface *loadImage(const char *file); Graphics::Surface *loadImage(Common::String &file); Graphics::Surface *loadImage(const char *file, bool transposed); Graphics::Surface *loadImage(Common::String &file, bool transposed); + // Clear whole/area of menu surface void clearMenuSurface(); void clearMenuSurface(const Common::Rect &r); + + // Copy menu buffer to screen void renderMenuToScreen(); + // Copy needed portion of background surface to workingWindow surface void prepareBkg(); /** @@ -275,17 +290,44 @@ public: * @param destination A reference to the Surface to store the pixel data in */ void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination); + + /** + * Reads an image file pixel data into a Surface buffer. In the process + * it converts the pixel data from RGB 555 to RGB 565. Also, if the image + * is transposed, it will un-transpose the pixel data. The function will + * call destination::create() if the dimensions of destination do not match + * up with the dimensions of the image. + * + * @param fileName The name of a .tga file + * @param destination A reference to the Surface to store the pixel data in + * @param transposed Transpose flag + */ void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination, bool transposed); + // Add visual effect to effects list void addEffect(Effect *_effect); + + // Delete effect(s) by ID (ID equal to slot of action:region that create this effect) void deleteEffect(uint32 ID); + + // Create "mask" for effects - (color +/- depth) will be selected as not transparent. Like color selection + // xy - base color + // depth - +/- of base color + // rect - rectangle where select pixels + // minD - if not NULL will recieve real bottom border of depth + // maxD - if not NULL will recieve real top border of depth EffectMap *makeEffectMap(const Common::Point &xy, int16 depth, const Common::Rect &rect, int8 *minD, int8 *maxD); + + // Create "mask" for effects by simple transparent color EffectMap *makeEffectMap(const Graphics::Surface &surf, uint16 transp); + // Return background rectangle in screen coordinates Common::Rect bkgRectToScreen(const Common::Rect &src); + // Mark whole background surface as dirty void markDirty(); + // Fille background surface by color void bkgFill(uint8 r, uint8 g, uint8 b); }; -- cgit v1.2.3 From 2a4a6df5f2ae89132fd93d26b03599b6cc5c5fb7 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 3 Dec 2014 01:12:35 +0200 Subject: ZVISION: Remove superfluous spacing and reorder some includes --- engines/zvision/graphics/render_manager.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 7723c3d0f3..39809c65a4 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -33,7 +33,6 @@ #include "effect.h" - class OSystem; namespace Common { @@ -92,7 +91,6 @@ private: // A buffer used for apply graphics effects Graphics::Surface _effectWnd; - /** Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() */ const int _wrkWidth; /** Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() */ @@ -256,7 +254,6 @@ public: // Processing subtitles void processSubs(uint16 deltatime); - // Return background size Common::Point getBkgSize(); -- cgit v1.2.3 From f0ce0b498fe62fa97428ebcd36caa2ae883eb775 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 3 Dec 2014 02:29:08 +0200 Subject: ZVISION: Move the TruetypeFont class --- engines/zvision/graphics/render_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 39809c65a4..879a8643ce 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -24,7 +24,7 @@ #define ZVISION_RENDER_MANAGER_H #include "zvision/graphics/render_table.h" -#include "zvision/fonts/truetype_font.h" +#include "zvision/graphics/truetype_font.h" #include "common/rect.h" #include "common/hashmap.h" -- cgit v1.2.3 From acb172251aa7401f43308ebcac9f30bef3aa40f5 Mon Sep 17 00:00:00 2001 From: Adrian Astley Date: Fri, 19 Dec 2014 11:14:10 -0600 Subject: ZVISION: Large scale variable, function, and class renaming to improve code clarity --- engines/zvision/graphics/render_manager.h | 102 ++++++++++++++++-------------- 1 file changed, 53 insertions(+), 49 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 879a8643ce..29bbd8f411 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -52,7 +52,7 @@ public: ~RenderManager(); private: - struct oneSub { + struct OneSubtitle { Common::Rect r; Common::String txt; int16 timer; @@ -60,87 +60,91 @@ private: bool redraw; }; - typedef Common::HashMap subMap; - typedef Common::List effectsList; + typedef Common::HashMap SubtitleMap; + typedef Common::List EffectsList; private: ZVision *_engine; OSystem *_system; const Graphics::PixelFormat _pixelFormat; - // A buffer for blitting background image to working window - Graphics::Surface _wrkWnd; + /** + * A Rectangle centered inside the actual window. All in-game coordinates + * are given in this coordinate space. Also, all images are clipped to the + * edges of this Rectangle + */ + const Common::Rect _workingWindow; - Common::Rect _wrkWndDirtyRect; + // Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() + const int _workingWidth; + // Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() + const int _workingHeight; + // Center of the screen in the x direction + const int _screenCenterX; + // Center of the screen in the y direction + const int _screenCenterY; + + /** A buffer for background image that's being used to create the background */ + Graphics::Surface _currentBackgroundImage; + Common::Rect _backgroundDirtyRect; - // A buffer for mutate image by tilt or panorama renderers - Graphics::Surface _outWnd; + /** + * The x1 or y1 offset of the subRectangle of the background that is currently displayed on the screen + * It will be x1 if PANORAMA, or y1 if TILT + */ + int16 _backgroundOffset; + /** The width of the current background image */ + uint16 _backgroundWidth; + /** The height of the current background image */ + uint16 _backgroundHeight; - Common::Rect _bkgDirtyRect; + // A buffer that holds the portion of the background that is used to render the final image + // If it's a normal scene, the pixels will be blitted directly to the screen + // If it's a panorma / tilt scene, the pixels will be first warped to _warpedSceneSurface + Graphics::Surface _backgroundSurface; + Common::Rect _backgroundSurfaceDirtyRect; // A buffer for subtitles - Graphics::Surface _subWnd; + Graphics::Surface _subtitleSurface; + Common::Rect _subtitleSurfaceDirtyRect; - Common::Rect _subWndDirtyRect; + // Rectangle for subtitles area + Common::Rect _subtitleArea; // A buffer for menu drawing - Graphics::Surface _menuWnd; + Graphics::Surface _menuSurface; + Common::Rect _menuSurfaceDirtyRect; - Common::Rect _menuWndDirtyRect; + // Rectangle for menu area + Common::Rect _menuArea; // A buffer used for apply graphics effects - Graphics::Surface _effectWnd; + Graphics::Surface _effectSurface; - /** Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() */ - const int _wrkWidth; - /** Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() */ - const int _wrkHeight; - /** Center of the screen in the x direction */ - const int _screenCenterX; - /** Center of the screen in the y direction */ - const int _screenCenterY; - - /** - * A Rectangle centered inside the actual window. All in-game coordinates - * are given in this coordinate space. Also, all images are clipped to the - * edges of this Rectangle - */ - const Common::Rect _workingWindow; - - // Recatangle for subtitles area - Common::Rect _subWndRect; + // A buffer to store the result of the panorama / tilt warps + Graphics::Surface _warpedSceneSurface; - // Recatangle for menu area - Common::Rect _menuWndRect; /** Used to warp the background image */ RenderTable _renderTable; - // A buffer for background image - Graphics::Surface _curBkg; - /** The (x1,y1) coordinates of the subRectangle of the background that is currently displayed on the screen */ - int16 _bkgOff; - /** The width of the current background image */ - uint16 _bkgWidth; - /** The height of the current background image */ - uint16 _bkgHeight; - // Internal subtitles counter uint16 _subid; // Subtitle list - subMap _subsList; + SubtitleMap _subsList; // Visual effects list - effectsList _effects; + EffectsList _effects; + public: void initialize(); /** - * Renders the current state of the backbuffer to the screen + * Renders the scene to the screen */ - void renderBackbufferToScreen(); + void renderSceneToScreen(); /** * Blits the image or a portion of the image to the background. @@ -274,7 +278,7 @@ public: void renderMenuToScreen(); // Copy needed portion of background surface to workingWindow surface - void prepareBkg(); + void prepareBackground(); /** * Reads an image file pixel data into a Surface buffer. In the process @@ -319,7 +323,7 @@ public: EffectMap *makeEffectMap(const Graphics::Surface &surf, uint16 transp); // Return background rectangle in screen coordinates - Common::Rect bkgRectToScreen(const Common::Rect &src); + Common::Rect transformBackgroundSpaceRectToScreenSpace(const Common::Rect &src); // Mark whole background surface as dirty void markDirty(); -- cgit v1.2.3 From 15154641ac5ea674a4865d9478074cf1b1d8a36b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 23 Dec 2014 01:53:40 +0200 Subject: ZVISION: Move all of the text related code together --- engines/zvision/graphics/render_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 29bbd8f411..711c607c7b 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -24,7 +24,7 @@ #define ZVISION_RENDER_MANAGER_H #include "zvision/graphics/render_table.h" -#include "zvision/graphics/truetype_font.h" +#include "zvision/text/truetype_font.h" #include "common/rect.h" #include "common/hashmap.h" -- cgit v1.2.3 From de2c9ed5bf9e3d41ad52de8aa0ddf383efa6b24d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 24 Dec 2014 22:11:21 +0200 Subject: ZVISION: Disable unused code --- engines/zvision/graphics/render_manager.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 711c607c7b..c2dc169945 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -328,8 +328,10 @@ public: // Mark whole background surface as dirty void markDirty(); - // Fille background surface by color +#if 0 + // Fill background surface by color void bkgFill(uint8 r, uint8 g, uint8 b); +#endif }; } // End of namespace ZVision -- cgit v1.2.3 From 5f8418394b925adfc62ee6d180515157190a8cd9 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 24 Dec 2014 22:54:24 +0200 Subject: ZVISION: Set all the internal graphics operations to use RGB555 (2/2) This is the second part of the changes to make the engine use RGB555 internally again. This is done to simplify the rendering pipeline - the engine will use RGB555 internally, but will output to RGB565. The overall changes have been broken into two commits, with this commit finishing all the changes. This is needed, as the game uses RGB555 graphics internally, but its AVI animations (full screen and in-game) use RGB565 --- engines/zvision/graphics/render_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index c2dc169945..d67ae29a3a 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -146,6 +146,8 @@ public: */ void renderSceneToScreen(); + void copyToScreen(const Graphics::Surface &surface, Common::Rect &rect, int16 srcLeft, int16 srcTop); + /** * Blits the image or a portion of the image to the background. * -- cgit v1.2.3 From 5a72eea2bb102bafb6da112ea90ad1f4af11e1f2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 12:41:36 +0200 Subject: ZVISION: Move some event/rendering code out of the main engine code --- engines/zvision/graphics/render_manager.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index d67ae29a3a..dbaa8fdc50 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -48,7 +48,7 @@ namespace ZVision { class RenderManager { public: - RenderManager(ZVision *engine, uint32 windowWidth, uint32 windowHeight, const Common::Rect workingWindow, const Graphics::PixelFormat pixelFormat); + RenderManager(ZVision *engine, uint32 windowWidth, uint32 windowHeight, const Common::Rect workingWindow, const Graphics::PixelFormat pixelFormat, bool doubleFPS); ~RenderManager(); private: @@ -137,6 +137,7 @@ private: // Visual effects list EffectsList _effects; + bool _doubleFPS; public: void initialize(); @@ -334,6 +335,11 @@ public: // Fill background surface by color void bkgFill(uint8 r, uint8 g, uint8 b); #endif + + bool askQuestion(const Common::String &str); + void delayedMessage(const Common::String &str, uint16 milsecs); + void timedMessage(const Common::String &str, uint16 milsecs); + void showDebugMsg(const Common::String &msg, int16 delay = 3000); }; } // End of namespace ZVision -- cgit v1.2.3 From eea1ee445fcac7ecc53e31d258aac697d6b242f1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 13:14:24 +0200 Subject: ZVISION: Move more graphics code out of the main engine code --- engines/zvision/graphics/render_manager.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index dbaa8fdc50..30e51456e9 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -340,6 +340,10 @@ public: void delayedMessage(const Common::String &str, uint16 milsecs); void timedMessage(const Common::String &str, uint16 milsecs); void showDebugMsg(const Common::String &msg, int16 delay = 3000); + + void checkBorders(); + void rotateTo(int16 to, int16 time); + void updateRotation(); }; } // End of namespace ZVision -- cgit v1.2.3 From db37cfb1b04fb6d1fb21ef3bd3c0b90128bf4d89 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 22:30:32 +0200 Subject: ZVISION: Remove duplicate blitting code for images and animations --- engines/zvision/graphics/render_manager.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 30e51456e9..a7e49b7758 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -230,20 +230,15 @@ public: // Blitting surface-to-surface methods void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int x, int y); void blitSurfaceToSurface(const Graphics::Surface &src, const Common::Rect &_srcRect , Graphics::Surface &dst, int _x, int _y, uint32 colorkey); - void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y); - void blitSurfaceToSurface(const Graphics::Surface &src, Graphics::Surface &dst, int x, int y, uint32 colorkey); // Blitting surface-to-background methods - void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y); - void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y, uint32 colorkey); + void blitSurfaceToBkg(const Graphics::Surface &src, int x, int y, int32 colorkey = -1); // Blitting surface-to-background methods with scale - void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect); - void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, uint32 colorkey); + void blitSurfaceToBkgScaled(const Graphics::Surface &src, const Common::Rect &_dstRect, int32 colorkey = -1); // Blitting surface-to-menu methods - void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y); - void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, uint32 colorkey); + void blitSurfaceToMenu(const Graphics::Surface &src, int x, int y, int32 colorkey = -1); // Subtitles methods -- cgit v1.2.3 From a9701d04c17b6f565e5602f12546bfe7aa2848af Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 22:35:02 +0200 Subject: ZVISION: Remove duplicate image loading code --- engines/zvision/graphics/render_manager.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index a7e49b7758..d9a6c88896 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -263,10 +263,8 @@ public: Graphics::Surface *getBkgRect(Common::Rect &rect); // Load image into new surface - Graphics::Surface *loadImage(const char *file); - Graphics::Surface *loadImage(Common::String &file); - Graphics::Surface *loadImage(const char *file, bool transposed); - Graphics::Surface *loadImage(Common::String &file, bool transposed); + Graphics::Surface *loadImage(Common::String file); + Graphics::Surface *loadImage(Common::String file, bool transposed); // Clear whole/area of menu surface void clearMenuSurface(); -- cgit v1.2.3 From 68d3ebd57b0313e517032681a119b47956803e71 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Tue, 30 Dec 2014 01:10:36 -0600 Subject: ZVISION: Rename some scripting classes to better represent what the classes are Also, rename the graphics 'Effect' class in order to avoid naming clashes (and/or coder confusion) with the newly named ScriptingEffect class. Lastly, add some documentation for the classes for further clarity. --- engines/zvision/graphics/render_manager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index d9a6c88896..9002d66b47 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -31,7 +31,7 @@ #include "graphics/surface.h" -#include "effect.h" +#include "graphics_effect.h" class OSystem; @@ -61,7 +61,7 @@ private: }; typedef Common::HashMap SubtitleMap; - typedef Common::List EffectsList; + typedef Common::List EffectsList; private: ZVision *_engine; @@ -302,7 +302,7 @@ public: void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination, bool transposed); // Add visual effect to effects list - void addEffect(Effect *_effect); + void addEffect(GraphicsEffect *_effect); // Delete effect(s) by ID (ID equal to slot of action:region that create this effect) void deleteEffect(uint32 ID); -- cgit v1.2.3 From 1f5736a9020796e6986a15ea4d3b627b81233241 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Tue, 30 Dec 2014 01:19:54 -0600 Subject: ZVISION: Update function documentation to represent the changes to the internal pixel format Aka: We keep everything as 555, and only convert to 565 before we send everything to the backend --- engines/zvision/graphics/render_manager.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 9002d66b47..c22f9a78c9 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -277,8 +277,7 @@ public: void prepareBackground(); /** - * Reads an image file pixel data into a Surface buffer. In the process - * it converts the pixel data from RGB 555 to RGB 565. Also, if the image + * Reads an image file pixel data into a Surface buffer. Also, if the image * is transposed, it will un-transpose the pixel data. The function will * call destination::create() if the dimensions of destination do not match * up with the dimensions of the image. @@ -289,8 +288,7 @@ public: void readImageToSurface(const Common::String &fileName, Graphics::Surface &destination); /** - * Reads an image file pixel data into a Surface buffer. In the process - * it converts the pixel data from RGB 555 to RGB 565. Also, if the image + * Reads an image file pixel data into a Surface buffer. Also, if the image * is transposed, it will un-transpose the pixel data. The function will * call destination::create() if the dimensions of destination do not match * up with the dimensions of the image. -- cgit v1.2.3 From 2d0075817ae6203063fb01f61b0828712e0259f0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 10 Jan 2015 01:37:39 +0200 Subject: ZVISION: Remove unused variable --- engines/zvision/graphics/render_manager.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index c22f9a78c9..6081e982f9 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -106,7 +106,6 @@ private: // A buffer for subtitles Graphics::Surface _subtitleSurface; - Common::Rect _subtitleSurfaceDirtyRect; // Rectangle for subtitles area Common::Rect _subtitleArea; -- cgit v1.2.3 From 899cf4813c7e009e1dbee56be8ad10d20650cf10 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 10 Jan 2015 21:32:15 +0200 Subject: ZVISION: Change screen resolution for the hires DVD videos to 800x600 Also, this hooks up the MPEG-PS decoder, but only if libmpeg2 is compiled in. The DVD videos are still disabled until AC3 audio support is implemented. The hires DVD videos are encoded a 720x480 resolution, with double the frame rate of the lowres ones (29.97FPS up from 15FPS) --- engines/zvision/graphics/render_manager.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index 6081e982f9..e3cbbc34ce 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -73,12 +73,8 @@ private: * are given in this coordinate space. Also, all images are clipped to the * edges of this Rectangle */ - const Common::Rect _workingWindow; + Common::Rect _workingWindow; - // Width of the working window. Saved to prevent extraneous calls to _workingWindow.width() - const int _workingWidth; - // Height of the working window. Saved to prevent extraneous calls to _workingWindow.height() - const int _workingHeight; // Center of the screen in the x direction const int _screenCenterX; // Center of the screen in the y direction @@ -241,6 +237,8 @@ public: // Subtitles methods + void initSubArea(uint32 windowWidth, uint32 windowHeight, const Common::Rect workingWindow); + // Create subtitle area and return ID uint16 createSubArea(const Common::Rect &area); uint16 createSubArea(); @@ -334,6 +332,8 @@ public: void checkBorders(); void rotateTo(int16 to, int16 time); void updateRotation(); + + void upscaleRect(Common::Rect &rect); }; } // End of namespace ZVision -- cgit v1.2.3 From 3f66f28624812910834600d8a2cecb084dedea9f Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 18 Jan 2015 20:32:55 +0100 Subject: ZVISION: Remove trailing whitespace --- engines/zvision/graphics/render_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/zvision/graphics/render_manager.h') diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h index e3cbbc34ce..33d8a88e78 100644 --- a/engines/zvision/graphics/render_manager.h +++ b/engines/zvision/graphics/render_manager.h @@ -84,7 +84,7 @@ private: Graphics::Surface _currentBackgroundImage; Common::Rect _backgroundDirtyRect; - /** + /** * The x1 or y1 offset of the subRectangle of the background that is currently displayed on the screen * It will be x1 if PANORAMA, or y1 if TILT */ @@ -133,7 +133,7 @@ private: EffectsList _effects; bool _doubleFPS; - + public: void initialize(); -- cgit v1.2.3