Skip to content

Commit ec09a7d

Browse files
committed
textures: Clean up logs
1 parent 3d20ef0 commit ec09a7d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

app/source/textures.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,23 @@ namespace Textures {
122122

123123
code = bmp_analyse(&bmp, size, data);
124124
if (code != BMP_OK) {
125-
Log::Error("bmp_analyse failed: %d\n", code);
125+
Log::Error("%s(bmp_analyse) failed: %d\n", __func__, code);
126126
bmp_finalise(&bmp);
127127
return nullptr;
128128
}
129129

130130
code = bmp_decode(&bmp);
131131
if (code != BMP_OK) {
132132
if ((code != BMP_INSUFFICIENT_DATA) && (code != BMP_DATA_ERROR)) {
133-
Log::Error("bmp_decode failed: %d\n", code);
133+
Log::Error("%s(bmp_decode) failed: %d\n", __func__, code);
134134
bmp_finalise(&bmp);
135135
return nullptr;
136136
}
137137

138138
/* skip if the decoded image would be ridiculously large */
139139
if ((bmp.width * bmp.height) > 200000) {
140140
Log::Error("bmp_decode failed: width*height is over 200000\n");
141+
Log::Error("%s(bmp_decode) failed: width*height is over 200000\n", __func__);
141142
bmp_finalise(&bmp);
142143
return nullptr;
143144
}
@@ -165,15 +166,15 @@ namespace Textures {
165166
do {
166167
code = gif_initialise(&gif, size, data);
167168
if (code != GIF_OK && code != GIF_WORKING) {
168-
Log::Error("gif_initialise failed: %d\n", code);
169+
Log::Error("%s(gif_initialise) failed: %d\n", __func__, code);
169170
gif_finalise(&gif);
170171
return nullptr;
171172
}
172173
} while (code != GIF_OK);
173174

174175
code = gif_decode_frame(&gif, 0);
175176
if (code != GIF_OK) {
176-
Log::Error("gif_decode_frame failed: %d\n", code);
177+
Log::Error("%s(gif_decode_frame) failed: %d\n", __func__, code);
177178
return nullptr;
178179
}
179180

@@ -225,7 +226,7 @@ namespace Textures {
225226
std::free(buffer);
226227

227228
return tex;
228-
}
229+
}
229230

230231
g2dTexture *LoadImageBufferPNG(unsigned char *data, int size) {
231232
g2dTexture *tex = nullptr;
@@ -264,7 +265,7 @@ namespace Textures {
264265
std::free(buffer);
265266
png_image_free(&image);
266267
return tex;
267-
}
268+
}
268269

269270
g2dTexture *LoadImage(const std::string &path, int size) {
270271
int ret = 0;

0 commit comments

Comments
 (0)