/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2010 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
return true;
}
- fscanf(fp, "%f %d", &version, &release);
+ if (fscanf(fp, "%10f %10d", &version, &release) != 2)
+ {
+ rtn = true;
+ }
debug(("Version = %.2f - Expected %.2f\n", version, VERSION));
debug(("Release = %d - Expected %d\n", release, RELEASE));
rtn = true;
}
- fscanf(fp, "%d %d %d %d %d %d %d", &engine.fullScreen, &game.musicVol, &game.soundVol, &game.output, &game.brightness, &engine.extremeAvailable, &game.gore);
+ if (fscanf(fp, "%10d %10d %10d %10d %10d %10d %10d", &engine.fullScreen, &game.musicVol, &game.soundVol, &game.output, &game.brightness, &engine.extremeAvailable, &game.gore) != 7)
+ {
+ rtn = true;
+ }
fclose(fp);
return 0;
}
- fscanf(fp, "%s", privateKey);
+ if (fscanf(fp, "%19s", privateKey) != 1)
+ {
+ graphics.showMedalMessage(-1, "Medal Key file corrupt - Online functions disabled");
+ SDL_mutexV(medalServer.lock);
+ fclose(fp);
+ return 0;
+ }
fclose(fp);
snprintf(tempPath, sizeof tempPath, "%sfont.ttf", engine.userHomeDirectory);
remove(tempPath);
- SDL_Delay(1000); // wait one second, just to be sure!
-
if (!engine.unpack("data/vera.ttf", PAK_FONT))
{
engine.reportFontFailure();
debug(("Font sizes all loaded!!\n"));
audio.loadSound(SND_CHEAT, "sound/Lock And Load!!!");
- audio.loadSound(SND_HIGHLIGHT, "sound/menu.wav");
- audio.loadSound(SND_SELECT, "sound/select.wav");
+ audio.loadSound(SND_HIGHLIGHT, "sound/menu");
+ audio.loadSound(SND_SELECT, "sound/select");
graphics.medal[0] = graphics.loadImage("gfx/main/medal_bronze_1.png");
graphics.medal[1] = graphics.loadImage("gfx/main/award_star_silver_3.png");