mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-16 16:09:42 +01:00
Remove default argument from loadFileToMemory()
Default function arguments are the devil, and it's better to be more explicit about what you're passing into the function. Also because we might become C-only in the future and to help faciliate that, we should get rid of C++-isms like default function arguments now.
This commit is contained in:
parent
a11920e1a9
commit
aea5611e5b
5 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ void FILESYSTEM_unmountAssets(void);
|
||||||
bool FILESYSTEM_isAssetMounted(const char* filename);
|
bool FILESYSTEM_isAssetMounted(const char* filename);
|
||||||
|
|
||||||
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
|
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
|
||||||
size_t *len, bool addnull = false);
|
size_t *len, bool addnull);
|
||||||
void FILESYSTEM_freeMemory(unsigned char **mem);
|
void FILESYSTEM_freeMemory(unsigned char **mem);
|
||||||
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
||||||
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
||||||
|
|
|
@ -364,7 +364,7 @@ void Graphics::Makebfont(void)
|
||||||
|
|
||||||
unsigned char* charmap = NULL;
|
unsigned char* charmap = NULL;
|
||||||
size_t length;
|
size_t length;
|
||||||
FILESYSTEM_loadFileToMemory("graphics/font.txt", &charmap, &length);
|
FILESYSTEM_loadFileToMemory("graphics/font.txt", &charmap, &length, false);
|
||||||
if (charmap != NULL)
|
if (charmap != NULL)
|
||||||
{
|
{
|
||||||
unsigned char* current = charmap;
|
unsigned char* current = charmap;
|
||||||
|
|
|
@ -36,7 +36,7 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no
|
||||||
|
|
||||||
unsigned char *fileIn = NULL;
|
unsigned char *fileIn = NULL;
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
FILESYSTEM_loadFileToMemory(filename, &fileIn, &length);
|
FILESYSTEM_loadFileToMemory(filename, &fileIn, &length, false);
|
||||||
if (noAlpha)
|
if (noAlpha)
|
||||||
{
|
{
|
||||||
lodepng_decode24(&data, &width, &height, fileIn, length);
|
lodepng_decode24(&data, &width, &height, fileIn, length);
|
||||||
|
|
|
@ -131,7 +131,7 @@ void Screen::LoadIcon(void)
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
FILESYSTEM_loadFileToMemory("VVVVVV.png", &fileIn, &length);
|
FILESYSTEM_loadFileToMemory("VVVVVV.png", &fileIn, &length, false);
|
||||||
lodepng_decode24(&data, &width, &height, fileIn, length);
|
lodepng_decode24(&data, &width, &height, fileIn, length);
|
||||||
FILESYSTEM_freeMemory(&fileIn);
|
FILESYSTEM_freeMemory(&fileIn);
|
||||||
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(
|
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(
|
||||||
|
|
|
@ -33,7 +33,7 @@ SoundTrack::SoundTrack(const char* fileName)
|
||||||
|
|
||||||
unsigned char *mem;
|
unsigned char *mem;
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
FILESYSTEM_loadFileToMemory(fileName, &mem, &length);
|
FILESYSTEM_loadFileToMemory(fileName, &mem, &length, false);
|
||||||
if (mem == NULL)
|
if (mem == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unable to load WAV file %s\n", fileName);
|
fprintf(stderr, "Unable to load WAV file %s\n", fileName);
|
||||||
|
|
Loading…
Reference in a new issue