placeHolder texture rename + comments

This commit is contained in:
Crizomb 2025-06-15 17:27:31 +02:00
parent f574bd769d
commit d849c8b037
3 changed files with 5 additions and 3 deletions

View file

@ -15,4 +15,6 @@ static constexpr unsigned int FLOWER_SIZE = SCREEN_WIDTH * 0.05;
namespace sf {
class Texture;
};
extern sf::Texture placeHolder;
// created because sprite doesn't have default constructor
// Not optimal but easy to use + initialized in GameData.cpp
extern sf::Texture PLACE_HOLDER_TEXTURE;

View file

@ -18,7 +18,7 @@
const sf::Time Game::TimePerFrame = sf::seconds(1.f / 60.f);
sf::Texture bgTexture;
Game::Game() : backGround(placeHolder) {
Game::Game() : backGround(PLACE_HOLDER_TEXTURE) {
assert(mFont.openFromFile("media/Sansation.ttf"));
mStatisticsText.setPosition({5.f, 5.f});
mStatisticsText.setCharacterSize(10);

View file

@ -2,4 +2,4 @@
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Vector2.hpp>
sf::Texture placeHolder = sf::Texture(sf::Vector2u(200, 200));
sf::Texture PLACE_HOLDER_TEXTURE = sf::Texture(sf::Vector2u(20, 20));