aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp7
-rw-r--r--src/gameplay.cpp25
-rw-r--r--src/ui.cpp6
3 files changed, 26 insertions, 12 deletions
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;
diff --git a/src/ui.cpp b/src/ui.cpp
index f666874..56a88a3 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -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;