forked from Hugobros3/chunkstories
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore unimplemented renderers in OpenGL backend.
- Loading branch information
Showing
4 changed files
with
67 additions
and
62 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
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,51 @@ | ||
package xyz.chunkstories.client | ||
|
||
import xyz.chunkstories.graphics.GraphicsBackendsEnum | ||
import xyz.chunkstories.util.VersionInfo | ||
import kotlin.system.exitProcess | ||
|
||
fun main(launchArguments: Array<String>) { | ||
val argumentsMap = mutableMapOf<String, String>() | ||
for (launchArgument in launchArguments) { | ||
if (launchArgument.startsWith("--")) { | ||
val stripped = launchArgument.removePrefix("--") | ||
|
||
if (launchArgument.contains('=')) { | ||
val firstIndex = stripped.indexOf('=') | ||
val argName = stripped.substring(0, firstIndex) | ||
val argValue = stripped.substring(firstIndex + 1, stripped.length).removeSurrounding("\"") | ||
|
||
argumentsMap[argName] = argValue | ||
} else { | ||
argumentsMap[stripped] = "true" | ||
} | ||
} else { | ||
println("Unrecognized launch argument: $launchArgument") | ||
} | ||
} | ||
|
||
if (argumentsMap["help"] != null) { | ||
printHelp() | ||
exitProcess(0) | ||
} | ||
|
||
ClientImplementation(argumentsMap) | ||
} | ||
|
||
private fun printHelp() { | ||
println(""" | ||
Chunk Stories Client version: ${VersionInfo.versionJson.verboseVersion} | ||
Available commandline options: | ||
--core=... Specifies the folder/file to use as the base content | ||
--mods=... Specifies some mods to load | ||
--backend=[${GraphicsBackendsEnum.values()}] Forces a specific backend to be used. | ||
Backend-specific options: | ||
Vulkan-specific options: | ||
--enableValidation Enables the validation layers | ||
OpenGL-specific options: | ||
""".trimIndent()) | ||
} |
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