Ya casi dibuja el mapa

This commit is contained in:
2022-07-02 23:25:26 +02:00
parent 4e422c546d
commit f14388530d
2 changed files with 10 additions and 6 deletions

View File

@@ -161,8 +161,12 @@ color_t Room::getBGColor()
// Dibuja la habitación en pantalla
void Room::draw()
{
int x = 0;
int y = 0;
SDL_Rect clip = {0, 0, 8, 8};
texture->render(renderer,x, y, &clip);
for (int y = 0; y < 16; y++)
for (int x = 0; x < 32; x++)
{
clip.x = tilemap[(y * 16) + x] * 8;
clip.y = tilemap[(y * 16) + x] * 8;
texture->render(renderer, x * 8, y * 8, &clip);
}
}