From 2ef9753588b02155faf8bc5a176e4fcf7489dae2 Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 14 Mar 2003 13:36:40 +0000 Subject: glcolor, first episode --- include/Makefile.am | 2 +- include/glcolor.h | 18 ++++++++++++++++++ include/glfont.h | 14 +++++++------- include/glshape.h | 26 +++++++++++++------------- include/sprite.h | 4 ++-- 5 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 include/glcolor.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 0aa8482..283156d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,4 @@ pkginclude_HEADERS = \ -engine.h glbase.h glfont.h gltexture.h glshape.h glwidgets.h sprite.h +engine.h glbase.h glcolor.h glfont.h gltexture.h glshape.h glwidgets.h sprite.h noinst_HEADERS = gettext.h diff --git a/include/glcolor.h b/include/glcolor.h new file mode 100644 index 0000000..8296451 --- /dev/null +++ b/include/glcolor.h @@ -0,0 +1,18 @@ +#ifndef __GLCOLOR_H__ +#define __GLCOLOR_H__ + +#include +#include + +namespace mogltk { + class ColorP : public Base { + public: + ColorP(const Color &); + ColorP(Uint8, Uint8, Uint8, Uint8); + void Bind(); + private: + Color c; + }; +}; + +#endif diff --git a/include/glfont.h b/include/glfont.h index 4ace74a..991024e 100644 --- a/include/glfont.h +++ b/include/glfont.h @@ -4,24 +4,24 @@ #include #include #include -#include #include -#include "gltexture.h" +#include +#include namespace mogltk { class font : public Base { public: font(Handle *); virtual ~font(); - void drawentry(Uint16, int, int, Color = Color(255, 255, 255, 255)); + void drawentry(Uint16, int, int, ColorP = WHITE); void putcursor(int, int); - void putentry(Uint16, Color = Color(255, 255, 255, 255)); - void putchar(char, Color = Color(255, 255, 255, 255)); + void putentry(Uint16, ColorP = WHITE); + void putchar(char, ColorP = WHITE); void newline(void); int printf(const ugly_string &, ...); int printf(const char *, ...); int printf(const ugly_string &, va_list); - void setcolor(Color); + void setcolor(ColorP); void setshadow(int); int getchar(char) const; int singletextsize(const String &) const; @@ -34,7 +34,7 @@ namespace mogltk { Uint16 * corresp; void Bind(int); int cx, cy, ox; - Color textcolor; + ColorP textcolor; int shadow; }; extern font * SystemFont; diff --git a/include/glshape.h b/include/glshape.h index cd9fef0..a0c7bf2 100644 --- a/include/glshape.h +++ b/include/glshape.h @@ -2,24 +2,24 @@ #define __GLSHAPE_H__ #include -#include +#include #include namespace mogltk { class shape : public Base { public: - static void box(int x1, int y1, int x2, int y2, Color = WHITE); - static void box(int x1, int y1, int x2, int y2, Color, Color, Color, Color); - static void obox(int x1, int y1, int x2, int y2, Color = WHITE); - static void obox(int x1, int y1, int x2, int y2, Color, Color, Color, Color); - static void tbox(texture *, int x1, int y1, int x2, int y2, int tx = 0, int ty = 0, double = 1.0, Color = WHITE); - static void tbox(texture *, int x1, int y1, int x2, int y2, int tx1, int ty1, int tx2, int ty2, Color = WHITE); - static void tbox(texture *, int x1, int y1, int x2, int y2, Color, Color, Color, Color, int tx = 0, int ty = 0, double = 1.0); - static void tbox(texture *, int x1, int y1, int x2, int y2, Color, Color, Color, Color, int tx1, int ty1, int tx2, int ty2); - static void hline(int x1, int x2, int y, Color = WHITE); - static void hline(int x1, int x2, int y, Color, Color); - static void vline(int x, int y1, int y2, Color = WHITE); - static void vline(int x, int y1, int y2, Color, Color); + static void box(int x1, int y1, int x2, int y2, ColorP = WHITE); + static void box(int x1, int y1, int x2, int y2, ColorP, ColorP, ColorP, ColorP); + static void obox(int x1, int y1, int x2, int y2, ColorP = WHITE); + static void obox(int x1, int y1, int x2, int y2, ColorP, ColorP, ColorP, ColorP); + static void tbox(texture *, int x1, int y1, int x2, int y2, int tx = 0, int ty = 0, double = 1.0, ColorP = WHITE); + static void tbox(texture *, int x1, int y1, int x2, int y2, int tx1, int ty1, int tx2, int ty2, ColorP = WHITE); + static void tbox(texture *, int x1, int y1, int x2, int y2, ColorP, ColorP, ColorP, ColorP, int tx = 0, int ty = 0, double = 1.0); + static void tbox(texture *, int x1, int y1, int x2, int y2, ColorP, ColorP, ColorP, ColorP, int tx1, int ty1, int tx2, int ty2); + static void hline(int x1, int x2, int y, ColorP = WHITE); + static void hline(int x1, int x2, int y, ColorP, ColorP); + static void vline(int x, int y1, int y2, ColorP = WHITE); + static void vline(int x, int y1, int y2, ColorP, ColorP); private: static bool in2D(bool); static void out2D(bool); diff --git a/include/sprite.h b/include/sprite.h index fbc50ff..16565d0 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "gltexture.h" namespace mogltk { @@ -13,7 +13,7 @@ namespace mogltk { Sprite(Handle *, int, int); Sprite(Uint8 *, int, int); virtual ~Sprite(); - void draw(int, int, Color = WHITE); + void draw(int, int, ColorP = WHITE); private: class TexList : public Base { public: -- cgit v1.2.3