From: RĂ©mi Verschelde Date: Tue, 3 Jan 2017 22:18:58 +0000 (+0100) Subject: Use a mono font for the console text X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=8e4c49c2586a86cd5a85218914e9afeccd656dc2;p=lugaru.git Use a mono font for the console text This makes the console text more readable, as its case is quite important and the original font uses small capital letters for lower case, which are hard to read. The font used is Libration Mono with height 32 and some antialiasing. Bitmap font generated with CBFG. Liberation Mono is under the SIL Open Font License version 1.1. Part of #23. --- diff --git a/Data/Textures/FontMono.png b/Data/Textures/FontMono.png new file mode 100644 index 0000000..3d46b45 Binary files /dev/null and b/Data/Textures/FontMono.png differ diff --git a/Source/Game.cpp b/Source/Game.cpp index c385674..0fe8e53 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -90,6 +90,7 @@ XYZ mapcenter; float mapradius = 0; Text *text = NULL; +Text *textmono = NULL; float fps = 0; bool editorenabled = 0; diff --git a/Source/Game.hpp b/Source/Game.hpp index 0dcee30..17e188a 100644 --- a/Source/Game.hpp +++ b/Source/Game.hpp @@ -98,6 +98,7 @@ extern XYZ mapcenter; extern float mapradius; extern Text *text; +extern Text *textmono; extern float fps; extern bool editorenabled; diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 9ceac00..8bbeb34 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -1553,12 +1553,12 @@ int Game::DrawGLScene(StereoSide side) int offset = 0; if (consoleselected >= 60) offset = consoleselected - 60; - text->glPrint(10, 30, " ]", 0, 1, 1024, 768); + textmono->glPrint(10, 30, " ]", 0, 1, 1024, 768); if (consoleblink) { - text->glPrint(30 + (float)(consoleselected) * 10 - offset * 10, 30, "_", 0, 1, 1024, 768); + textmono->glPrint(30 + (float)(consoleselected) * 10 - offset * 10, 30, "_", 0, 1, 1024, 768); } for (unsigned i = 0; i < 15; i++) { - text->glPrint(30 - offset * 10, 30 + i * 20, consoletext[i], 0, 1, 1024, 768); + textmono->glPrint(30 - offset * 10, 30 + i * 20, consoletext[i], 0, 1, 1024, 768); } } } diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 525b522..2922eaf 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -105,15 +105,15 @@ void Dispose() void Game::newGame() { text = new Text(); + textmono = new Text(); skybox = new SkyBox(); } void Game::deleteGame() { - if (skybox) - delete skybox; - if (text) - delete text; + delete skybox; + delete text; + delete textmono; glDeleteTextures(1, &screentexture); glDeleteTextures(1, &screentexture2); @@ -538,6 +538,8 @@ void Game::InitGame() texdetail = 1; text->LoadFontTexture("Textures/Font.png"); text->BuildFont(); + textmono->LoadFontTexture("Textures/FontMono.png"); + textmono->BuildFont(); texdetail = temptexdetail; FadeLoadingScreen(10); @@ -639,6 +641,8 @@ void Game::LoadStuff() texdetail = 1; text->LoadFontTexture("Textures/Font.png"); text->BuildFont(); + textmono->LoadFontTexture("Textures/FontMono.png"); + textmono->BuildFont(); texdetail = temptexdetail; viewdistdetail = 2;