ScummVM API documentation
graphics.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/*
23 * This code is based on original Mortville Manor DOS source code
24 * Copyright (c) 1987-1989 Lankhor
25 */
26
27#ifndef MORTEVIELLE_GRAPHICS_H
28#define MORTEVIELLE_GRAPHICS_H
29
30#include "common/file.h"
31#include "common/list.h"
32#include "common/rect.h"
33#include "graphics/surface.h"
34
35namespace Mortevielle {
36class MortevielleEngine;
37
39private:
40 void setPalette(const int *palette, uint idx, uint size);
41
42public:
43 void setDefaultPalette();
44};
45
46#define FONT_WIDTH 8
47#define FONT_HEIGHT 6
48#define FONT_NUM_CHARS 121
49
51private:
52 int _xp, _yp;
53 int _xSize, _ySize;
54 int _lookupIndex, _lookupValue;
55 bool _nibbleFlag;
56 int _thickness;
57 int _yInc, _yEnd, _xInc, _xEnd;
58
59 byte nextNibble(const byte *&pSrc);
60 byte nextByte(const byte *&pSrc, const byte *&pLookup);
61
62 void majTtxTty();
63 int desanalyse(const byte *&pSrc);
64 void horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
65 void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
66 void decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
67 void diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
68 void nextDecompPtr(byte *&pDest);
69 void negXInc();
70 void negYInc();
71 bool TFP(int v);
72 void TF1(byte *&pDest, int &v);
73 void TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v);
74public:
75 // Specifies offset when drawing the image
76 Common::Point _offset;
77 // Transparency palette index
78 int _transparency;
79
81
82 void decode(const byte *pSrc);
83};
84
86private:
88
90 byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
91
92public:
94
95 Common::Point _textPos; // Original called xwhere/ywhere
96 void readFontData(Common::File &f, int dataSize);
97 Graphics::Surface lockArea(const Common::Rect &bounds);
98 void updateScreen();
99 void drawPicture(GfxSurface &surface, int x, int y);
100 void copyFrom(Graphics::Surface &src, int x, int y);
101 void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
102 void drawBox(int x, int y, int dx, int dy, int col);
103 void fillRect(int color, const Common::Rect &bounds);
104 void clearScreen();
105 void putxy(int x, int y) { _textPos = Common::Point(x, y); }
106 void drawString(const Common::String &l, int command);
107 int getStringWidth(const Common::String &s);
108 void drawLine(int x, int y, int xx, int yy, int coul);
109 void drawRectangle(int x, int y, int dx, int dy);
110
111 // TODO: Refactor code to remove this method, for increased performance
112 void setPixel(const Common::Point &pt, int palIndex);
113};
114
115} // End of namespace Mortevielle
116
117#endif
Definition: file.h:47
Definition: str.h:59
Definition: graphics.h:50
Definition: mortevielle.h:156
Definition: graphics.h:38
Definition: graphics.h:85
Definition: rect.h:144
Definition: rect.h:536
Definition: surface.h:67