Move to c++23 and clean up of raycaster.
This commit is contained in:
parent
403d2bd7ce
commit
ea791270b3
3 changed files with 9 additions and 12 deletions
|
|
@ -1,19 +1,16 @@
|
|||
#include "graphics/raycaster.hpp"
|
||||
#include "dbc.hpp"
|
||||
#include "algos/matrix.hpp"
|
||||
#include "game/components.hpp"
|
||||
#include "game/systems.hpp"
|
||||
#include "graphics/animation.hpp"
|
||||
#include "graphics/raycaster.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <fmt/core.h>
|
||||
#include <memory>
|
||||
#include <numbers>
|
||||
#include "game/components.hpp"
|
||||
#include "graphics/textures.hpp"
|
||||
#include "game/systems.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include "graphics/animation.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
using std::make_unique, std::shared_ptr;
|
||||
|
||||
union ColorConv {
|
||||
|
|
@ -92,6 +89,7 @@ void Raycaster::draw_pixel_buffer() {
|
|||
}
|
||||
|
||||
void Raycaster::apply_sprite_effect(shared_ptr<sf::Shader> effect, float width, float height) {
|
||||
// BUG: should I use the clock in the animation?
|
||||
effect->setUniform("u_time", $clock.getElapsedTime().asSeconds());
|
||||
sf::Vector2f u_resolution{width, height};
|
||||
effect->setUniform("u_resolution", u_resolution);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/System/Clock.hpp>
|
||||
#include "algos/matrix.hpp"
|
||||
#include "algos/spatialmap.hpp"
|
||||
#include "game/level.hpp"
|
||||
#include "graphics/textures.hpp"
|
||||
#include <SFML/System/Clock.hpp>
|
||||
|
||||
using matrix::Matrix;
|
||||
using RGBA = uint32_t;
|
||||
|
|
@ -79,7 +79,6 @@ struct Raycaster {
|
|||
void update_sprite(DinkyECS::Entity ent, components::Sprite& sprite);
|
||||
void init_shaders();
|
||||
|
||||
// camera things?
|
||||
void position_camera(float player_x, float player_y);
|
||||
Point plan_move(int dir, bool strafe);
|
||||
void plan_rotate(int dir, float amount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue