summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2004-07-13 06:20:33 +0000
committerpixel <pixel>2004-07-13 06:20:33 +0000
commit652aa99bd5fddbb4ee878ddd65ac637a134dbcbc (patch)
tree84c0c8f8bbb943a570d4e6d245f7410633c0fb42 /lib
parentbaac659433417ee555e3e04a28ea6c06fa23d588 (diff)
Fixed font bug + adding fixed font
Diffstat (limited to 'lib')
-rw-r--r--lib/engine.cc7
-rw-r--r--lib/font.cc1
-rw-r--r--lib/glfont.cc6
-rw-r--r--lib/texture.cc2
-rw-r--r--lib/widgets.cc6
5 files changed, 13 insertions, 9 deletions
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;
}