diff src/image.c @ 5:b5c649b6367b

core: implement sprites, closes #2440
author David Demelier <markand@malikania.fr>
date Mon, 06 Jan 2020 21:14:35 +0100
parents cd58eabb7fb4
children 63eaec5ceba9
line wrap: on
line diff
--- a/src/image.c	Mon Jan 06 20:22:22 2020 +0100
+++ b/src/image.c	Mon Jan 06 21:14:35 2020 +0100
@@ -16,6 +16,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <assert.h>
 #include <stdbool.h>
 
 #include <SDL_image.h>
@@ -25,12 +26,16 @@
 struct texture *
 image_openf(const char *path)
 {
+	assert(path);
+
 	return texture_from_surface(IMG_Load(path));
 }
 
 struct texture *
 image_openb(const char *buffer, size_t size)
 {
+	assert(buffer);
+
 	SDL_RWops *ops = SDL_RWFromConstMem(buffer, size);
 
 	if (!ops)