Afegint smart pointers

Actualitzat Resources
Actualitzades les classes Sprite i derivades
Afegida nova tipografia
Actualitzat Asset
Actualitzat Text
This commit is contained in:
2025-02-24 14:09:29 +01:00
parent 48971cd5d1
commit e6f101ece6
42 changed files with 2669 additions and 3158 deletions

View File

@@ -78,10 +78,18 @@ bool Texture::loadFromFile(const std::string &file_path)
int depth, pitch;
Uint32 pixel_format;
// STBI_rgb_alpha (RGBA)
depth = 32;
pitch = 4 * width;
pixel_format = SDL_PIXELFORMAT_RGBA32;
/*if (req_format == STBI_rgb)
{
depth = 24;
pitch = 3 * width; // 3 bytes por pixel * pixels por linea
pixel_format = SDL_PIXELFORMAT_RGB24;
}
else*/
{ // STBI_rgb_alpha (RGBA)
depth = 32;
pitch = 4 * width;
pixel_format = SDL_PIXELFORMAT_RGBA32;
}
// Limpia
unloadTexture();