Brought in Amit's latest and tweaked a few more build options for enabling some safety checks in GCC.

This commit is contained in:
Zed A. Shaw 2025-01-19 11:05:42 -05:00
parent eef13bd325
commit 308fe4bed2
6 changed files with 62 additions and 33 deletions

View file

@ -13,6 +13,7 @@
#include "amt/pixel.hpp"
#include "amt/texture.hpp"
#include <memory>
#include "thread.hpp"
using Matrix = amt::Matrix<int>;
@ -43,6 +44,9 @@ struct Raycaster {
std::vector<int> spriteOrder;
std::vector<double> spriteDistance;
std::vector<double> ZBuffer; // width
float $radius; // std::min($height, $width) / 2;
float $r_sq; // = radius * radius;
amt::thread_pool_t pool;
Raycaster(sf::RenderWindow& window, Matrix &map, unsigned width, unsigned height);
@ -59,10 +63,11 @@ struct Raycaster {
void run(double speed, int dir);
void rotate(double speed, int dir);
void position_camera(float player_x, float player_y);
float get_distance_from_center(int x, int y) const noexcept;
void set_position(int x, int y);
inline size_t pixcoord(int x, int y) {
return ((y) * $width) + (x);
}
};
};