-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for virtual filesystems through IOSystem (#10)
Remove some LWJGL, IOSystem, fixed collada, Fixed transcription errors in bone weights handling
- Loading branch information
1 parent
cbe8588
commit d885454
Showing
24 changed files
with
238 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
.idea/ | ||
.idea/ | ||
out | ||
build | ||
.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package assimp | ||
|
||
import java.io.* | ||
|
||
class DefaultIOSystem : IOSystem{ | ||
override fun exists(pFile: String) = File(pFile).exists() | ||
|
||
override fun open(pFile: String): IOStream { | ||
var file = File(pFile) | ||
println(File(".").absolutePath) | ||
if(!file.exists()) | ||
throw IOException("File doesn't exist: "+pFile) | ||
|
||
|
||
return FileIOStream(file) | ||
} | ||
|
||
class FileIOStream(val file: File) : IOStream{ | ||
override fun read() = FileInputStream(file) | ||
|
||
override fun reader() = BufferedReader(FileReader(file)) | ||
|
||
override val path: String | ||
get() = file.absolutePath | ||
|
||
override val filename: String | ||
get() = file.name | ||
|
||
override fun parentPath() = file.parentFile.absolutePath | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package assimp | ||
|
||
import java.io.BufferedReader | ||
import java.io.InputStream | ||
import java.io.Reader | ||
|
||
interface IOStream { | ||
val path : String | ||
|
||
val filename: String | ||
|
||
fun read() : InputStream | ||
|
||
fun reader() : BufferedReader | ||
|
||
fun parentPath() : String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package assimp | ||
|
||
import java.io.File | ||
|
||
/** Interface to the file system. */ | ||
interface IOSystem { | ||
fun exists(pFile: String): Boolean | ||
|
||
fun open(pFile : String): IOStream | ||
|
||
fun close(ioStream: IOStream) = Unit //unused ? | ||
|
||
fun getOsSeperator() = File.separator | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.