Better lighting and a circle algorithm that works more reliably.
This commit is contained in:
parent
03fe9b3d01
commit
35f2defc11
9 changed files with 97 additions and 87 deletions
19
lights.hpp
19
lights.hpp
|
@ -13,20 +13,20 @@ namespace lighting {
|
|||
int distance = 1; // higher is farther, in squares
|
||||
};
|
||||
|
||||
const int MIN = 40;
|
||||
const int MAX = 220;
|
||||
const int MID = 140;
|
||||
const int MIN = 50;
|
||||
const int MAX = 170;
|
||||
const int MID = 130;
|
||||
|
||||
const std::array<int, 10> LEVELS{
|
||||
MAX,
|
||||
200,
|
||||
180,
|
||||
160,
|
||||
150,
|
||||
140,
|
||||
MID,
|
||||
120,
|
||||
100,
|
||||
80,
|
||||
60,
|
||||
110,
|
||||
90,
|
||||
70,
|
||||
MIN,
|
||||
};
|
||||
|
||||
|
@ -51,6 +51,9 @@ namespace lighting {
|
|||
void light_box(LightSource source, Point from, Point &min_out, Point &max_out);
|
||||
int light_level(int level, size_t x, size_t y);
|
||||
void render_light(LightSource source, Point at);
|
||||
void render_square_light(LightSource source, Point at, PointList &has_light);
|
||||
void render_compass_light(LightSource source, Point at, PointList &has_light);
|
||||
void render_circle_light(LightSource source, Point at, PointList &has_light);
|
||||
Matrix &lighting() { return $lightmap; }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue