1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
From: Austin Hurst <mynameisaustinhurst@gmail.com>
Date: Fri, 4 Feb 2022 17:05:41 -0400
Subject: Fix some rwops bugs
Origin: upstream, 0.9.11, commit:02c3845c8bb3498747e88ca42e8c5e15ac4cfd5e
---
sdl2/rwops.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sdl2/rwops.py b/sdl2/rwops.py
index 7851c57..ef53584 100644
--- a/sdl2/rwops.py
+++ b/sdl2/rwops.py
@@ -65,7 +65,7 @@ SDL_FreeRW = _bind("SDL_FreeRW", [POINTER(SDL_RWops)])
SDL_LoadFile_RW = _bind("SDL_LoadFile_RW", [POINTER(SDL_RWops), POINTER(c_size_t), c_int], c_void_p, added='2.0.6')
# SDL_LoadFile was a macro in SDL <= 2.0.9, added as a function in 2.0.10
if version >= 2010:
- SDL_LoadFile = _bind("SDL_LoadFile", [c_char_p, c_size_t], c_void_p)
+ SDL_LoadFile = _bind("SDL_LoadFile", [c_char_p, POINTER(c_size_t)], c_void_p)
else:
SDL_LoadFile = lambda fname, ds: SDL_LoadFile_RW(SDL_RWFromFile(fname, "rb"), ds, 1)
@@ -181,7 +181,7 @@ def rw_from_object(obj):
else:
cur = obj.seek(0, RW_SEEK_CUR)
length = obj.seek(0, RW_SEEK_END)
- obj.seek(cur, RW_SEEK_CUR)
+ obj.seek(cur, RW_SEEK_SET)
return length
except Exception:
#print(e)
|