Compare commits
No commits in common. "cf61dcf39c38d6404775c65b03443501eff21b59" and "23359f2fef04640bc236e41cf760060049401901" have entirely different histories.
cf61dcf39c
...
23359f2fef
@ -17,8 +17,8 @@ static func create_meta_accessor(file_accessors:Array[VFileAccess])->VFileAccess
|
|||||||
var accum:Array[String] = []
|
var accum:Array[String] = []
|
||||||
accum.assign(
|
accum.assign(
|
||||||
file_accessors.reduce(
|
file_accessors.reduce(
|
||||||
(func _merge_files(total:Array, current:VFileAccess)->Array:
|
(func _merge_files(total:Array[String], current:VFileAccess)->Array[String]:
|
||||||
var res:Array = total.duplicate()
|
var res:Array[String] = total.duplicate()
|
||||||
for file:String in current.get_files_at(path):
|
for file:String in current.get_files_at(path):
|
||||||
if not file in total:
|
if not file in total:
|
||||||
res.append(file)
|
res.append(file)
|
||||||
@ -171,13 +171,13 @@ static func create_bulk_readonly_zip_access(
|
|||||||
vfiler._get_files_at = func(path:String)->Array[String]:
|
vfiler._get_files_at = func(path:String)->Array[String]:
|
||||||
if not path.ends_with("/"): # TODO ensure no // as well because that can be problem.
|
if not path.ends_with("/"): # TODO ensure no // as well because that can be problem.
|
||||||
path += "/" # sorry for the mutation
|
path += "/" # sorry for the mutation
|
||||||
var accum:Array = []
|
var accum:Array[String] = []
|
||||||
accum.assign( readers.reduce(
|
accum.assign( readers.reduce(
|
||||||
(func _merge_files(total:Array, current:ZIPReader)->Array:
|
(func _merge_files(total:Array[String], current:ZIPReader)->Array[String]:
|
||||||
var res:Array = total.duplicate()
|
var res:Array[String] = total.duplicate()
|
||||||
var filtered:Array = []
|
var filtered:Array = []
|
||||||
filtered.assign(current.get_files())
|
filtered.assign(current.get_files())
|
||||||
filtered = filtered.filter(
|
filtered.filter(
|
||||||
func _filter_dir(curpath:String)->bool:
|
func _filter_dir(curpath:String)->bool:
|
||||||
return curpath.begins_with(path))
|
return curpath.begins_with(path))
|
||||||
for file:String in filtered:
|
for file:String in filtered:
|
||||||
@ -186,8 +186,6 @@ static func create_bulk_readonly_zip_access(
|
|||||||
if not file in total and not stripped_file.contains("/"):
|
if not file in total and not stripped_file.contains("/"):
|
||||||
res.append(file)
|
res.append(file)
|
||||||
return res) ,[]))
|
return res) ,[]))
|
||||||
var out_accum:Array[String] = []
|
return accum
|
||||||
out_accum.assign(accum)
|
|
||||||
return out_accum
|
|
||||||
|
|
||||||
return vfiler
|
return vfiler
|
||||||
|
2
vfs.gd
2
vfs.gd
@ -94,7 +94,7 @@ func load_supported(path:String, ext_override:String = "")->Variant:
|
|||||||
|
|
||||||
var buffer := get_buffer(path)
|
var buffer := get_buffer(path)
|
||||||
var result:Variant = supported_files[ext].call(buffer)
|
var result:Variant = supported_files[ext].call(buffer)
|
||||||
if not is_instance_valid(result) and result is not String:
|
if not is_instance_valid(result):
|
||||||
push_warning("%s loader tried loading '%s' but received null. Does the file exist?"
|
push_warning("%s loader tried loading '%s' but received null. Does the file exist?"
|
||||||
% [ext, abs_path])
|
% [ext, abs_path])
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ static func load_mp3(buffer:PackedByteArray)->AudioStreamMP3:
|
|||||||
return sfx
|
return sfx
|
||||||
|
|
||||||
static func load_ogg(buffer:PackedByteArray)->AudioStreamOggVorbis:
|
static func load_ogg(buffer:PackedByteArray)->AudioStreamOggVorbis:
|
||||||
return AudioStreamOggVorbis.load_from_buffer(buffer)
|
var sfx := AudioStreamOggVorbis.new()
|
||||||
|
sfx.load_from_buffer(buffer)
|
||||||
|
return sfx
|
||||||
|
|
||||||
static func load_txt(buffer:PackedByteArray)->String:
|
static func load_txt(buffer:PackedByteArray)->String:
|
||||||
var txt:String = buffer.get_string_from_utf8()
|
var txt:String = buffer.get_string_from_utf8()
|
||||||
|
Loading…
Reference in New Issue
Block a user