Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Android library for parsing and converting RenderWare dff and txd models of Grand Theft Auto.

License

NotificationsYou must be signed in to change notification settings

Lime-blur/rwparser

Repository files navigation

rwparser is an android library for parsing and converting RenderWare dff and txd models of Grand Theft Auto.

Gradle Dependency

Add this dependency to your module'sbuild.gradle file:

dependencies {..  implementation'com.github.Lime-blur:rwparser:latest_version'}

Add it in your root build.gradle at the end of repositories (or in settings.gradle):

dependencyResolutionManagement {  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)  repositories {    mavenCentral()    maven { url'https://jitpack.io' }  }}

Usage

Parsing

In order to parse a.dff file, you simply need to create aModelParser() object and call the appropriate method:

val modelParser=ModelParser()val parseResult= modelParser.putDffDumpIntoFile(inFilePath, outFilePath,/* optional*/true)

For asynchronous parsing, you need to call the appropriate function and bind ModelParser to the component's lifecycle:

classMainActivity :AppCompatActivity() {privatevar modelParser:ModelParser?=nulloverridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)..        modelParser=ModelParser()    }overridefunonDestroy() {        modelParser?.destroy()super.onDestroy()    }privatefunparse() {        modelParser?.putDffDumpIntoFileAsync(inFilePath, outFilePath,/* optional*/true) { parseResult->// Handling the callback        }    }}

Same for.txd file:

val modelParser=ModelParser()val parseResult= modelParser.putTxdDumpIntoFile(inFilePath, outFilePath)

For asynchronous.txd's parsing:

classMainActivity :AppCompatActivity() {privatevar modelParser:ModelParser?=nulloverridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)..        modelParser=ModelParser()    }overridefunonDestroy() {        modelParser?.destroy()super.onDestroy()    }privatefunparse() {        modelParser?.putTxdDumpIntoFileAsync(inFilePath, outFilePath) { parseResult->// Handling the callback        }    }}

Converting

The library can also convert.dff to.gltf format. To convert you need:

val modelParser=ModelParser()val parseResult= modelParser.convertDffToGltf(inDffFilePath, outFilePath,/* optional*/ inTxdFilePath,/* optional*/ viewType)

For asynchronous.dff's converting:

classMainActivity :AppCompatActivity() {privatevar modelParser:ModelParser?=nulloverridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)..        modelParser=ModelParser()    }overridefunonDestroy() {        modelParser?.destroy()super.onDestroy()    }privatefunconvert() {        modelParser?.convertDffToGltfAsync(dffFilePath, gltfFilePath,/* optional*/ txdFilePath,/* optional*/ viewType) { parseResult->// Handling the callback        }    }}

See the sample application, where an example of using the library is implemented:https://github.com/Lime-blur/rwparser/tree/main/sample

Rights

About

Android library for parsing and converting RenderWare dff and txd models of Grand Theft Auto.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp