From 5e52b0a5d46e4c5b230cba7464301484d27804f7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 10 Mar 2012 13:50:27 -0500 Subject: MOHAWK: Split the graphics classes into their own files --- engines/mohawk/graphics.h | 195 +--------------------------------------------- 1 file changed, 2 insertions(+), 193 deletions(-) (limited to 'engines/mohawk/graphics.h') diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 8fa5d5f895..51d25db5d9 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -25,12 +25,11 @@ #include "mohawk/bitmap.h" -#include "common/file.h" #include "common/hashmap.h" -#include "graphics/pict.h" +#include "common/rect.h" namespace Graphics { -class JPEG; +struct Surface; } namespace Mohawk { @@ -103,196 +102,6 @@ private: Common::HashMap > _subImageCache; }; -#ifdef ENABLE_MYST - -class MystBitmap; -class MohawkEngine_Myst; - -enum RectState { - kRectEnabled, - kRectDisabled, - kRectUnreachable -}; - -class MystGraphics : public GraphicsManager { -public: - MystGraphics(MohawkEngine_Myst*); - ~MystGraphics(); - - void loadExternalPictureFile(uint16 stack); - void copyImageSectionToScreen(uint16 image, Common::Rect src, Common::Rect dest); - void copyImageSectionToBackBuffer(uint16 image, Common::Rect src, Common::Rect dest); - void copyImageToScreen(uint16 image, Common::Rect dest); - void copyImageToBackBuffer(uint16 image, Common::Rect dest); - void copyBackBufferToScreen(Common::Rect r); - void runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay); - void drawRect(Common::Rect rect, RectState state); - void drawLine(const Common::Point &p1, const Common::Point &p2, uint32 color); - void enableDrawingTimeSimulation(bool enable); - void fadeToBlack(); - void fadeFromBlack(); - -protected: - MohawkSurface *decodeImage(uint16 id); - MohawkEngine *getVM() { return (MohawkEngine *)_vm; } - void simulatePreviousDrawDelay(const Common::Rect &dest); - void copyBackBufferToScreenWithSaturation(int16 saturation); - -private: - MohawkEngine_Myst *_vm; - MystBitmap *_bmpDecoder; - Graphics::PictDecoder *_pictDecoder; - Graphics::JPEG *_jpegDecoder; - - struct PictureFile { - uint32 pictureCount; - struct PictureEntry { - uint32 offset; - uint32 size; - uint16 id; - uint16 type; - uint16 width; - uint16 height; - } *entries; - - Common::File picFile; - } _pictureFile; - - Graphics::Surface *_backBuffer; - Graphics::PixelFormat _pixelFormat; - Common::Rect _viewport; - - int _enableDrawingTimeSimulation; - uint32 _nextAllowedDrawTime; - static const uint _constantDrawDelay = 10; // ms - static const uint _proportionalDrawDelay = 500; // pixels per ms -}; - -#endif // ENABLE_MYST - -#ifdef ENABLE_RIVEN - -class MohawkEngine_Riven; - -class RivenGraphics : public GraphicsManager { -public: - RivenGraphics(MohawkEngine_Riven *vm); - ~RivenGraphics(); - - void copyImageToScreen(uint16, uint32, uint32, uint32, uint32); - void updateScreen(Common::Rect updateRect = Common::Rect(0, 0, 608, 392)); - bool _updatesEnabled; - Common::Array _activatedPLSTs; - void drawPLST(uint16 x); - void drawRect(Common::Rect rect, bool active); - void drawImageRect(uint16 id, Common::Rect srcRect, Common::Rect dstRect); - void drawExtrasImage(uint16 id, Common::Rect dstRect); - - // Water Effect - void scheduleWaterEffect(uint16); - void clearWaterEffects(); - bool runScheduledWaterEffects(); - - // Transitions - void scheduleTransition(uint16 id, Common::Rect rect = Common::Rect(0, 0, 608, 392)); - void runScheduledTransition(); - void fadeToBlack(); - void setTransitionSpeed(uint32 speed) { _transitionSpeed = speed; } - - // Inventory - void showInventory(); - void hideInventory(); - - // Credits - void beginCredits(); - void updateCredits(); - uint getCurCreditsImage() { return _creditsImage; } - -protected: - MohawkSurface *decodeImage(uint16 id); - MohawkEngine *getVM() { return (MohawkEngine *)_vm; } - -private: - MohawkEngine_Riven *_vm; - MohawkBitmap *_bitmapDecoder; - - // Water Effects - struct SFXERecord { - // Record values - uint16 frameCount; - Common::Rect rect; - uint16 speed; - Common::Array frameScripts; - - // Cur frame - uint16 curFrame; - uint32 lastFrameTime; - }; - Common::Array _waterEffects; - - // Transitions - int16 _scheduledTransition; - Common::Rect _transitionRect; - uint32 _transitionSpeed; - - // Inventory - void clearInventoryArea(); - void drawInventoryImage(uint16 id, const Common::Rect *rect); - bool _inventoryDrawn; - - // Screen Related - Graphics::Surface *_mainScreen; - bool _dirtyScreen; - Graphics::PixelFormat _pixelFormat; - void clearMainScreen(); - - // Credits - uint _creditsImage, _creditsPos; -}; - -#endif // ENABLE_RIVEN - -class LBGraphics : public GraphicsManager { -public: - LBGraphics(MohawkEngine_LivingBooks *vm, uint16 width, uint16 height); - ~LBGraphics(); - - void setPalette(uint16 id); - void copyOffsetAnimImageToScreen(uint16 image, int left = 0, int top = 0); - bool imageIsTransparentAt(uint16 image, bool useOffsets, int x, int y); - -protected: - MohawkSurface *decodeImage(uint16 id); - MohawkEngine *getVM() { return (MohawkEngine *)_vm; } - -private: - MohawkBitmap *_bmpDecoder; - MohawkEngine_LivingBooks *_vm; -}; - -#ifdef ENABLE_CSTIME - -class MohawkEngine_CSTime; - -class CSTimeGraphics : public GraphicsManager { -public: - CSTimeGraphics(MohawkEngine_CSTime *vm); - ~CSTimeGraphics(); - - void drawRect(Common::Rect rect, byte color); - -protected: - MohawkSurface *decodeImage(uint16 id); - Common::Array decodeImages(uint16 id); - MohawkEngine *getVM() { return (MohawkEngine *)_vm; } - -private: - MohawkBitmap *_bmpDecoder; - MohawkEngine_CSTime *_vm; -}; - -#endif - } // End of namespace Mohawk #endif -- cgit v1.2.3