Assets & AssetManager documentation and security.

Ahora en las tx, el SDL_Rect index 0 es la tx completa por defecto.
Revisamos los Assets y el AssetManager.
Añadimos seguridad en los métodos y controlamos excepciones.
Reescribimos comentarios y recolocamos código.
This commit is contained in:
2022-09-25 19:07:00 +02:00
parent f2bf82e370
commit 724807e9f2
12 changed files with 295 additions and 134 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ public:
UE::Sprite bg(as->getTexture("bg1"), 1, 0, glm::vec2(0, 0), UE::Engine::GetRenderer()->GetScreenSize());
UE::Sprite mapSP(as->getTexture("PruebaMap"), 0, 2, glm::vec2(50, 45), glm::vec2(145, 145));
UE::Sprite mapSP(as->getTexture("PruebaMap"), 1, 2, glm::vec2(50, 45), glm::vec2(145, 145));
sprites.push_back(sp1);
+2 -2
View File
@@ -42,7 +42,7 @@ public:
glm::vec2 size(100, 100);
glm::vec2 pos = size * i;
UE::Sprite sp(tx, rand()%5, 1, pos, size);
UE::Sprite sp(tx, (rand()%4)+1, 1, pos, size);
sprites.push_back(sp);
}
@@ -115,7 +115,7 @@ private:
SDL_Rect sp_Pos = sp.GetTransformRect();
if (SDL_HasIntersection(&mouseRect, &sp_Pos))
{
int i = rand() % 5;
int i = rand() % 4 +1;
sp.SetTextureRect(i);
break;
}