summaryrefslogtreecommitdiff
path: root/lib/shape.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/shape.cc')
-rw-r--r--lib/shape.cc35
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/shape.cc b/lib/shape.cc
index 088deb7..9386e41 100644
--- a/lib/shape.cc
+++ b/lib/shape.cc
@@ -1,4 +1,5 @@
#include <SDL.h>
+#include "engine.h"
#include "base.h"
#include "shape.h"
#include "texture.h"
@@ -8,6 +9,7 @@
#define LEAVE Leave(flag)
void mogltk::shape::box(int x1, int y1, int x2, int y2, ColorP c) {
+#if 0
ENTER;
c.Bind();
@@ -19,9 +21,11 @@ void mogltk::shape::box(int x1, int y1, int x2, int y2, ColorP c) {
glEnd();
LEAVE;
+#endif
}
void mogltk::shape::box(int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, ColorP c3, ColorP c4) {
+#if 0
ENTER;
glBegin(GL_TRIANGLE_STRIP);
@@ -32,6 +36,7 @@ void mogltk::shape::box(int x1, int y1, int x2, int y2, ColorP c1, ColorP c2, Co
glEnd();
LEAVE;
+#endif
}
void mogltk::shape::hline(int x1, int x2, int y, ColorP c) {
@@ -113,6 +118,7 @@ void mogltk::shape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, Co
}
void mogltk::shape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, int tx1, int ty1, int tx2, int ty2, ColorP c) {
+#if 0
ENTERT;
c.Bind();
@@ -125,9 +131,11 @@ void mogltk::shape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, in
glEnd();
LEAVE;
+#endif
}
void mogltk::shape::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) {
+#if 0
ENTERT;
t->Bind();
@@ -139,9 +147,11 @@ void mogltk::shape::tbox(mogltk::texture * t, int x1, int y1, int x2, int y2, Co
glEnd();
LEAVE;
+#endif
}
void mogltk::shape::box3d(int x1, int y1, int x2, int y2, ColorP face, ColorP shade1, ColorP shade2, int depth, bool bevel) {
+#if 0
ENTER;
if (!bevel) {
@@ -179,6 +189,7 @@ void mogltk::shape::box3d(int x1, int y1, int x2, int y2, ColorP face, ColorP sh
glEnd();
LEAVE;
+#endif
}
void mogltk::shape::obox3d(int x1, int y1, int x2, int y2, ColorP shade1, ColorP shade2, bool bevel) {
@@ -266,22 +277,16 @@ void mogltk::shape::button(int x1, int y1, int x2, int y2,
LEAVE;
}
-bool mogltk::shape::Enter(bool unbind) {
- bool was2D = mogltk::glbase::is2D();
-
- if (!was2D)
- mogltk::glbase::Enter2DMode();
-
- if (unbind) mogltk::texture::Unbind();
-
- return was2D;
-}
-
bool mogltk::shape::Enter() {
- return Enter(false);
+ if (SDL_MUSTLOCK(mogltk::engine::base_o->getsurface())) {
+ SDL_LockSurface(mogltk::engine::base_o->getsurface());
+ return true;
+ } else {
+ return false;
+ }
}
-void mogltk::shape::Leave(bool was2D) {
- if (!was2D)
- mogltk::glbase::Leave2DMode();
+void mogltk::shape::Leave(bool locked) {
+ if (locked)
+ SDL_UnlockSurface(mogltk::engine::base_o->getsurface());
}