scummvm/engines/adl/display.h

116 lines
2.9 KiB
C
Raw Normal View History

2016-02-26 22:32:06 +00:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef ADL_DISPLAY_H
#define ADL_DISPLAY_H
2016-09-03 13:19:37 +00:00
#include "common/types.h"
2016-02-26 22:32:06 +00:00
namespace Common {
class ReadStream;
class WriteStream;
2016-02-26 22:32:06 +00:00
class String;
2016-03-28 23:26:41 +00:00
struct Point;
2016-02-26 22:32:06 +00:00
}
namespace Graphics {
2016-03-28 23:26:41 +00:00
struct Surface;
2016-02-26 22:32:06 +00:00
}
namespace Adl {
2016-02-27 12:35:49 +00:00
2016-03-04 15:12:11 +00:00
#define DISPLAY_WIDTH 280
#define DISPLAY_HEIGHT 192
2017-02-27 21:40:36 +00:00
#define DISPLAY_PITCH (DISPLAY_WIDTH / 7)
#define DISPLAY_SIZE (DISPLAY_PITCH * DISPLAY_HEIGHT)
2016-03-14 14:39:19 +00:00
#define TEXT_WIDTH 40
#define TEXT_HEIGHT 24
2016-03-04 15:12:11 +00:00
2016-03-04 17:48:31 +00:00
enum DisplayMode {
DISPLAY_MODE_HIRES,
DISPLAY_MODE_TEXT,
DISPLAY_MODE_MIXED
};
2016-02-27 12:35:49 +00:00
#define APPLECHAR(C) ((char)((C) | 0x80))
2016-02-26 22:32:06 +00:00
class Display {
public:
Display();
~Display();
2016-03-04 15:12:11 +00:00
2016-03-04 19:06:16 +00:00
void setMode(DisplayMode mode);
void updateTextScreen();
void updateHiResScreen();
2016-03-04 15:12:11 +00:00
bool saveThumbnail(Common::WriteStream &out);
// Graphics
2017-02-27 21:40:36 +00:00
static void loadFrameBuffer(Common::ReadStream &stream, byte *dst);
2016-02-26 22:32:06 +00:00
void loadFrameBuffer(Common::ReadStream &stream);
void putPixel(const Common::Point &p, byte color);
void setPixelByte(const Common::Point &p, byte color);
2016-03-16 14:08:47 +00:00
void setPixelBit(const Common::Point &p, byte color);
void setPixelPalette(const Common::Point &p, byte color);
byte getPixelByte(const Common::Point &p) const;
2016-03-11 22:46:41 +00:00
bool getPixelBit(const Common::Point &p) const;
2016-02-26 22:32:06 +00:00
void clear(byte color);
2016-03-04 15:12:11 +00:00
// Text
2016-03-01 14:47:34 +00:00
void home();
void moveCursorTo(const Common::Point &pos);
void moveCursorForward();
void moveCursorBackward();
2016-03-14 14:39:19 +00:00
void printChar(char c);
2016-03-01 14:47:34 +00:00
void printString(const Common::String &str);
void printAsciiString(const Common::String &str);
2016-03-01 14:47:34 +00:00
void setCharAtCursor(byte c);
void showCursor(bool enable);
2016-02-26 22:32:06 +00:00
private:
2016-03-16 14:08:47 +00:00
void writeFrameBuffer(const Common::Point &p, byte color, byte mask);
2016-03-04 19:06:16 +00:00
void updateHiResSurface();
2016-03-04 21:35:12 +00:00
void showScanlines(bool enable);
2016-02-26 22:32:06 +00:00
2016-03-04 19:06:16 +00:00
void updateTextSurface();
2016-02-26 22:32:06 +00:00
void drawChar(byte c, int x, int y);
void createFont();
2016-03-01 14:47:34 +00:00
void scrollUp();
2016-03-04 17:48:31 +00:00
DisplayMode _mode;
2016-03-04 15:12:11 +00:00
2016-02-26 22:32:06 +00:00
byte *_frameBuf;
Graphics::Surface *_frameBufSurface;
2016-03-04 15:12:11 +00:00
bool _scanlines;
bool _monochrome;
byte *_textBuf;
2016-02-26 22:32:06 +00:00
Graphics::Surface *_textBufSurface;
Graphics::Surface *_font;
uint _cursorPos;
2016-03-01 14:47:34 +00:00
bool _showCursor;
uint32 _startMillis;
2016-02-26 22:32:06 +00:00
};
2016-03-28 23:26:41 +00:00
2016-02-26 22:32:06 +00:00
} // End of namespace Adl
#endif