|
|
@ -1,6 +1,7 @@ |
|
|
|
#include "raycaster.hpp" |
|
|
|
#include "raycaster.hpp" |
|
|
|
#include "texture.hpp" |
|
|
|
#include "texture.hpp" |
|
|
|
#include <algorithm> |
|
|
|
#include <algorithm> |
|
|
|
|
|
|
|
#include "constants.hpp" |
|
|
|
|
|
|
|
|
|
|
|
using namespace fmt; |
|
|
|
using namespace fmt; |
|
|
|
using std::make_unique; |
|
|
|
using std::make_unique; |
|
|
@ -37,7 +38,7 @@ Raycaster::Raycaster(sf::RenderWindow& window, Matrix &map, int width, int heigh |
|
|
|
spriteDistance($textures.NUM_SPRITES), |
|
|
|
spriteDistance($textures.NUM_SPRITES), |
|
|
|
ZBuffer(width) |
|
|
|
ZBuffer(width) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// $window.setVerticalSyncEnabled(true);
|
|
|
|
$window.setVerticalSyncEnabled(VSYNC); |
|
|
|
$view_sprite.setPosition({0, 0}); |
|
|
|
$view_sprite.setPosition({0, 0}); |
|
|
|
$pixels = make_unique<RGBA[]>($width * $height); |
|
|
|
$pixels = make_unique<RGBA[]>($width * $height); |
|
|
|
$textures.load_textures(); |
|
|
|
$textures.load_textures(); |
|
|
|