minor edits

This commit is contained in:
minjaesong
2018-12-02 17:34:01 +09:00
parent 54087db2e8
commit 24b03403f7
3 changed files with 53 additions and 43 deletions

View File

@@ -31,6 +31,7 @@ import org.lwjgl.BufferUtils
import org.lwjgl.input.Controllers import org.lwjgl.input.Controllers
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import net.torvald.getcpuname.GetCpuName
@@ -206,6 +207,8 @@ object Terrarum : Screen {
val systemArch = System.getProperty("os.arch") val systemArch = System.getProperty("os.arch")
val processor = GetCpuName.getModelName()
val processorVendor = GetCpuName.getCPUID()
val is32BitJVM = !System.getProperty("sun.arch.data.model").contains("64") val is32BitJVM = !System.getProperty("sun.arch.data.model").contains("64")
@@ -250,12 +253,17 @@ object Terrarum : Screen {
printdbg(this, "os.arch = $systemArch") // debug info println("os.arch = $systemArch") // debug info
if (is32BitJVM) { if (is32BitJVM) {
printdbgerr(this, "32 Bit JVM detected") printdbgerr(this, "32 Bit JVM detected")
} }
println("processor = $processor")
println("vendor = $processorVendor")
joypadLabelStart = when (getConfigString("joypadlabelstyle")) { joypadLabelStart = when (getConfigString("joypadlabelstyle")) {
"nwii" -> 0xE04B.toChar() // + mark "nwii" -> 0xE04B.toChar() // + mark
"logitech" -> 0xE05A.toChar() // number 10 "logitech" -> 0xE05A.toChar() // number 10
@@ -317,9 +325,9 @@ object Terrarum : Screen {
testTexture = Texture(Gdx.files.internal("./assets/test_texture.tga")) testTexture = Texture(Gdx.files.internal("./assets/test_texture.tga"))
printdbg(this, "GL_VERSION = $GL_VERSION") println("GL_VERSION = $GL_VERSION")
printdbg(this, "GL_MAX_TEXTURE_SIZE = $GL_MAX_TEXTURE_SIZE") println("GL_MAX_TEXTURE_SIZE = $GL_MAX_TEXTURE_SIZE")
printdbg(this, "GL info:\n${Gdx.graphics.glVersion.debugVersionString}") // debug info println("GL info:\n${Gdx.graphics.glVersion.debugVersionString}") // debug info
if (GL_VERSION < MINIMAL_GL_VERSION || GL_MAX_TEXTURE_SIZE < MINIMAL_GL_MAX_TEXTURE_SIZE) { if (GL_VERSION < MINIMAL_GL_VERSION || GL_MAX_TEXTURE_SIZE < MINIMAL_GL_MAX_TEXTURE_SIZE) {
@@ -530,9 +538,9 @@ object Terrarum : Screen {
defaultSaveDir = defaultDir + "/Saves" defaultSaveDir = defaultDir + "/Saves"
configDir = defaultDir + "/config.json" configDir = defaultDir + "/config.json"
printdbg(this, "os.name = $OSName (with identifier $OperationSystem)") println("os.name = $OSName (with identifier $OperationSystem)")
printdbg(this, "os.version = $OSVersion") println("os.version = $OSVersion")
printdbg(this, "default directory: $defaultDir") println("default directory: $defaultDir")
} }
private fun createDirs() { private fun createDirs() {

View File

@@ -4,48 +4,48 @@ package net.torvald.terrarum.modulebasegame.gameworld
typealias time_t = Long typealias time_t = Long
/** /**
* The World Calendar implementation of Dwarven Calendar, except:
* - the year begins with Mondag instead of Sundag (which is ISO standard)
* - the first month is Opal instead of Granite (to reduce confusion)
*
*
* Please also see: * Please also see:
* https://en.wikipedia.org/wiki/World_Calendar * https://en.wikipedia.org/wiki/World_Calendar
* http://dwarffortresswiki.org/index.php/DF2014:Calendar
* *
* And there is no AM/PM concept, 24-hour clock is forced; no leap years. * There is no AM/PM concept, 24-hour clock is forced; no leap years.
* An ingame day should last 22 real-life minutes. * An ingame day should last 22 real-life minutes.
* *
* // TODO 4-month year? like Stardew Valley * ## The Yearly Calendar
* *
* The Yearly Calendar * A calendar tailored to this very game. A year is consisted of 4 seasons (month),
* and each season last fixed length of 30 days, leap years does not occur.
* *
* A calendar tailored to this very game. A year is consisted of 4 seasons (month), * =========================
* and each season last fixed length of 30 days, leap years does not occur. * |Mo|Ty|Mi|To|Fr|La|Su|Ve|
* |--|--|--|--|--|--|--|--|
* | 1| 2| 3| 4| 5| 6| 7| | <- Spring
* | 8| 9|10|11|12|13|14| |
* |15|16|17|18|19|20|21| |
* |22|23|24|25|26|27|28| |
* |29|30| 1| 2| 3| 4| 5| | <- Summer
* | 6| 7| 8| 9|10|11|12| |
* |13|14|15|16|17|18|19| |
* |20|21|22|23|24|25|26| |
* |27|28|29|30| 1| 2| 3| | <- Autumn
* | 4| 5| 6| 7| 8| 9|10| |
* |11|12|13|14|15|16|17| |
* |18|19|20|21|22|23|24| |
* |25|26|27|28|29|30| 1| | <- Winter
* | 2| 3| 4| 5| 6| 7| 8| |
* | 9|10|11|12|13|14|15| |
* |16|17|18|19|20|21|22| |
* |23|24|25|26|27|28|29|30|
* =========================
* *
* ========================= * - A year is 120 days, 8th day of the week (Verddag, Winter 30th) does occur as in The World calendar.
* |Mo|Ty|Mi|To|Fr|La|Su|Ve| * - Starting day of the week is monday (Mondag).
* |--|--|--|--|--|--|--|--| * - Spring 1st is the New Year holiday, Winter 30th is the New Year's Eve holiday.
* | 1| 2| 3| 4| 5| 6| 7| | * - Human-readable date format is always Year-MonthName-Date, no matter where you (the real-life you) come from.
* | 8| 9|10|11|12|13|14| | * For number-only format, months are enumerated from 1.
* |15|16|17|18|19|20|21| | * (Spring-1, Summer-2, Autumn-3, Winter-4) E.g. 0125-Wint-07, or 0125-04-07. For more details, please refer to the
* |22|23|24|25|26|27|28| | * internal functions `getFormattedTime()`, `getShortTime()`, and `getFilenameTime()`
* |29|30| 1| 2| 3| 4| 5| | * - Preferred computerised date format is YearMonthDate. E.g. 01250407
* | 6| 7| 8| 9|10|11|12| | * - Rest of the format (e.g. time intervals) follows ISO 8601 standard.
* |13|14|15|16|17|18|19| |
* |20|21|22|23|24|25|26| |
* |27|28|29|30| 1| 2| 3| |
* | 4| 5| 6| 7| 8| 9|10| |
* |11|12|13|14|15|16|17| |
* |18|19|20|21|22|23|24| |
* |25|26|27|28|29|30| 1| |
* | 2| 3| 4| 5| 6| 7| 8| |
* | 9|10|11|12|13|14|15| |
* |16|17|18|19|20|21|22| |
* |23|24|25|26|27|28|29|30|
* =========================
*
* Verddag only appears on the last day of the year (30th winter)
* *
* (Check please:) * (Check please:)
* - Equinox/Solstice always occur on 21st day of the month * - Equinox/Solstice always occur on 21st day of the month
@@ -201,11 +201,13 @@ class WorldTime(initTime: Long = 0L) {
/** Format: "%A, %Y %B %d %X" */ /** Format: "%A, %Y %B %d %X" */
fun getFormattedTime() = "${getDayNameShort()}, " + fun getFormattedTime() = "${getDayNameShort()}, " +
"$years " + "$years " +
"${getMonthNameShort()} " + "${getMonthNameFull()} " +
"$days " + "$days " +
"${String.format("%02d", hours)}:" + "${String.format("%02d", hours)}:" +
"${String.format("%02d", minutes)}:" + "${String.format("%02d", minutes)}:" +
"${String.format("%02d", seconds)}" "${String.format("%02d", seconds)}"
fun getShortTime() = "${years.toString().padStart(4, '0')}-${getMonthNameShort()}-${days.toString().padStart(2, '0')}"
fun getFilenameTime() = "${years.toString().padStart(4, '0')}${months.toString().padStart(2, '0')}${days.toString().padStart(2, '0')}"
fun getDayNameFull() = DAY_NAMES[dayOfWeek] fun getDayNameFull() = DAY_NAMES[dayOfWeek]
fun getDayNameShort() = DAY_NAMES_SHORT[dayOfWeek] fun getDayNameShort() = DAY_NAMES_SHORT[dayOfWeek]

View File

@@ -60,7 +60,7 @@ class WorldInformationProvider(globals: Globals) {
"%x" -> "${String.format("%02d", time.years)}-${String.format("%02d", time.months)}-${String.format("%02d", time.days)}" "%x" -> "${String.format("%02d", time.years)}-${String.format("%02d", time.months)}-${String.format("%02d", time.days)}"
"%X" -> "${String.format("%02d", time.hours)}:${String.format("%02d", time.minutes)}:${String.format("%02d", time.seconds)}" "%X" -> "${String.format("%02d", time.hours)}:${String.format("%02d", time.minutes)}:${String.format("%02d", time.seconds)}"
"%Y" -> time.years.toString() "%Y" -> time.years.toString()
"%y" -> time.years.mod(100).toString() "%y" -> time.years.rem(100).toString()
"%%" -> "%" "%%" -> "%"
else -> throw IllegalArgumentException("Unknown format string: $this") else -> throw IllegalArgumentException("Unknown format string: $this")
} }