diff options
-rw-r--r-- | Changelog | 7 | ||||
-rw-r--r-- | main.cpp | 4 | ||||
-rw-r--r-- | src/config.cpp | 7 | ||||
-rw-r--r-- | src/gameplay.cpp | 25 | ||||
-rw-r--r-- | src/ui.cpp | 6 | ||||
-rw-r--r-- | ttf/FreePixel.ttf | bin | 0 -> 64880 bytes | |||
-rw-r--r-- | xml/playerSpawnHill1.xml | 5 |
7 files changed, 39 insertions, 15 deletions
@@ -618,3 +618,10 @@ - screenshots - improved memory management - more audio sliders + +2/5/2016: +========= + + - improved font rendering codes + - added font selection to settings.xml + - XML'd important text @@ -302,8 +302,8 @@ int main(/*int argc, char *argv[]*/){ * if they have error. */ - ui::initFonts(); - ui::setFontFace("ttf/VCR_OSD_MONO_1.001.ttf"); // as in gamedev/ttf/<font> + //ui::initFonts(); + //ui::setFontFace("ttf/FreePixel.ttf"); // as in gamedev/ttf/<font> /* * Initialize the random number generator. At the moment, initRand is a macro pointing to libc's diff --git a/src/config.cpp b/src/config.cpp index 8ec361d..ca6db1b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1,5 +1,7 @@ #include <config.h> +#include <ui.h> + using namespace tinyxml2; extern unsigned int HLINE; @@ -44,7 +46,10 @@ void readConfig(){ VOLUME_MASTER = vol->FirstChildElement("master")->FloatAttribute("volume"); VOLUME_MUSIC = vol->FirstChildElement("music")->FloatAttribute("volume"); VOLUME_SFX = vol->FirstChildElement("sfx")->FloatAttribute("volume"); - + + std::cout<<"Loading font through settings.xml..."<<std::endl; + ui::initFonts(); + ui::setFontFace(xml.FirstChildElement("font")->Attribute("path")); } void updateConfig(){ diff --git a/src/gameplay.cpp b/src/gameplay.cpp index 2b540d9..00faf70 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -196,6 +196,8 @@ void commonTriggerFunc(Mob *callee){ XMLDocument xml; XMLElement *exml; + char *text,*pch; + if(!lock){ lock = true; @@ -206,16 +208,23 @@ void commonTriggerFunc(Mob *callee){ exml = exml->NextSiblingElement(); player->vel.x = 0; - - std::cout<<"1\n"; + ui::toggleBlackFast(); - std::cout<<"2\n"; ui::waitForCover(); - std::cout<<"3\n"; - ui::importantText(exml->GetText()); - std::cout<<"4\n"; - ui::waitForDialog(); - std::cout<<"5\n"; + + text = new char[256]; + strcpy(text,exml->GetText()); + pch = strtok(text,"\n"); + + while(pch){ + ui::importantText(pch); + ui::waitForDialog(); + + pch = strtok(NULL,"\n"); + } + + delete[] text; + ui::toggleBlackFast(); callee->alive = false; @@ -227,8 +227,8 @@ namespace ui { buf[j*4 ]=fontColor[0]; buf[j*4+1]=fontColor[1]; buf[j*4+2]=fontColor[2]; - //buf[j*4+3]=ftf->glyph->bitmap.buffer[j] == 255 ? 255 : 0; - buf[j*4+3]=ftf->glyph->bitmap.buffer[j]; + buf[j*4+3]=ftf->glyph->bitmap.buffer[j] ? 255 : 0; + //buf[j*4+3]=ftf->glyph->bitmap.buffer[j]; } ftexwh[i-33].x=ftf->glyph->bitmap.width; @@ -537,7 +537,7 @@ namespace ui { dialogBoxExists = true; dialogImportant = true; - toggleBlack(); + //toggleBlack(); } void draw(void){ unsigned char i; diff --git a/ttf/FreePixel.ttf b/ttf/FreePixel.ttf Binary files differnew file mode 100644 index 0000000..d22b2a2 --- /dev/null +++ b/ttf/FreePixel.ttf diff --git a/xml/playerSpawnHill1.xml b/xml/playerSpawnHill1.xml index 8fb98c7..55612d3 100644 --- a/xml/playerSpawnHill1.xml +++ b/xml/playerSpawnHill1.xml @@ -15,7 +15,10 @@ </World> -<Trigger id="Test">It was a dark and stormy night...</Trigger> +<Trigger id="Test">It was a dark and stormy night... +Except it was the middle of the day. +And it wasn't stormy. +...</Trigger> <Dialog name="Ralph"> |