Update to SDL2.0.10

This commit is contained in:
Areloch 2019-08-19 23:30:35 -05:00
parent 600859bd63
commit c932bda8dd
915 changed files with 116675 additions and 21754 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -528,6 +528,7 @@ SDL_RWFromFile(const char *file, const char *mode)
char *path;
FILE *fp;
/* !!! FIXME: why not just "char path[PATH_MAX];" ? */
path = SDL_stack_alloc(char, PATH_MAX);
if (path) {
SDL_snprintf(path, PATH_MAX, "%s/%s",
@ -751,6 +752,48 @@ done:
return data;
}
void *
SDL_LoadFile(const char *file, size_t *datasize)
{
return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1);
}
Sint64
SDL_RWsize(SDL_RWops *context)
{
return context->size(context);
}
Sint64
SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
{
return context->seek(context, offset, whence);
}
Sint64
SDL_RWtell(SDL_RWops *context)
{
return context->seek(context, 0, RW_SEEK_CUR);
}
size_t
SDL_RWread(SDL_RWops *context, void *ptr, size_t size, size_t maxnum)
{
return context->read(context, ptr, size, maxnum);
}
size_t
SDL_RWwrite(SDL_RWops *context, const void *ptr, size_t size, size_t num)
{
return context->write(context, ptr, size, num);
}
int
SDL_RWclose(SDL_RWops *context)
{
return context->close(context);
}
/* Functions for dynamically reading and writing endian-specific values */
Uint8

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages