aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 48bd2b6..e9b8067 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -878,8 +878,7 @@ namespace ui {
void quitGame(){
dialogBoxExists = false;
- //delete[] currentMenu;
- //currentMenu = NULL;
+ currentMenu = NULL;
gameRunning = false;
updateConfig();
saveConfig();
@@ -1488,7 +1487,9 @@ EXIT:
heyOhLetsGo = 0;
break;
case SDLK_l:
- player->light ^= true;
+ currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
+ currentWorld->light.back().follow(player);
+ currentWorld->light.back().makeFlame();
break;
case SDLK_f:
currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
@@ -1508,13 +1509,14 @@ EXIT:
case SDLK_b:
currentWorld->addStructure(FIRE_PIT, player->loc.x, player->loc.y, "", "");
currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
+ currentWorld->light.back().follow(currentWorld->build.back());
+ currentWorld->light.back().makeFlame();
break;
case SDLK_F12:
// Make the BYTE array, factor of 3 because it's RBG.
static GLubyte* pixels;
pixels = new GLubyte[ 3 * SCREEN_WIDTH * SCREEN_HEIGHT];
glReadPixels(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, pixels);
-
//static std::thread scr;
//scr = std::thread(takeScreenshot,pixels);
//scr.detach();