aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-02-03 07:33:53 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-02-03 07:33:53 -0500
commitf00c4bb6b0c4dc1cf2f0c122a4748288ac6ab1a5 (patch)
tree582d4bf03dbdc2e2eaa031a13e002421bc09ddac /src
parent783143974e36856e92be3fe1b13cc6a0d0b1faeb (diff)
Stuff
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp15
-rw-r--r--src/entities.cpp7
-rw-r--r--src/gameplay.cpp10
-rw-r--r--src/ui.cpp1
4 files changed, 21 insertions, 12 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 31ce578..df15e05 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -11,10 +11,11 @@ extern float VOLUME_MASTER;
extern float VOLUME_MUSIC;
XMLDocument xml;
+XMLElement *scr;
+XMLElement *vol;
+
void readConfig(){
- XMLElement *scr;
- XMLElement *vol;
xml.LoadFile("config/settings.xml");
scr = xml.FirstChildElement("screen");
SCREEN_WIDTH = scr->UnsignedAttribute("width");
@@ -29,8 +30,14 @@ void readConfig(){
}
void updateConfig(){
- XMLElement *vol = xml.FirstChildElement("volume")->FirstChildElement("master")->ToElement();
- vol->SetAttribute("volume",VOLUME_MASTER);
+ vol->FirstChildElement("master")->SetAttribute("volume",VOLUME_MASTER);
+ vol->FirstChildElement("music")->SetAttribute("volume",VOLUME_MUSIC);
+ Mix_Volume(0,VOLUME_MASTER);
+ Mix_VolumeMusic(VOLUME_MUSIC);
+
+}
+
+void saveConfig(){
xml.SaveFile("config/settings.xml", false);
} \ No newline at end of file
diff --git a/src/entities.cpp b/src/entities.cpp
index 4a8e6b7..3e7c743 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -20,7 +20,7 @@ std::string sTexLoc[] = { "assets/townhall.png",
"assets/house1.png",
"assets/fountain1.png",
"assets/lampPost1.png",
- "assets/brazzier.png"};
+ "assets/brazier.png"};
GLuint waterTex;
@@ -43,7 +43,7 @@ void getRandomName(Entity *e){
tempNum = rand() % max;
names.seekg(0,names.beg);
-
+
for(unsigned int i=0;i<tempNum;i++)
names.getline(bufs,32);
@@ -420,7 +420,8 @@ const char *randomDialog[] = {
"You know, if anyone ever asked me who I wanted to be when I grow up, I would say Abby Ross.",
"I want to have the wallpaper in our house changed. It doesn\'t really fit the environment.",
"Frig.",
- "The sine of theta equals the opposite over the hypotenuese."
+ "The sine of theta equals the opposite over the hypotenuese.",
+ "Did you know the developers spelt brazier as brazzier."
};
void NPC::interact(){ //have the npc's interact back to the player
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index d9ae6b5..f184a9f 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -225,15 +225,15 @@ void initEverything(void){
atexit(destroyEverything);
std::cout << "Hey";
- pauseMenu.items.push_back(ui::createParentButton({-256/2,0},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Resume")));
- pauseMenu.items.push_back(ui::createChildButton({-256/2,-100},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Options")));
- pauseMenu.items.push_back(ui::createButton({-256/2,-200},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Save and Quit"), ui::quitGame));
- pauseMenu.items.push_back(ui::createButton({-256/2,-300},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Segfault"), segFault));
+ pauseMenu.items.push_back(ui::createParentButton({-256/2,0},{256,75},{0.0f,0.0f,0.0f}, "Resume"));
+ pauseMenu.items.push_back(ui::createChildButton({-256/2,-100},{256,75},{0.0f,0.0f,0.0f}, "Options"));
+ pauseMenu.items.push_back(ui::createButton({-256/2,-200},{256,75},{0.0f,0.0f,0.0f}, "Save and Quit", ui::quitGame));
+ pauseMenu.items.push_back(ui::createButton({-256/2,-300},{256,75},{0.0f,0.0f,0.0f}, "Segfault", segFault));
pauseMenu.child = &optionsMenu;
pauseMenu.parent = NULL;
- optionsMenu.items.push_back(ui::createSlider({-512/2,100}, {512,50}, {0.0f, 0.0f, 0.0f}, 0, 100, (const char*)("Shit"), &VOLUME_MASTER));
+ optionsMenu.items.push_back(ui::createSlider({-512/2,100}, {512,50}, {0.0f, 0.0f, 0.0f}, 0, 100, "Shit", &VOLUME_MASTER));
optionsMenu.child = NULL;
optionsMenu.parent = &pauseMenu;
// optionsMenu.push_back(ui::createButton({-256/2,-200},{256,75},{0.0f,0.0f,0.0f}, (const char*)("Save and Quit"), );
diff --git a/src/ui.cpp b/src/ui.cpp
index 2118022..56ce651 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -640,6 +640,7 @@ namespace ui {
void quitGame(){
gameRunning = false;
updateConfig();
+ saveConfig();
}
void quitMenu(){