aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/graphics.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/adl/graphics.h')
-rw-r--r--engines/adl/graphics.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/engines/adl/graphics.h b/engines/adl/graphics.h
index c0d1780a33..38dc2b25aa 100644
--- a/engines/adl/graphics.h
+++ b/engines/adl/graphics.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef ADL_PICTURE_H
-#define ADL_PICTURE_H
+#ifndef ADL_GRAPHICS_H
+#define ADL_GRAPHICS_H
#include "common/rect.h"
@@ -33,40 +33,35 @@ namespace Adl {
class Display;
+// Used in hires1
class GraphicsMan {
public:
+ GraphicsMan(Display &display) : _bounds(280, 160), _display(display) { }
virtual ~GraphicsMan() { }
- virtual void drawPic(Common::SeekableReadStream &pic, const Common::Point &pos) = 0;
+
+ // Applesoft BASIC HLINE
+ void drawLine(const Common::Point &p1, const Common::Point &p2, byte color) const;
+ // Applesoft BASIC DRAW
+ void drawShape(Common::ReadStream &shape, Common::Point &pos, byte rotation = 0, byte scaling = 1, byte color = 0x7f) const;
+
+ virtual void drawPic(Common::SeekableReadStream &pic, const Common::Point &pos);
void clearScreen() const;
void putPixel(const Common::Point &p, byte color) const;
+ void setBounds(const Common::Rect &r) { _bounds = r; }
protected:
- GraphicsMan(Display &display) : _bounds(280, 160), _display(display) { }
- void drawLine(const Common::Point &p1, const Common::Point &p2, byte color) const;
-
Display &_display;
Common::Rect _bounds;
private:
- virtual byte getClearColor() const = 0;
-};
-
-// Used in hires1
-class Graphics_v1 : public GraphicsMan {
-public:
- Graphics_v1(Display &display) : GraphicsMan(display) { }
- void drawPic(Common::SeekableReadStream &pic, const Common::Point &pos);
- void drawCorners(Common::ReadStream &corners, const Common::Point &pos, byte rotation = 0, byte scaling = 1, byte color = 0x7f) const;
-
-private:
- void drawCornerPixel(Common::Point &p, byte color, byte bits, byte quadrant) const;
- byte getClearColor() const { return 0x00; }
+ void drawShapePixel(Common::Point &p, byte color, byte bits, byte quadrant) const;
+ virtual byte getClearColor() const { return 0x00; }
};
// Used in hires0 and hires2-hires4
-class Graphics_v2 : public GraphicsMan {
+class GraphicsMan_v2 : public GraphicsMan {
public:
- Graphics_v2(Display &display) : GraphicsMan(display), _color(0) { }
+ GraphicsMan_v2(Display &display) : GraphicsMan(display), _color(0) { }
void drawPic(Common::SeekableReadStream &pic, const Common::Point &pos);
protected:
@@ -87,9 +82,9 @@ private:
};
// Used in hires5, hires6 and gelfling (possibly others as well)
-class Graphics_v3 : public Graphics_v2 {
+class GraphicsMan_v3 : public GraphicsMan_v2 {
public:
- Graphics_v3(Display &display) : Graphics_v2(display) { }
+ GraphicsMan_v3(Display &display) : GraphicsMan_v2(display) { }
private:
void fillRowLeft(Common::Point p, const byte pattern, const bool stopBit);