Skip to content
Snippets Groups Projects
Commit 94445918 authored by Frederik's avatar Frederik
Browse files

Fix loading of numbers texture

parent 0c7bef01
No related branches found
No related tags found
2 merge requests!29Merge main into box2d to implement physics,!19Let units show their hp
......@@ -366,19 +366,14 @@ Spritesheet::Spritesheet(std::string path, Engine& engine)
std::vector<uint32_t> number_buffer(8 * 80, 0);
// every animation frame
for (size_t n = 0; n < 10; n++)
{
for (size_t y = 0; y < 8; y++)
for (int y = 0; y < 8; y++)
{
for (size_t x = 0; x < 8; x++)
for (int x = 0; x < 80; x++)
{
size_t index = (y * 8) + (n * 8 + x);
int index = y * 80 + x;
number_buffer.at(index) = number_frames.at(8 - y - 1).at(x);
}
}
}
SDL_Texture* tmp = SDL_CreateTexture(
engine.renderer(), SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, 80, 8);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment