Made some progress on the refactoring but I need to start getting serious and not reworking this code to death.
This commit is contained in:
parent
6ed57cd4a8
commit
51c1e04f61
5 changed files with 46 additions and 33 deletions
|
@ -41,6 +41,8 @@ Raycaster::Raycaster(sf::RenderWindow& window, Matrix &map, int width, int heigh
|
|||
$view_sprite.setPosition({0, 0});
|
||||
$pixels = make_unique<RGBA[]>($width * $height);
|
||||
$textures.load_textures();
|
||||
$textures.load_sprites();
|
||||
$textures.position_sprite(4.0, 3.55, "evil_eye");
|
||||
$view_texture.setSmooth(false);
|
||||
}
|
||||
|
||||
|
@ -86,8 +88,8 @@ void Raycaster::sprite_casting() {
|
|||
for(int i = 0; i < $textures.NUM_SPRITES; i++) {
|
||||
int sprite_index = spriteOrder[i];
|
||||
Sprite& sprite_rec = $textures.get_sprite(sprite_index);
|
||||
// auto& sprite_texture = $textures.get_texture(sprite_rec.texture);
|
||||
sf::Sprite *sf_sprite = sprite_rec.sprite;
|
||||
// TODO: this must die
|
||||
auto sf_sprite = sprite_rec.sprite.sprite;
|
||||
|
||||
double spriteX = sprite_rec.x - $posX;
|
||||
double spriteY = sprite_rec.y - $posY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue