Refactor the light calculations to be part of map instead of spread out all over. Still need to bring back lighting on walls and also pathing for enemies is currently busted.
This commit is contained in:
parent
0e8a2e520a
commit
54fa1a23ce
7 changed files with 168 additions and 112 deletions
30
lights.hpp
Normal file
30
lights.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
#include <array>
|
||||
#include "dbc.hpp"
|
||||
#include "point.hpp"
|
||||
#include <algorithm>
|
||||
#include "map.hpp"
|
||||
|
||||
namespace lighting {
|
||||
|
||||
struct LightSource {
|
||||
int strength = 0; // lower is better
|
||||
int distance = 1; // higher is farther, in squares
|
||||
};
|
||||
|
||||
const int MIN = 40;
|
||||
const int MAX = 220;
|
||||
|
||||
const std::array<int, 10> LEVELS{
|
||||
MAX,
|
||||
200,
|
||||
180,
|
||||
160,
|
||||
140,
|
||||
120,
|
||||
100,
|
||||
80,
|
||||
60,
|
||||
MIN,
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue