$OpenBSD: patch-src_files_cpp,v 1.1 2021/04/11 13:17:41 solene Exp $

Use 'userdata' instead of 'refcount'. 'refcount' is a private SDL_Surface field.
Use 'imgref' and not 'imgref + 1' 

see: https://github.com/TurningWheel/Barony/pull/582

Index: src/files.cpp
--- src/files.cpp.orig
+++ src/files.cpp
@@ -591,7 +591,7 @@ SDL_Surface* loadImage(char const * const filename)
 
 	// load the new surface as a GL texture
 	allsurfaces[imgref] = newSurface;
-	allsurfaces[imgref]->refcount = imgref + 1;
+	allsurfaces[imgref]->userdata = (void *)(imgref);
 	glLoadTexture(allsurfaces[imgref], imgref);
 
 	// free the translated surface
