Fix awkward compiler warning.
This commit is contained in:
parent
4f50b6a749
commit
2166db91e2
|
@ -67,11 +67,13 @@ bool texture_image_load(const char *path, struct texture_image *out_img)
|
||||||
if (!strstr(path, ".tga"))
|
if (!strstr(path, ".tga"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8_t *buf = NULL;
|
void *raw_buf = NULL;
|
||||||
ssize_t len = read_file(path, (void**)&buf);
|
ssize_t len = read_file(path, &raw_buf);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
uint8_t *buf = raw_buf;
|
||||||
|
|
||||||
if (buf[2] != 2) // Uncompressed RGB
|
if (buf[2] != 2) // Uncompressed RGB
|
||||||
{
|
{
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
|
@ -64,8 +64,8 @@ static void dump_content(FILE *file, const uint16_t *frame, unsigned width, unsi
|
||||||
// BMP likes reverse ordering for some reason :v
|
// BMP likes reverse ordering for some reason :v
|
||||||
for (int j = height - 1; j >= 0; j--)
|
for (int j = height - 1; j >= 0; j--)
|
||||||
{
|
{
|
||||||
uint8_t * restrict dst = line;
|
uint8_t *dst = line;
|
||||||
const uint16_t * restrict src = frame + j * pitch;
|
const uint16_t *src = frame + j * pitch;
|
||||||
for (unsigned i = 0; i < width; i++)
|
for (unsigned i = 0; i < width; i++)
|
||||||
{
|
{
|
||||||
uint16_t pixel = *src++;
|
uint16_t pixel = *src++;
|
||||||
|
@ -87,7 +87,7 @@ bool screenshot_dump(const char *folder, const uint16_t *frame,
|
||||||
time_t cur_time;
|
time_t cur_time;
|
||||||
time(&cur_time);
|
time(&cur_time);
|
||||||
|
|
||||||
char timefmt[64];
|
char timefmt[128];
|
||||||
strftime(timefmt, sizeof(timefmt), "SSNES-%m%d-%H%M%S.bmp", localtime(&cur_time));
|
strftime(timefmt, sizeof(timefmt), "SSNES-%m%d-%H%M%S.bmp", localtime(&cur_time));
|
||||||
|
|
||||||
char filename[256];
|
char filename[256];
|
||||||
|
|
Loading…
Reference in New Issue