synced with scummvm

This commit is contained in:
Pawel Kolodziejski 2011-05-01 17:49:40 +02:00
parent 8e46fdc4c3
commit 6be453780f
192 changed files with 2249 additions and 703 deletions

View file

@ -32,6 +32,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/EventRecorder.h"
#include "common/textconsole.h"
#include "backends/saves/default/default-saves.h"
#include "backends/audiocd/sdl/sdl-audiocd.h"
@ -333,7 +334,11 @@ void OSystem_SDL::setupIcon() {
unsigned int rgba[256];
unsigned int *icon;
sscanf(residual_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes);
if (sscanf(residual_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) {
warning("Wrong format of residual_icon[0] (%s)", scummvm_icon[0]);
return;
}
if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {
warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes);
return;
@ -348,13 +353,17 @@ void OSystem_SDL::setupIcon() {
unsigned char code;
char color[32];
unsigned int col;
sscanf(residual_icon[1 + i], "%c c %s", &code, color);
if (sscanf(residual_icon[1 + i], "%c c %s", &code, color) != 2) {
warning("Wrong format of residual_icon[%d] (%s)", 1 + i, residual_icon[1 + i]);
}
if (!strcmp(color, "None"))
col = 0x00000000;
else if (!strcmp(color, "black"))
col = 0xFF000000;
else if (color[0] == '#') {
sscanf(color + 1, "%06x", &col);
if (sscanf(color + 1, "%06x", &col) != 1) {
warning("Wrong format of color (%s)", color + 1);
}
col |= 0xFF000000;
} else {
warning("Could not load the built-in icon (%d %s - %s) ", code, color, residual_icon[1 + i]);