1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef PRINCE_GRAPHICS_H 24 #define PRINCE_GRAPHICS_H 25 26 #include "graphics/surface.h" 27 28 namespace Prince { 29 30 class PrinceEngine; 31 class MhwanhDecoder; 32 struct DrawNode; 33 34 class GraphicsMan { 35 public: 36 GraphicsMan(PrinceEngine *vm); 37 ~GraphicsMan(); 38 39 void update(Graphics::Surface *screen); 40 41 void change(); 42 43 void setPalette(const byte *palette); 44 void makeShadowTable(int brightness, byte *shadowTable); 45 46 void draw(Graphics::Surface *screen, const Graphics::Surface *s); 47 void drawTransparentSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, int secondTransColor = 0); 48 void drawAsShadowSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, byte *shadowTable); 49 void drawTransparentWithBlendSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s); 50 51 static void drawTransparentDrawNode(Graphics::Surface *screen, DrawNode *drawNode); 52 static void drawTransparentWithTransDrawNode(Graphics::Surface *screen, DrawNode *drawNode); 53 static void drawAsShadowDrawNode(Graphics::Surface *screen, DrawNode *drawNode); 54 static void drawMaskDrawNode(Graphics::Surface *screen, DrawNode *drawNode); 55 static void drawBackSpriteDrawNode(Graphics::Surface *screen, DrawNode *drawNode); 56 57 byte getBlendTableColor(byte pixelColor, byte backgroundPixelColor, byte *blendTable); 58 59 Graphics::Surface *_frontScreen; 60 Graphics::Surface *_screenForInventory; 61 Graphics::Surface *_mapScreen; 62 const Graphics::Surface *_roomBackground; 63 64 byte *_shadowTable70; 65 byte *_shadowTable50; 66 67 static const byte kShadowColor = 191; 68 69 private: 70 PrinceEngine *_vm; 71 bool _changed; 72 }; 73 74 } // End of namespace Prince 75 76 #endif 77