summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-13 01:54:04 +0000
committerpixel <pixel>2003-03-13 01:54:04 +0000
commitc9437871835f2472e40a9051704b4e20f48ed067 (patch)
tree51ad8e86d22918d103ab93ccd1deb7ed812b7f15
parent97ec70da939ace8fa7a076fa31f0d1548e489ba1 (diff)
Font Bug
-rw-r--r--lib/engine.cc2
-rw-r--r--lib/glfont.cc8
-rw-r--r--src/test.cc5
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/engine.cc b/lib/engine.cc
index 53be179..ac813f9 100644
--- a/lib/engine.cc
+++ b/lib/engine.cc
@@ -162,7 +162,7 @@ void mogltk::engine::pollevents() {
printm(M_INFO, "Mouse slept over the screen - (%i, %i)\n", event.motion.x, event.motion.y);
if (locked) {
if (!((event.motion.x == mx) && (event.motion.y == my))) {
- SDL_WrapMouse(mx, my);
+ SDL_WarpMouse(mx, my);
}
}
if (cursorvisible)
diff --git a/lib/glfont.cc b/lib/glfont.cc
index 0956b36..383601c 100644
--- a/lib/glfont.cc
+++ b/lib/glfont.cc
@@ -98,10 +98,8 @@ mogltk::font::font(Handle * ffont) : textcolor(255, 255, 255, 255) {
nbT++;
}
-#ifdef DEBUG
printm(M_INFO, "Creating font texture: %i entries, flags = 0x%02x, maxX = %i, maxY = %i\n", nbentries, flags, maxX, maxY);
printm(M_INFO, "Which makes %i texture(s), with %i char by texture, %i on X, and %i on Y\n", nbT, nbcT, nbcU, nbcV);
-#endif
fonttex = (texture **) malloc(nbT * sizeof(texture *));
@@ -137,16 +135,16 @@ mogltk::font::font(Handle * ffont) : textcolor(255, 255, 255, 255) {
}
}
}
- if (((curU += maxX) + maxX) >= 256) {
+ if (((curU += maxX) + maxX) > 256) {
curU = 0;
- if (((curV += maxY) + maxY) >= 256) {
+ if (((curV += maxY) + maxY) > 256) {
curV = 0;
if ((curT + 1) != nbT)
curtex = (Uint8 *) fonttex[++curT]->GetSurface()->pixels;
}
}
}
-
+
corresp = (Uint16 *) malloc(nbentries * 2 * sizeof(Uint16));
ffont->read(corresp, 2 * sizeof(Uint16) * nbentries);
diff --git a/src/test.cc b/src/test.cc
index d0fb202..74b4b9b 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -12,9 +12,10 @@
CODE_BEGINS
virtual int startup() throw (GeneralException) {
+ verbosity = M_INFO;
mogltk::glbase::setup();
new Archive("datas.paq");
- Input * fonte = new Input("font-2.bin");
+ Input * fonte = new Input("font.bin");
mogltk::font font(fonte);
delete fonte;
Input * cursor = new Input("cursor.rgba");
@@ -84,7 +85,7 @@ virtual int startup() throw (GeneralException) {
font.putcursor(550, 450);
font.printf("FPS: %.2f", mogltk::engine::FPS());
- s->draw(mogltk::engine::mouseX(), mogltk::engine::mouseY());
+ s->draw(mogltk::engine::mouseX() - 9, mogltk::engine::mouseY() - 7);
mogltk::glbase::Leave2DMode();
mogltk::glbase::Flip();