Testing asset loading.
This commit is contained in:
parent
06e7426701
commit
de1f66374b
|
|
@ -190,6 +190,22 @@ static inline int load_texture(asset_t *asset, asset_header_def_t *asset_header_
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < height; i++)
|
||||
{
|
||||
for(size_t j = 0; j < width; j += sizeof(uint16_t))
|
||||
{
|
||||
uint8_t r, g, b;
|
||||
|
||||
r = *(uint16_t *)&tmp_surface->pixels[i * sizeof(uint16_t) * width + j] & 0x001F;
|
||||
g = *(uint16_t *)&tmp_surface->pixels[i * sizeof(uint16_t) * width + j + 1] >> 5;
|
||||
b = *(uint16_t *)&tmp_surface->pixels[i * sizeof(uint16_t) * width + j + 2] >> 11;
|
||||
|
||||
printf("\033[48;2;%d;%d;%dm ", r, g, b);
|
||||
}
|
||||
|
||||
puts("\033[m");
|
||||
}
|
||||
|
||||
if(!SDL_SetSurfaceColorKey(tmp_surface, true, 0xF81F))
|
||||
{
|
||||
error_printf("Failed to set color key of temporary surface : %s", SDL_GetError());
|
||||
|
|
|
|||
Loading…
Reference in New Issue