summary refs log tree commit diff stats
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index a3aa7be..39828f4 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -1,6 +1,6 @@
1#include "game.h" 1#include "game.h"
2#include <vector> 2#include <vector>
3#include <fov.h> 3#include "fov.h"
4#include <iostream> 4#include <iostream>
5#include <fstream> 5#include <fstream>
6#include <set> 6#include <set>
@@ -8,6 +8,7 @@
8#include "util.h" 8#include "util.h"
9#include "renderer.h" 9#include "renderer.h"
10#include "consts.h" 10#include "consts.h"
11#include "runtime.h"
11 12
12Game::Game(std::mt19937& rng, Muxer& muxer, Renderer& renderer) : 13Game::Game(std::mt19937& rng, Muxer& muxer, Renderer& renderer) :
13 rng(rng), 14 rng(rng),
@@ -35,7 +36,7 @@ Game::Game(std::mt19937& rng, Muxer& muxer, Renderer& renderer) :
35 tick(); 36 tick();
36 } while (!isInitialCaveBigEnough()); 37 } while (!isInitialCaveBigEnough());
37 38
38 std::ifstream textFile("../res/childoflight.txt"); 39 std::ifstream textFile(Runtime::getResourcePath("childoflight.txt"));
39 std::string line; 40 std::string line;
40 while (std::getline(textFile, line)) { 41 while (std::getline(textFile, line)) {
41 signTexts.push_back(line); 42 signTexts.push_back(line);
@@ -284,7 +285,7 @@ void Game::recalculateLighting()
284 if (game.map.inBounds(x, y)) 285 if (game.map.inBounds(x, y))
285 { 286 {
286 MapData& sourceData = *static_cast<MapData*>(source); 287 MapData& sourceData = *static_cast<MapData*>(source);
287 double lightRadius = static_cast<double>(sourceData.lightRadius); 288 //double lightRadius = static_cast<double>(sourceData.lightRadius);
288 289
289 if (!game.map.at(x,y).lit) 290 if (!game.map.at(x,y).lit)
290 { 291 {
@@ -302,7 +303,7 @@ void Game::recalculateLighting()
302 for (int x = map.getLeft(); x < map.getRight(); x++) 303 for (int x = map.getLeft(); x < map.getRight(); x++)
303 { 304 {
304 Source ls = Source::None; 305 Source ls = Source::None;
305 int lightRadius; 306 int lightRadius = 0;
306 307
307 if (renderPlayer && player_x == x && player_y == y) 308 if (renderPlayer && player_x == x && player_y == y)
308 { 309 {