summaryrefslogtreecommitdiff
path: root/include/shape.h
diff options
context:
space:
mode:
authorpixel <pixel>2003-04-13 17:03:09 +0000
committerpixel <pixel>2003-04-13 17:03:09 +0000
commitebc6bb16f895b7c192b9f4c42d1fc4feb41e271c (patch)
treec8d15fe476d561a22cd1f5803f89fe7727c7e6dd /include/shape.h
parent102649b120a762b760cf618d6a61bdabb910f945 (diff)
broken... but well... who cares...
Diffstat (limited to 'include/shape.h')
-rw-r--r--include/shape.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/shape.h b/include/shape.h
index b2e218d..756f7d0 100644
--- a/include/shape.h
+++ b/include/shape.h
@@ -1,6 +1,7 @@
#ifndef __SHAPE_H__
#define __SHAPE_H__
+#include <vector>
#include <Exceptions.h>
#include <BString.h>
#include <mcolor.h>
@@ -18,11 +19,18 @@ namespace mogltk {
virtual ~fillwalker();
virtual void step(int x, int y);
};
+ class segwalker : public Base {
+ public:
+ segwalker();
+ virtual ~segwalker();
+ virtual void step(int x1, int y1, int x2, int y2);
+ };
class fill : public Base {
public:
fill();
virtual ~fill();
void walk(fillwalker *);
+ void swalk(segwalker *);
void insert(int, int, int, int);
int GetMinX() const;
int GetMinY() const;
@@ -30,9 +38,14 @@ namespace mogltk {
int GetMaxY() const;
texture * GetTexture();
texture * Talloc();
+ texture * GetSTexture();
+ texture * STalloc();
Color last;
private:
void insert(int, int);
+ struct segment {
+ int x1, y1, x2, y2;
+ };
class sline : public Base {
public:
sline(int, fill *);
@@ -64,17 +77,21 @@ namespace mogltk {
};
int minX, minY, maxX, maxY;
texture * cached;
+ texture * scached;
+ std::vector<segment> segments;
protected:
sline * header;
friend class sline;
};
class shape : public Base {
public:
+ shape(SDL_Surface * = 0);
virtual void pixel(int x, int y, ColorP = WHITE);
virtual void circle(int x, int y, int r, ColorP = WHITE);
virtual void pcircle(int x, int y, int r, ColorP = WHITE);
virtual fill * fcircle(int x, int y, int r);
virtual void fdraw(fill *, ColorP = WHITE, int sx = 0, int sy = 0);
+ virtual void sdraw(fill *, ColorP = WHITE, int sx = 0, int sy = 0);
virtual void arc(int x, int y, int r, double a1, double a2, ColorP = DOS_WHITE);
virtual void arc(int x, int y, int r, int x1, int y1, int x2, int y2, ColorP = DOS_WHITE);
virtual void box(int x1, int y1, int x2, int y2, ColorP = DOS_WHITE);
@@ -119,6 +136,7 @@ namespace mogltk {
ColorP textcolor = DOS_BLACK,
ColorP tshade1 = DOS_HIGH_WHITE,
ColorP tshade2 = DOS_GRAY);
+ SDL_Surface * GetSurf();
private:
void bsubline_1(int x1, int y1, int x2, int y2, ColorP = WHITE);
void bsubline_2(int x1, int y1, int x2, int y2, ColorP = WHITE);
@@ -126,6 +144,7 @@ namespace mogltk {
void bsubline_4(int x1, int y1, int x2, int y2, ColorP = WHITE);
virtual bool Enter();
virtual void Leave(bool);
+ SDL_Surface * surf;
};
class filldrawer : public fillwalker {
@@ -139,6 +158,16 @@ namespace mogltk {
ColorP c;
int oldx, oldy;
};
+ class segdrawer : public segwalker {
+ public:
+ segdrawer(fill *, texture *, ColorP = DOS_WHITE);
+ virtual ~segdrawer();
+ virtual void step(int x1, int y1, int x2, int y2);
+ private:
+ fill * f;
+ texture * t;
+ ColorP c;
+ };
};
#endif