Ver Fonte

Native large file support.

woollybah há 11 anos atrás
pai
commit
fdf6a9ce90
2 ficheiros alterados com 14 adições e 14 exclusões
  1. 5 5
      sdl.mod/glue.c
  2. 9 9
      sdl.mod/sdl.bmx

+ 5 - 5
sdl.mod/glue.c

@@ -26,8 +26,8 @@
 #include <brl.mod/blitz.mod/blitz.h>
 
 int sdl_sdl__sdl_rwops_seek(BBObject *, int, int);
-int sdl_sdl__sdl_rwops_read(BBObject *, void *, int);
-int sdl_sdl__sdl_rwops_write(BBObject *, void *, int);
+BBLONG sdl_sdl__sdl_rwops_read(BBObject *, void *, BBLONG);
+BBLONG sdl_sdl__sdl_rwops_write(BBObject *, void *, BBLONG);
 int sdl_sdl__sdl_rwops_close(BBObject *);
 
 void bmx_SDL_FreeRW_stream(SDL_RWops * ops);
@@ -40,15 +40,15 @@ BBString * bmx_SDL_GetError() {
 
 
 Sint64 bmx_SDL_RWops_seek(struct SDL_RWops * context, Sint64 offset, int whence) {
-	return sdl_sdl__sdl_rwops_seek(context->hidden.unknown.data1, (int)offset, whence);
+	return sdl_sdl__sdl_rwops_seek(context->hidden.unknown.data1, offset, whence);
 }
 
 size_t bmx_SDL_RWops_read(struct SDL_RWops * context, void *ptr, size_t size, size_t maxnum) {
-	return sdl_sdl__sdl_rwops_read(context->hidden.unknown.data1, ptr, (int)(size * maxnum)) / size;
+	return sdl_sdl__sdl_rwops_read(context->hidden.unknown.data1, ptr, (size * maxnum)) / size;
 }
 
 size_t bmx_SDL_RWops_write(struct SDL_RWops * context, const void *ptr, size_t size, size_t num) {
-  return sdl_sdl__sdl_rwops_write(context->hidden.unknown.data1, ptr, (int)(size * num)) / size;
+  return sdl_sdl__sdl_rwops_write(context->hidden.unknown.data1, ptr, (size * num)) / size;
 }
 
 int bmx_SDL_RWops_close(struct SDL_RWops *context) {

+ 9 - 9
sdl.mod/sdl.bmx

@@ -77,20 +77,20 @@ Import "common.bmx"
 
 Import "glue.c"
 
-Function _sdl_rwops_seek:Int(stream:TStream, pos:Int, whence:Int)
-	If whence = 1 Then
-		pos = stream.Pos() + pos
-	Else If whence = 2 Then
-		pos = stream.Size() + pos
-	End If
-	Return stream.seek(pos)
+Function _sdl_rwops_seek:Int(stream:TStream, pos:Long, whence:Int)
+	'If whence = 1 Then
+	'	pos = stream.Pos() + pos
+	'Else If whence = 2 Then
+	'	pos = stream.Size() + pos
+	'End If
+	Return stream.seek(pos, whence)
 End Function
 
-Function _sdl_rwops_read:Int(stream:TStream, buf:Byte Ptr, count:Int)
+Function _sdl_rwops_read:Long(stream:TStream, buf:Byte Ptr, count:Long)
 	Return stream.read(buf, count)
 End Function
 
-Function _sdl_rwops_write:Int(stream:TStream, buf:Byte Ptr, count:Int)
+Function _sdl_rwops_write:Long(stream:TStream, buf:Byte Ptr, count:Long)
 	Return stream.write(buf, count)
 End Function