ScummVM API documentation
gfx.h
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 modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (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, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef AWE_GRAPHICS_H
23#define AWE_GRAPHICS_H
24
25#include "graphics/surface.h"
26#include "awe/intern.h"
27
28namespace Awe {
29
30enum {
31 FMT_CLUT,
32 FMT_RGB555,
33 FMT_RGB,
34 FMT_RGBA,
35};
36
37enum {
38 FIXUP_PALETTE_NONE,
39 FIXUP_PALETTE_REDRAW, // redraw all primitives on setPal script call
40};
41
42enum {
43 COL_ALPHA = 0x10, // transparent pixel (OR'ed with 0x8)
44 COL_PAGE = 0x11, // buffer 0 pixel
45 COL_BMP = 0xFF, // bitmap in buffer 0 pixel
46};
47
48enum {
49 GRAPHICS_ORIGINAL,
50 GRAPHICS_SOFTWARE,
51 GRAPHICS_GL
52};
53
54enum {
55 ALPHA_COLOR_INDEX = 12, // 3DO uses 0x0010 (RGB555) as the blend color, using color #12 matches Amiga/DOS graphics better
56 GFX_W = 320,
57 GFX_H = 200
58};
59
60struct SystemStub;
61
62struct Gfx {
63 static const uint8 FONT[];
64 static bool _is1991; // draw graphics as in the original 1991 game release
65 static Graphics::PixelFormat _format;
66 static const uint16 SHAPES_MASK_OFFSET[];
67 static const int SHAPES_MASK_COUNT;
68 static const uint8 SHAPES_MASK_DATA[];
69
70 int _fixUpPalette = 0;
71
72 virtual ~Gfx() {};
73
74 virtual void init(int targetW, int targetH) {}
75 virtual void fini() {}
76
77 virtual void setFont(const uint8 *src, int w, int h) = 0;
78 virtual void setPalette(const Color *colors, int count) = 0;
79 virtual void setSpriteAtlas(const uint8 *src, int w, int h, int xSize, int ySize) = 0;
80 virtual void drawSprite(int buffer, int num, const Point *pt, uint8 color) = 0;
81 virtual void drawBitmap(int buffer, const uint8 *data, int w, int h, int fmt) = 0;
82 virtual void drawPoint(int buffer, uint8 color, const Point *pt) = 0;
83 virtual void drawQuadStrip(int buffer, uint8 color, const QuadStrip *qs) = 0;
84 virtual void drawStringChar(int buffer, uint8 color, char c, const Point *pt) = 0;
85 virtual void clearBuffer(int num, uint8 color) = 0;
86 virtual void copyBuffer(int dst, int src, int vscroll = 0) = 0;
87 virtual void drawBuffer(int num, SystemStub *) = 0;
88 virtual void drawRect(int num, uint8 color, const Point *pt, int w, int h) = 0;
89 virtual void drawBitmapOverlay(const Graphics::Surface &src, int fmt, SystemStub *stub) = 0;
90};
91
92Gfx *GraphicsSoft_create();
93
94} // namespace Awe
95
96#endif
Definition: intern.h:85
Definition: gfx.h:62
Definition: intern.h:65
Definition: intern.h:76
Definition: system_stub.h:58
Definition: pixelformat.h:138
Definition: surface.h:67