Bladeren bron

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

Mark Sibly 7 jaren geleden
bovenliggende
commit
c3643b0315
2 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 1 1
      modules/mojo/audio/audio.monkey2
  2. 6 0
      modules/std/filesystem/filesystem.monkey2

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

@@ -72,7 +72,7 @@ Class AudioDevice
 			finished()
 			finished()
 		End,True )
 		End,True )
 		
 		
-		Local file:=filesystem.OpenCFile( path,"rb" )
+		Local file:=filesystem.OpenCFile( path,"r" )
 		
 		
 		Local sampleRate:=playMusic( file,callback,channel._alSource )
 		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 )
 Function OpenCFile:FILE Ptr( path:String,mode:String )
 	
 	
 	path=FixFilePath( path )
 	path=FixFilePath( path )
+
+	Select mode
+	Case "r" mode="rb"
+	Case "w" mode="wb"
+	Case "rw" mode="r+b"
+	End
 	
 	
 #If __TARGET__="android"
 #If __TARGET__="android"
 	If path.StartsWith( "${ASSETS}/" )
 	If path.StartsWith( "${ASSETS}/" )