mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-12 13:14:12 +00:00
Merge branch 'develop' of github.com:AnonymusRaccoon/Bomberman into find_bg
# Conflicts: # CMakeLists.txt # lib/Ray/sources/Drawables/2D/Rectangle.hpp # lib/Ray/sources/Drawables/Texture.cpp # lib/Ray/sources/Drawables/Texture.hpp # sources/Runner/CreditScene.cpp # sources/Runner/GameScene.cpp # sources/Runner/Runner.cpp still some issues with textures that are drawn behind
This commit is contained in:
@@ -11,7 +11,11 @@
|
||||
|
||||
namespace RAY {
|
||||
|
||||
Cache<::Texture> Texture::_texturesCache(LoadTexture, UnloadTexture);
|
||||
Cache<::Texture> Texture::_texturesCache(LoadTexture, UnloadTexture);
|
||||
|
||||
Texture::Texture()
|
||||
: Rectangle(Vector2(0, 0), Vector2(0, 0), WHITE, 0, 0)
|
||||
{}
|
||||
|
||||
Texture::Texture(const std::string &filename, bool lonely, float scale, float rotation):
|
||||
Rectangle(Vector2(0, 0), Vector2(0, 0), WHITE, scale, rotation),
|
||||
@@ -34,9 +38,15 @@ namespace RAY {
|
||||
return *this;
|
||||
this->_texture = this->_texturesCache.fetch(filename);
|
||||
this->_resourcePath = filename;
|
||||
this->_dimensions = Vector2(this->_texture->width, this->_texture->height);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const std::string &Texture::getResourcePath() const
|
||||
{
|
||||
return this->_resourcePath;
|
||||
}
|
||||
|
||||
Texture::operator ::Texture() const
|
||||
{
|
||||
return *this->_texture;
|
||||
@@ -44,6 +54,8 @@ namespace RAY {
|
||||
|
||||
void Texture::drawOn(RAY::Window &)
|
||||
{
|
||||
if (!this->_texture)
|
||||
return;
|
||||
DrawTextureEx(*this, this->_position, this->_rotation, this->_scale, this->_color);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user