From ebc6bb16f895b7c192b9f4c42d1fc4feb41e271c Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 13 Apr 2003 17:03:09 +0000 Subject: broken... but well... who cares... --- include/shape.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/shape.h') 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 #include #include #include @@ -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 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 -- cgit v1.2.3