2016-05-02 20:58:55 +02:00
|
|
|
#ifndef GFX_H
|
|
|
|
#define GFX_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "dm/dm.h"
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
2016-05-05 18:11:11 +02:00
|
|
|
struct Frame;
|
2016-05-05 18:36:02 +02:00
|
|
|
enum Color {
|
2016-05-06 18:20:30 +02:00
|
|
|
kColorNoTransparency = 255,
|
|
|
|
kColorBlack = 0,
|
|
|
|
kColorDarkGary = 1,
|
|
|
|
kColorLightGray = 2,
|
|
|
|
kColorDarkBrown = 3,
|
|
|
|
kColorCyan = 4,
|
|
|
|
kColorLightBrown = 5,
|
|
|
|
kColorDarkGreen = 6,
|
|
|
|
kColorLightGreen = 7,
|
|
|
|
kColorRed = 8,
|
|
|
|
kColorGold = 9,
|
|
|
|
kColorFlesh = 10,
|
|
|
|
kColorYellow = 11,
|
|
|
|
kColorDarkestGray = 12,
|
|
|
|
kColorLightestGray = 13,
|
|
|
|
kColorBlue = 14,
|
|
|
|
kColorWhite = 15
|
2016-05-05 18:36:02 +02:00
|
|
|
};
|
2016-05-05 18:11:11 +02:00
|
|
|
|
2016-05-04 12:50:06 +02:00
|
|
|
enum dmPaletteEnum {
|
2016-05-06 18:20:30 +02:00
|
|
|
kPalSwoosh = 0,
|
|
|
|
kPalMousePointer = 1,
|
|
|
|
kPalCredits = 2,
|
|
|
|
kPalEntrance = 3,
|
|
|
|
kPalDungeonView0 = 4,
|
|
|
|
kPalDungeonView1 = 5,
|
|
|
|
kPalDungeonView2 = 6,
|
|
|
|
kPalDungeonView3 = 7,
|
|
|
|
kPalDungeonView4 = 8,
|
|
|
|
kPalDungeonView5 = 9,
|
2016-05-04 12:50:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-05-06 18:13:23 +02:00
|
|
|
|
|
|
|
|
2016-05-02 20:58:55 +02:00
|
|
|
class DisplayMan {
|
|
|
|
DMEngine *_vm;
|
2016-05-04 12:50:06 +02:00
|
|
|
dmPaletteEnum _currPalette;
|
2016-05-02 20:58:55 +02:00
|
|
|
uint16 _screenWidth;
|
|
|
|
uint16 _screenHeight;
|
|
|
|
byte *_vgaBuffer;
|
|
|
|
uint16 _itemCount;
|
2016-05-05 18:11:11 +02:00
|
|
|
uint32 *_packedItemPos;
|
|
|
|
byte *_packedBitmaps; // TODO: this doesn't not contaion graphics exclusively, will have to be moved
|
2016-05-03 17:55:04 +02:00
|
|
|
DisplayMan(const DisplayMan &other); // no implementation on purpose
|
2016-05-02 20:58:55 +02:00
|
|
|
void operator=(const DisplayMan &rhs); // no implementation on purpose
|
2016-05-05 18:11:11 +02:00
|
|
|
|
2016-05-06 18:13:23 +02:00
|
|
|
byte **_bitmaps;
|
|
|
|
byte *getCurrentVgaBuffer();
|
|
|
|
void loadIntoBitmap(uint16 index, byte *destBitmap);
|
2016-05-05 18:11:11 +02:00
|
|
|
void unpackGraphics();
|
2016-05-06 18:13:23 +02:00
|
|
|
void drawWallSetBitmap(byte *bitmap, Frame &f, uint16 srcWidth);
|
2016-05-02 20:58:55 +02:00
|
|
|
public:
|
|
|
|
DisplayMan(DMEngine *dmEngine);
|
|
|
|
~DisplayMan();
|
|
|
|
void setUpScreens(uint16 width, uint16 height);
|
|
|
|
void loadGraphics();
|
2016-05-04 12:50:06 +02:00
|
|
|
void loadPalette(dmPaletteEnum palette);
|
2016-05-06 18:13:23 +02:00
|
|
|
|
|
|
|
/// Gives the width of an IMG0 type item
|
|
|
|
uint16 width(uint16 index);
|
|
|
|
/// Gives the height of an IMG1 type item
|
|
|
|
uint16 height(uint16 index);
|
|
|
|
|
|
|
|
void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
|
|
|
|
byte *destBitmap, uint16 destWidth,
|
|
|
|
uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
|
2016-05-06 18:20:30 +02:00
|
|
|
Color transparent = kColorNoTransparency);
|
2016-05-06 18:13:23 +02:00
|
|
|
void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcHeight, byte *destBitmap, uint16 destWidth, uint16 destX = 0, uint16 destY = 0);
|
|
|
|
void blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
|
|
|
|
uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
|
2016-05-06 18:20:30 +02:00
|
|
|
Color transparent = kColorNoTransparency);
|
2016-05-06 18:13:23 +02:00
|
|
|
|
2016-05-05 22:18:51 +02:00
|
|
|
void flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height);
|
2016-05-06 18:13:23 +02:00
|
|
|
void flipBitmapVertical(byte *bitmap, uint16 width, uint16 height);
|
|
|
|
|
2016-05-05 22:18:51 +02:00
|
|
|
void clearBitmap(byte *bitmap, uint16 width, uint16 height, Color color);
|
2016-05-05 19:49:26 +02:00
|
|
|
void clearScreen(Color color);
|
2016-05-06 18:13:23 +02:00
|
|
|
void drawDungeon(direction dir, uint16 posX, uint16 posY);
|
|
|
|
void updateScreen();
|
2016-05-02 20:58:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|