From 652aa99bd5fddbb4ee878ddd65ac637a134dbcbc Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 13 Jul 2004 06:20:33 +0000 Subject: Fixed font bug + adding fixed font --- lib/engine.cc | 7 +++++-- lib/font.cc | 1 + lib/glfont.cc | 6 +++--- lib/texture.cc | 2 +- lib/widgets.cc | 6 +++--- 5 files changed, 13 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/engine.cc b/lib/engine.cc index a52aa1b..357de32 100644 --- a/lib/engine.cc +++ b/lib/engine.cc @@ -115,10 +115,13 @@ int mogltk::engine::postsetup() throw(GeneralException) { postsetuped = true; - if (glbase_o) + if (glbase_o) { mogltk::SystemFont = new mogltk::glfont(&Input("font.bin")); - else + mogltk::FixedFont = new mogltk::glfont(&Input("fixed-font.bin")); + } else { mogltk::SystemFont = new mogltk::font(&Input("font.bin")); + mogltk::FixedFont = new mogltk::font(&Input("fixed-font.bin")); + } return 0; } diff --git a/lib/font.cc b/lib/font.cc index 5534cfc..a23eae2 100644 --- a/lib/font.cc +++ b/lib/font.cc @@ -648,6 +648,7 @@ int mogltk::font::singletextsize(const String & s) const { } mogltk::font * mogltk::SystemFont; +mogltk::font * mogltk::FixedFont; mogltk::texture * mogltk::font::alloctexture() { return new mogltk::texture(256, 256); diff --git a/lib/glfont.cc b/lib/glfont.cc index cd2fca3..9bbcbd9 100644 --- a/lib/glfont.cc +++ b/lib/glfont.cc @@ -41,9 +41,9 @@ void mogltk::glfont::drawentry(Uint16 entry, int x, int y, ColorP c) { glBegin(GL_TRIANGLE_STRIP); glTexCoord2i(px , py ); glVertex2i(x , y ); - glTexCoord2i(px + maxX - 1, py ); glVertex2i(x + maxX - 1, y ); - glTexCoord2i(px , py + maxY - 1); glVertex2i(x , y + maxY - 1); - glTexCoord2i(px + maxX - 1, py + maxY - 1); glVertex2i(x + maxX - 1, y + maxY - 1); + glTexCoord2i(px + maxX , py ); glVertex2i(x + maxX , y ); + glTexCoord2i(px , py + maxY ); glVertex2i(x , y + maxY ); + glTexCoord2i(px + maxX , py + maxY ); glVertex2i(x + maxX , y + maxY ); glEnd(); if (!was2D) diff --git a/lib/texture.cc b/lib/texture.cc index 42c8f3f..40c02ac 100644 --- a/lib/texture.cc +++ b/lib/texture.cc @@ -130,7 +130,7 @@ inline static unsigned int nextpower(unsigned int n) { } } -mogltk::texture::texture(int x, int y, int w, int h) throw (GeneralException) : width(nextpower(w)), height(nextpower(h)), +mogltk::texture::texture(int x, int y, int w, int h) : width(nextpower(w)), height(nextpower(h)), texture_allocated(true), planar(false), tainted(false), taintable(false) { glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); diff --git a/lib/widgets.cc b/lib/widgets.cc index 5676721..f3dc559 100644 --- a/lib/widgets.cc +++ b/lib/widgets.cc @@ -372,10 +372,10 @@ bool mogltk::widgets::Button::process_event(int xe, int ye, mogltk::event_t even return true; case E_MOUSE_END_DRAG_OVER: dragging = false; - if (bevel); + if (bevel) // action here. - if (a) - a->do_action(this); + if (a) + a->do_action(this); bevel = false; return true; } -- cgit v1.2.3