2
0
Эх сурвалжийг харах

Fixed filesystem.OpenCFile so it handles universal monkey2 style open modes.

Mark Sibly 7 жил өмнө
parent
commit
c3643b0315

+ 1 - 1
modules/mojo/audio/audio.monkey2

@@ -72,7 +72,7 @@ Class AudioDevice
 			finished()
 		End,True )
 		
-		Local file:=filesystem.OpenCFile( path,"rb" )
+		Local file:=filesystem.OpenCFile( path,"r" )
 		
 		Local sampleRate:=playMusic( file,callback,channel._alSource )
 	

+ 6 - 0
modules/std/filesystem/filesystem.monkey2

@@ -908,6 +908,12 @@ Opens a file that can be used with the 'C' calls fopen, fread, fwrite and fclose
 Function OpenCFile:FILE Ptr( path:String,mode:String )
 	
 	path=FixFilePath( path )
+
+	Select mode
+	Case "r" mode="rb"
+	Case "w" mode="wb"
+	Case "rw" mode="r+b"
+	End
 	
 #If __TARGET__="android"
 	If path.StartsWith( "${ASSETS}/" )