summaryrefslogtreecommitdiff
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
parentbaac659433417ee555e3e04a28ea6c06fa23d588 (diff)
Fixed font bug + adding fixed font
-rw-r--r--include/font.h1
-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
-rw-r--r--src/Makefile.am2
-rw-r--r--src/test.cc16
8 files changed, 25 insertions, 16 deletions
diff --git a/include/font.h b/include/font.h
index 07f7c03..da9ad46 100644
--- a/include/font.h
+++ b/include/font.h
@@ -56,6 +56,7 @@ namespace mogltk {
Uint16 * corresp;
};
extern font * SystemFont;
+ extern font * FixedFont;
};
#endif
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;
}
diff --git a/src/Makefile.am b/src/Makefile.am
index 77ce6da..a2693d4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,7 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
AM_CPPFLAGS = -Wall -Wstrict-prototypes @SDL_CFLAGS@ @BALTISOT_CFLAGS@
INCLUDES = -I.. -I../include -I$(includedir)
-# noinst_PROGRAMS = test
+noinst_PROGRAMS = test
test_SOURCES = test.cc
diff --git a/src/test.cc b/src/test.cc
index 66a2af4..f197c87 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -3,9 +3,9 @@
#include <math.h>
#include <SDL.h>
#include <vector>
-#include <lua.h>
-#include <lauxlib.h>
-#include <lualib.h>
+//#include <lua.h>
+//#include <lauxlib.h>
+//#include <lualib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
@@ -17,8 +17,8 @@
#include <Input.h>
#include <Output.h>
#include <Buffer.h>
-#include <BLua.h>
-#include <LuaHandle.h>
+//#include <BLua.h>
+//#include <LuaHandle.h>
#include "glbase.h"
#include "texture.h"
#include "glfont.h"
@@ -51,6 +51,7 @@ struct tdvect {
std::vector<tdvect> points;
std::vector<tdvect> ppoints;
+#if 0
static int myprint(lua_State * L) {
const char * t = lua_tostring(L, -1);
@@ -118,6 +119,7 @@ int myluaerror(lua_State * L) {
getchar();
}
+#endif
unsigned int swap32(unsigned int w) {
return (w >> 24) | ((w >> 8) & 0x0000ff00) | ((w << 8) & 0x00ff0000) | (w << 24);
@@ -276,6 +278,7 @@ int bdlload(char * name) {
CODE_BEGINS
+#if 0
void checkluastack(lua_State * L) {
int n = lua_gettop(L);
int i, j;
@@ -328,6 +331,7 @@ void checkluastack(lua_State * L) {
printm(M_INFO, String(i) + ": " + t + "\n");
}
}
+#endif
void putstar(double x, double y, double z, mogltk::Sprite * s) {
double tx, ty, tz;
@@ -374,7 +378,7 @@ double starst[NBSTARS];
double starso[NBSTARS];
#endif
-lua_State * L;
+//lua_State * L;
void initstars() {
int i;