mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add asserts for missing images and sound effects
I don't want to add too many asserts, because sometimes it's okay if a file is missing (mmmmmm.vvv). But currently, the game basically expects all images and sound effects to be present. That might change in the future, but for now, these asserts are okay.
This commit is contained in:
@@ -37,6 +37,11 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no
|
||||
unsigned char *fileIn;
|
||||
size_t length;
|
||||
FILESYSTEM_loadAssetToMemory(filename, &fileIn, &length, false);
|
||||
if (fileIn == NULL)
|
||||
{
|
||||
SDL_assert(0 && "Image file missing!");
|
||||
return NULL;
|
||||
}
|
||||
if (noAlpha)
|
||||
{
|
||||
lodepng_decode24(&data, &width, &height, fileIn, length);
|
||||
|
||||
@@ -38,6 +38,7 @@ SoundTrack::SoundTrack(const char* fileName)
|
||||
if (mem == NULL)
|
||||
{
|
||||
fprintf(stderr, "Unable to load WAV file %s\n", fileName);
|
||||
SDL_assert(0 && "WAV file missing!");
|
||||
return;
|
||||
}
|
||||
SDL_RWops *fileIn = SDL_RWFromConstMem(mem, length);
|
||||
|
||||
Reference in New Issue
Block a user