dungeon/src/FieldOfView.h

22 lines
554 B
C
Raw Normal View History

2018-01-09 21:59:05 +01:00
#pragma once
#include "vec2i.h"
#include "Tilemap.h"
2018-01-09 21:59:05 +01:00
#include <vector>
class FieldOfView {
Tilemap* map;
2018-01-09 21:59:05 +01:00
unsigned int counter = 0;
std::vector<unsigned int> seen;
void cast_light(int row, float start, float end, int xx, int xy, int yx, int yy, int startX, int startY, float radius);
public:
2018-01-09 21:59:05 +01:00
unsigned int seen_cutoff = 0;
2017-12-27 12:43:38 +01:00
FieldOfView();
FieldOfView(Tilemap* map);
void calc(vec2i pos, float range);
bool can_see(vec2i pos);
bool has_seen(vec2i pos);
};
bool line_of_sight(Tilemap* map, vec2i start, vec2i end);