diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-24 08:25:56 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-24 08:25:56 -0400 |
commit | c9bce16570160af24ae7f1f04249aa0e8313fb06 (patch) | |
tree | 1cf53f34ea6bfc17ee248faff8414712a3a19e9f /src/ui.cpp | |
parent | 4e60d3e2d3f66471dff75732626451690a5bc8b5 (diff) |
Fire flickering
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -858,7 +858,6 @@ namespace ui { void quitGame(){ dialogBoxExists = false; currentMenu = NULL; - delete[] currentMenu; gameRunning = false; updateConfig(); saveConfig(); @@ -1446,17 +1445,11 @@ EXIT: break; case SDLK_l: currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f}); - currentWorld->light.back().belongsTo = true; - currentWorld->light.back().following = player; - currentWorld->light.back().flame = true; + 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}); - std::cout << currentWorld->light.back().belongsTo << std::endl; - currentWorld->light.back().belongsTo = false; - std::cout << currentWorld->light.back().belongsTo << std::endl; - currentWorld->light.back().following = nullptr; - currentWorld->light.back().flame = true; break; case SDLK_g: //currentWorld->addStructure(LAMP_POST, player->loc.x, player->loc.y, NULL); @@ -1473,9 +1466,8 @@ 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().belongsTo = false; - currentWorld->light.back().following = nullptr; - currentWorld->light.back().flame = true; + 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. |