From 3e2e4fe9e05d73ba1c1b5de93160bb1cdb7cb56e Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 28 Mar 2003 13:36:38 +0000 Subject: SDL backend mostly finished --- lib/glshape.cc | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'lib/glshape.cc') diff --git a/lib/glshape.cc b/lib/glshape.cc index c38d062..0fdaef0 100644 --- a/lib/glshape.cc +++ b/lib/glshape.cc @@ -36,8 +36,31 @@ void mogltk::glshape::box(int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, LEAVE; } +void mogltk::glshape::hline(int x1, int x2, int y, ColorP c1, ColorP c2) { + box(x1, y, x2, y, c1, c2, c1, c2); +} + +void mogltk::glshape::vline(int x, int y1, int y2, ColorP c1, ColorP c2) { + box(x, y1, x, y2, c1, c1, c2, c2); +} + +void mogltk::glshape::pixel(int x, int y, ColorP c) { + box(x, y, x, y, c); +} + +void mogltk::glshape::obox(int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, ColorP c3, ColorP c4) { + ENTER; + + hline(x1, x2, y1, c1, c2); + hline(x1, x2, y2, c3, c4); + vline(x1, y1, y2, c1, c3); + vline(x2, y1, y2, c2, c4); + + LEAVE; +} + void mogltk::glshape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, int tx, int ty, double f, ColorP c) { - shape::tbox(t, x1, y1, x2, y2, tx, ty, f, c); + tbox(t, x1, y1, x2, y2, tx, ty, tx + (int) ((x2 - x1) * f), ty + (int) ((y2 - y1) * f), c); } void mogltk::glshape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, int tx1, int ty1, int tx2, int ty2, ColorP c) { ENTERT; @@ -55,7 +78,7 @@ void mogltk::glshape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, } void mogltk::glshape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, ColorP c3, ColorP c4, int tx, int ty, double f) { - shape::tbox(t, x1, y1, x2, y2, c1, c2, c3, c4, tx, ty, f); + tbox(t, x1, y1, x2, y2, c1, c2, c3, c4, tx, ty, tx + (int) ((x2 - x1) * f), ty + (int) ((y2 - y1) * f)); } void mogltk::glshape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, ColorP c3, ColorP c4, int tx1, int ty1, int tx2, int ty2) { -- cgit v1.2.3