X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fui.cc;h=78c7ece0274a9442b011fd38dd6074a577b0c990;hp=a0babe4f7a8329feb9114acac3992586fa383f72;hb=7ffa5c50d9254af9bd746fc5e6bc8e5db8eda675;hpb=37b68f014b46922b885c6344d6b069cba3c9c3c5 diff --git a/src/ui.cc b/src/ui.cc index a0babe4..78c7ece 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -29,7 +29,8 @@ static Text *txlist; static long timeout = 2000; static long trans_time = 250; -static dtx_font *font; +dtx_font *ui_font; +int ui_font_size = FONTSZ; void set_message_timeout(long tm) { @@ -108,7 +109,7 @@ void print_textv(const Vec2 &pos, const Vec3 &color, const char *fmt, va_list ap void draw_ui() { - if(!font) return; + if(!ui_font) return; while(msglist && msglist->show_until <= time_msec) { Message *msg = msglist; @@ -117,7 +118,7 @@ void draw_ui() delete msg; } - dtx_use_font(font, FONTSZ); + dtx_use_font(ui_font, ui_font_size); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -176,10 +177,10 @@ static bool init() done_init = true; - if(!(font = dtx_open_font("data/ui.font", 0))) { + if(!(ui_font = dtx_open_font("data/ui.font", 0))) { fprintf(stderr, "failed to open font: data/ui.font\n"); return false; } - dtx_prepare_range(font, FONTSZ, 32, 127); + dtx_prepare_range(ui_font, ui_font_size, 32, 127); return true; }