Commit eb1273c5 authored by Minjae Song's avatar Minjae Song

migration wip java 9 modularise

parent 50c110f3
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<property name="caretWidth" class="java.lang.Integer" /> <property name="caretWidth" class="java.lang.Integer" />
</properties> </properties>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>
\ No newline at end of file
File added
File added
module terrarum {
requires gdx;
requires gdx.backend.lwjgl;
requires gdx.controllers;
requires jxinput;
requires gson;
requires GetCpuName;
requires TerrarumSansBitmap;
requires kotlin.stdlib;
requires java.desktop;
requires java.logging;
requires TerranVirtualDisk;
requires commons.codec;
requires commons.csv;
requires Terrarum.Joise;
}
\ No newline at end of file
package net.torvald.colourutil package net.torvald.colourutil
import com.badlogic.gdx.graphics.Color
import com.jme3.math.FastMath import com.jme3.math.FastMath
import net.torvald.colourutil.CIELChabUtil.toLCh import net.torvald.colourutil.CIELChabUtil.toLCh
import net.torvald.colourutil.CIELChabUtil.toLab import net.torvald.colourutil.CIELChabUtil.toLab
...@@ -7,7 +8,6 @@ import net.torvald.colourutil.CIELabUtil.toLab ...@@ -7,7 +8,6 @@ import net.torvald.colourutil.CIELabUtil.toLab
import net.torvald.colourutil.CIEXYZUtil.toXYZ import net.torvald.colourutil.CIEXYZUtil.toXYZ
import net.torvald.colourutil.CIEXYZUtil.toColor import net.torvald.colourutil.CIEXYZUtil.toColor
import net.torvald.colourutil.CIELabUtil.toXYZ import net.torvald.colourutil.CIELabUtil.toXYZ
import com.badlogic.gdx.graphics.Color
/** /**
* Cylindrical modification of CIELab colour space * Cylindrical modification of CIELab colour space
* *
......
package net.torvald.colourutil package net.torvald.colourutil
import com.badlogic.gdx.graphics.Color
import com.jme3.math.FastMath import com.jme3.math.FastMath
import net.torvald.colourutil.CIELabUtil.toLab import net.torvald.colourutil.CIELabUtil.toLab
import net.torvald.colourutil.CIEXYZUtil.toColor import net.torvald.colourutil.CIEXYZUtil.toColor
import net.torvald.colourutil.CIEXYZUtil.toRGB import net.torvald.colourutil.CIEXYZUtil.toRGB
import net.torvald.colourutil.CIEXYZUtil.toXYZ import net.torvald.colourutil.CIEXYZUtil.toXYZ
import net.torvald.colourutil.CIELabUtil.toXYZ import net.torvald.colourutil.CIELabUtil.toXYZ
import com.badlogic.gdx.graphics.Color
/** /**
* A modification of CIEXYZ that is useful for surface colours * A modification of CIEXYZ that is useful for surface colours
......
...@@ -2,7 +2,6 @@ package net.torvald.colourutil ...@@ -2,7 +2,6 @@ package net.torvald.colourutil
import com.jme3.math.FastMath import com.jme3.math.FastMath
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import net.torvald.colourutil.CIELabUtil.toXYZ
import net.torvald.colourutil.CIEXYZUtil.toColor import net.torvald.colourutil.CIEXYZUtil.toColor
import net.torvald.colourutil.CIEXYZUtil.toRGB import net.torvald.colourutil.CIEXYZUtil.toRGB
import net.torvald.colourutil.CIEXYZUtil.toXYZ import net.torvald.colourutil.CIEXYZUtil.toXYZ
......
package com.badlogic.gdx.graphics; package net.torvald.gdx.graphics;
import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.utils.StreamUtils; import com.badlogic.gdx.utils.StreamUtils;
import java.io.IOException; import java.io.IOException;
......
...@@ -5,23 +5,15 @@ import com.badlogic.gdx.Gdx ...@@ -5,23 +5,15 @@ import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Screen import com.badlogic.gdx.Screen
import com.badlogic.gdx.backends.lwjgl.LwjglApplication import com.badlogic.gdx.backends.lwjgl.LwjglApplication
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.Texture import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.math.Affine2
import com.jme3.math.FastMath
import net.torvald.colourutil.CIEYXY
import net.torvald.colourutil.CIEXYZUtil.toXYZ
import net.torvald.colourutil.CIEXYZUtil.toColorRaw import net.torvald.colourutil.CIEXYZUtil.toColorRaw
import net.torvald.colourutil.CIEXYZUtil.toColor import net.torvald.colourutil.CIEXYZUtil.toXYZ
import net.torvald.colourutil.RGB import net.torvald.colourutil.CIEYXY
import net.torvald.terrarum.gameworld.fmod
import net.torvald.terrarum.inUse import net.torvald.terrarum.inUse
import java.awt.BorderLayout
import java.awt.Dimension import java.awt.Dimension
import javax.swing.* import javax.swing.*
import kotlin.math.pow
const val WIDTH = 1200 const val WIDTH = 1200
......
...@@ -6,9 +6,9 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplication ...@@ -6,9 +6,9 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplication
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.PixmapIO2
import com.badlogic.gdx.graphics.Texture import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.gdx.graphics.PixmapIO2
import net.torvald.terrarum.gdxClearAndSetBlend import net.torvald.terrarum.gdxClearAndSetBlend
import net.torvald.terrarum.inUse import net.torvald.terrarum.inUse
import java.awt.BorderLayout import java.awt.BorderLayout
...@@ -258,7 +258,7 @@ class SpriteAssemblerPreview: Game() { ...@@ -258,7 +258,7 @@ class SpriteAssemblerPreview: Game() {
renderTexture = Texture(1, 1, Pixmap.Format.RGBA8888) renderTexture = Texture(1, 1, Pixmap.Format.RGBA8888)
} }
private val bgCol = Color(.62f,.79f,1f,1f) private val bgCol = Color(.62f, .79f, 1f, 1f)
private var doAssemble = false private var doAssemble = false
private lateinit var assembleProp: ADProperties private lateinit var assembleProp: ADProperties
......
...@@ -19,6 +19,7 @@ import com.github.strikerx3.jxinput.XInputDevice; ...@@ -19,6 +19,7 @@ import com.github.strikerx3.jxinput.XInputDevice;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive; import com.google.gson.JsonPrimitive;
import net.torvald.gdx.graphics.PixmapIO2;
import net.torvald.getcpuname.GetCpuName; import net.torvald.getcpuname.GetCpuName;
import net.torvald.terrarum.controller.GdxControllerAdapter; import net.torvald.terrarum.controller.GdxControllerAdapter;
import net.torvald.terrarum.controller.TerrarumController; import net.torvald.terrarum.controller.TerrarumController;
...@@ -255,8 +256,8 @@ public class AppLoader implements ApplicationListener { ...@@ -255,8 +256,8 @@ public class AppLoader implements ApplicationListener {
public static TextureRegion logo; public static TextureRegion logo;
public static AudioDevice audioDevice; public static AudioDevice audioDevice;
private Color gradWhiteTop = new Color(0xf8f8f8ff); private com.badlogic.gdx.graphics.Color gradWhiteTop = new com.badlogic.gdx.graphics.Color(0xf8f8f8ff);
private Color gradWhiteBottom = new Color(0xd8d8d8ff); private com.badlogic.gdx.graphics.Color gradWhiteBottom = new com.badlogic.gdx.graphics.Color(0xd8d8d8ff);
public Screen screen; public Screen screen;
public static int screenW = 0; public static int screenW = 0;
......
...@@ -7,7 +7,7 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration ...@@ -7,7 +7,7 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
import com.badlogic.gdx.graphics.* import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.ShaderProgram import com.badlogic.gdx.graphics.glutils.ShaderProgram
import com.jme3.math.FastMath import com.badlogic.gdx.graphics.Color
import net.torvald.terrarumsansbitmap.gdx.GameFontBase import net.torvald.terrarumsansbitmap.gdx.GameFontBase
/** /**
......
...@@ -10,6 +10,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont ...@@ -10,6 +10,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.badlogic.gdx.graphics.glutils.ShaderProgram import com.badlogic.gdx.graphics.glutils.ShaderProgram
import com.badlogic.gdx.graphics.Color
import net.torvald.terrarumsansbitmap.gdx.GameFontBase import net.torvald.terrarumsansbitmap.gdx.GameFontBase
......
package net.torvald.terrarum.blockproperties package net.torvald.terrarum.blockproperties
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.AppLoader import net.torvald.terrarum.AppLoader
import net.torvald.terrarum.AppLoader.printmsg import net.torvald.terrarum.AppLoader.printmsg
import net.torvald.terrarum.gameworld.FluidType import net.torvald.terrarum.gameworld.FluidType
...@@ -110,7 +110,7 @@ object BlockCodex { ...@@ -110,7 +110,7 @@ object BlockCodex {
prop.shadeColG = floatVal(record, "shdg") / LightmapRenderer.MUL_FLOAT prop.shadeColG = floatVal(record, "shdg") / LightmapRenderer.MUL_FLOAT
prop.shadeColB = floatVal(record, "shdb") / LightmapRenderer.MUL_FLOAT prop.shadeColB = floatVal(record, "shdb") / LightmapRenderer.MUL_FLOAT
prop.shadeColA = floatVal(record, "shduv") / LightmapRenderer.MUL_FLOAT prop.shadeColA = floatVal(record, "shduv") / LightmapRenderer.MUL_FLOAT
prop.opacity = Color(prop.shadeColR, prop.shadeColG, prop.shadeColB, prop.shadeColA) prop.opacity = Cvec(prop.shadeColR, prop.shadeColG, prop.shadeColB, prop.shadeColA)
prop.strength = intVal(record, "str") prop.strength = intVal(record, "str")
prop.density = intVal(record, "dsty") prop.density = intVal(record, "dsty")
...@@ -119,7 +119,7 @@ object BlockCodex { ...@@ -119,7 +119,7 @@ object BlockCodex {
prop.lumColG = floatVal(record, "lumg") / LightmapRenderer.MUL_FLOAT prop.lumColG = floatVal(record, "lumg") / LightmapRenderer.MUL_FLOAT
prop.lumColB = floatVal(record, "lumb") / LightmapRenderer.MUL_FLOAT prop.lumColB = floatVal(record, "lumb") / LightmapRenderer.MUL_FLOAT
prop.lumColA = floatVal(record, "lumuv") / LightmapRenderer.MUL_FLOAT prop.lumColA = floatVal(record, "lumuv") / LightmapRenderer.MUL_FLOAT
prop.internalLumCol = Color(prop.lumColR, prop.lumColG, prop.lumColB, prop.lumColA) prop.internalLumCol = Cvec(prop.lumColR, prop.lumColG, prop.lumColB, prop.lumColA)
prop.friction = intVal(record, "fr") prop.friction = intVal(record, "fr")
prop.viscosity = intVal(record, "vscs") prop.viscosity = intVal(record, "vscs")
......
package net.torvald.terrarum.blockproperties package net.torvald.terrarum.blockproperties
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
/** /**
* Created by minjaesong on 2016-02-16. * Created by minjaesong on 2016-02-16.
...@@ -17,7 +17,7 @@ class BlockProp { ...@@ -17,7 +17,7 @@ class BlockProp {
var shadeColB = 0f var shadeColB = 0f
var shadeColA = 0f var shadeColA = 0f
lateinit var opacity: Color lateinit var opacity: Cvec
var strength: Int = 0 var strength: Int = 0
var density: Int = 0 var density: Int = 0
...@@ -36,12 +36,12 @@ class BlockProp { ...@@ -36,12 +36,12 @@ class BlockProp {
var lumColG = 0f var lumColG = 0f
var lumColB = 0f var lumColB = 0f
var lumColA = 0f var lumColA = 0f
lateinit var internalLumCol: Color lateinit var internalLumCol: Cvec
/** /**
* @param luminosity * @param luminosity
*/ */
inline val luminosity: Color inline val luminosity: Cvec
get() = BlockPropUtil.getDynamicLumFunc(internalLumCol, dynamicLuminosityFunction) get() = BlockPropUtil.getDynamicLumFunc(internalLumCol, dynamicLuminosityFunction)
var drop: Int = 0 var drop: Int = 0
......
package net.torvald.terrarum.blockproperties package net.torvald.terrarum.blockproperties
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Color
import com.jme3.math.FastMath import com.jme3.math.FastMath
import net.torvald.gdx.graphics.Cvec
import net.torvald.random.HQRNG import net.torvald.random.HQRNG
import net.torvald.terrarum.Second import net.torvald.terrarum.Second
import net.torvald.terrarum.Terrarum import net.torvald.terrarum.Terrarum
...@@ -37,7 +37,7 @@ object BlockPropUtil { ...@@ -37,7 +37,7 @@ object BlockPropUtil {
} }
private fun getTorchFlicker(baseLum: Color): Color { private fun getTorchFlicker(baseLum: Cvec): Cvec {
val funcY = FastMath.interpolateCatmullRom(0.0f, flickerFuncX / flickerFuncDomain, val funcY = FastMath.interpolateCatmullRom(0.0f, flickerFuncX / flickerFuncDomain,
flickerP0, flickerP1, flickerP2, flickerP3 flickerP0, flickerP1, flickerP2, flickerP3
) )
...@@ -45,13 +45,13 @@ object BlockPropUtil { ...@@ -45,13 +45,13 @@ object BlockPropUtil {
return LightmapRenderer.alterBrightnessUniform(baseLum, funcY) return LightmapRenderer.alterBrightnessUniform(baseLum, funcY)
} }
private fun getSlowBreath(baseLum: Color): Color { private fun getSlowBreath(baseLum: Cvec): Cvec {
val funcY = FastMath.sin(FastMath.PI * breathFuncX / breathCycleDuration) * breathRange val funcY = FastMath.sin(FastMath.PI * breathFuncX / breathCycleDuration) * breathRange
return LightmapRenderer.alterBrightnessUniform(baseLum, funcY) return LightmapRenderer.alterBrightnessUniform(baseLum, funcY)
} }
private fun getPulsate(baseLum: Color): Color { private fun getPulsate(baseLum: Cvec): Cvec {
val funcY = FastMath.sin(FastMath.PI * pulsateFuncX / pulsateCycleDuration) * pulsateRange val funcY = FastMath.sin(FastMath.PI * pulsateFuncX / pulsateCycleDuration) * pulsateRange
return LightmapRenderer.alterBrightnessUniform(baseLum, funcY) return LightmapRenderer.alterBrightnessUniform(baseLum, funcY)
...@@ -91,7 +91,7 @@ object BlockPropUtil { ...@@ -91,7 +91,7 @@ object BlockPropUtil {
private fun linearInterpolation1D(a: Float, b: Float, x: Float) = a * (1 - x) + b * x private fun linearInterpolation1D(a: Float, b: Float, x: Float) = a * (1 - x) + b * x
fun getDynamicLumFunc(baseLum: Color, type: Int): Color { fun getDynamicLumFunc(baseLum: Cvec, type: Int): Cvec {
return when (type) { return when (type) {
1 -> getTorchFlicker(baseLum) 1 -> getTorchFlicker(baseLum)
2 -> (Terrarum.ingame!!.world).globalLight.cpy().mul(LightmapRenderer.DIV_FLOAT) // current global light 2 -> (Terrarum.ingame!!.world).globalLight.cpy().mul(LightmapRenderer.DIV_FLOAT) // current global light
......
package net.torvald.terrarum.console package net.torvald.terrarum.console
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.worlddrawer.LightmapRenderer
import net.torvald.terrarum.Terrarum import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.modulebasegame.Ingame
import net.torvald.terrarum.modulebasegame.weather.WeatherMixer import net.torvald.terrarum.modulebasegame.weather.WeatherMixer
import net.torvald.terrarum.worlddrawer.LightmapRenderer
/** /**
* Created by minjaesong on 2016-02-17. * Created by minjaesong on 2016-02-17.
...@@ -18,7 +17,7 @@ internal object SetGlobalLightOverride : ConsoleCommand { ...@@ -18,7 +17,7 @@ internal object SetGlobalLightOverride : ConsoleCommand {
val g = args[2].toFloat() val g = args[2].toFloat()
val b = args[3].toFloat() val b = args[3].toFloat()
val a = args[4].toFloat() val a = args[4].toFloat()
val GL = Color(r, g, b, a) val GL = Cvec(r, g, b, a)
WeatherMixer.globalLightOverridden = true WeatherMixer.globalLightOverridden = true
(Terrarum.ingame!!.world).globalLight = GL (Terrarum.ingame!!.world).globalLight = GL
......
package net.torvald.terrarum.gameactors package net.torvald.terrarum.gameactors
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
/** /**
* Created by minjaesong on 2016-02-19. * Created by minjaesong on 2016-02-19.
...@@ -26,7 +26,7 @@ interface Luminous { ...@@ -26,7 +26,7 @@ interface Luminous {
actorValue[AVKey.LUMA] = value.a * LightmapRenderer.MUL_FLOAT actorValue[AVKey.LUMA] = value.a * LightmapRenderer.MUL_FLOAT
} }
*/ */
var color: Color var color: Cvec
/** /**
* Arguments: * Arguments:
......
package net.torvald.terrarum.gameworld package net.torvald.terrarum.gameworld
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.AppLoader.printdbg import net.torvald.terrarum.AppLoader.printdbg
import net.torvald.terrarum.Terrarum import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.blockproperties.Block import net.torvald.terrarum.blockproperties.Block
...@@ -90,7 +90,7 @@ open class GameWorld { ...@@ -90,7 +90,7 @@ open class GameWorld {
/** Meter per second squared. Currently only the downward gravity is supported. No reverse gravity :p */ /** Meter per second squared. Currently only the downward gravity is supported. No reverse gravity :p */
var gravitation: Vector2 = Vector2(0.0, 9.80665) var gravitation: Vector2 = Vector2(0.0, 9.80665)
/** 0.0..1.0+ */ /** 0.0..1.0+ */
var globalLight = Color(0f,0f,0f,0f) var globalLight = Cvec(0f, 0f, 0f, 0f)
var averageTemperature = 288f // 15 deg celsius; simulates global warming var averageTemperature = 288f // 15 deg celsius; simulates global warming
......
...@@ -5,6 +5,7 @@ import com.badlogic.gdx.InputAdapter ...@@ -5,6 +5,7 @@ import com.badlogic.gdx.InputAdapter
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.* import net.torvald.terrarum.*
import net.torvald.terrarum.blockproperties.Block import net.torvald.terrarum.blockproperties.Block
import net.torvald.terrarum.blockproperties.BlockCodex import net.torvald.terrarum.blockproperties.BlockCodex
...@@ -279,7 +280,7 @@ class BuildingMaker(batch: SpriteBatch) : IngameInstance(batch) { ...@@ -279,7 +280,7 @@ class BuildingMaker(batch: SpriteBatch) : IngameInstance(batch) {
init { init {
gameWorld.time.setTimeOfToday(WorldTime.HOUR_SEC * 10) gameWorld.time.setTimeOfToday(WorldTime.HOUR_SEC * 10)
gameWorld.globalLight = Color(.8f,.8f,.8f,.8f) gameWorld.globalLight = Cvec(.8f, .8f, .8f, .8f)
essentialOverlays.add(blockPointingCursor) essentialOverlays.add(blockPointingCursor)
......
...@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch ...@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.badlogic.gdx.utils.Disposable import com.badlogic.gdx.utils.Disposable
import com.badlogic.gdx.utils.ScreenUtils import com.badlogic.gdx.utils.ScreenUtils
import net.torvald.gdx.graphics.PixmapIO2
import net.torvald.terrarum.* import net.torvald.terrarum.*
import net.torvald.terrarum.gameactors.ActorWithBody import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gamecontroller.KeyToggler import net.torvald.terrarum.gamecontroller.KeyToggler
......
package net.torvald.terrarum.modulebasegame.gameactors package net.torvald.terrarum.modulebasegame.gameactors
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Color
import com.jme3.math.FastMath import com.jme3.math.FastMath
import net.torvald.gdx.graphics.Cvec
import net.torvald.spriteanimation.HasAssembledSprite import net.torvald.spriteanimation.HasAssembledSprite
import net.torvald.terrarum.* import net.torvald.terrarum.*
import net.torvald.terrarum.gameactors.* import net.torvald.terrarum.gameactors.*
...@@ -68,8 +68,8 @@ open class ActorHumanoid( ...@@ -68,8 +68,8 @@ open class ActorHumanoid(
if (houseDesignation != null) houseDesignation!!.clear() if (houseDesignation != null) houseDesignation!!.clear()
} }
override var color: Color override var color: Cvec
get() = Color( get() = Cvec(
(actorValue.getAsFloat(AVKey.LUMR) ?: 0f) / LightmapRenderer.MUL_FLOAT, (actorValue.getAsFloat(AVKey.LUMR) ?: 0f) / LightmapRenderer.MUL_FLOAT,
(actorValue.getAsFloat(AVKey.LUMG) ?: 0f) / LightmapRenderer.MUL_FLOAT, (actorValue.getAsFloat(AVKey.LUMG) ?: 0f) / LightmapRenderer.MUL_FLOAT,
(actorValue.getAsFloat(AVKey.LUMB) ?: 0f) / LightmapRenderer.MUL_FLOAT, (actorValue.getAsFloat(AVKey.LUMB) ?: 0f) / LightmapRenderer.MUL_FLOAT,
......
...@@ -2,9 +2,7 @@ package net.torvald.terrarum.modulebasegame.gameactors ...@@ -2,9 +2,7 @@ package net.torvald.terrarum.modulebasegame.gameactors
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap import com.badlogic.gdx.graphics.Pixmap
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gameworld.toUint import net.torvald.terrarum.gameworld.toUint
import net.torvald.terrarum.modulebasegame.Ingame
import java.io.File import java.io.File
import java.nio.charset.Charset import java.nio.charset.Charset
import java.util.* import java.util.*
...@@ -99,9 +97,9 @@ object DecodeTapestry { ...@@ -99,9 +97,9 @@ object DecodeTapestry {
private fun Int.fourBitCol() = Color( private fun Int.fourBitCol() = Color(
this.and(0xF00).shl(20) or this.and(0xF00).shl(16) or this.and(0xF00).shl(20) or this.and(0xF00).shl(16) or
this.and(0x0F0).shl(16) or this.and(0x0F0).shl(12) or this.and(0x0F0).shl(16) or this.and(0x0F0).shl(12) or
this.and(0x00F).shl(12) or this.and(0x00F).shl(8) or this.and(0x00F).shl(12) or this.and(0x00F).shl(8) or
0xFF 0xFF
) )
val MAGIC = "TEAF".toByteArray(charset = Charset.forName("US-ASCII")) val MAGIC = "TEAF".toByteArray(charset = Charset.forName("US-ASCII"))
......
package net.torvald.terrarum.modulebasegame.gameactors package net.torvald.terrarum.modulebasegame.gameactors
import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.ModMgr import net.torvald.terrarum.ModMgr
import net.torvald.terrarum.blockproperties.Block import net.torvald.terrarum.blockproperties.Block
import net.torvald.terrarum.blockproperties.BlockCodex import net.torvald.terrarum.blockproperties.BlockCodex
...@@ -15,7 +15,7 @@ import java.util.* ...@@ -15,7 +15,7 @@ import java.util.*
*/ */
internal class FixtureTikiTorch : FixtureBase(BlockBox(BlockBox.NO_COLLISION, 1, 2)), Luminous { internal class FixtureTikiTorch : FixtureBase(BlockBox(BlockBox.NO_COLLISION, 1, 2)), Luminous {
override var color: Color override var color: Cvec
get() = BlockCodex[Block.TORCH].luminosity get() = BlockCodex[Block.TORCH].luminosity
set(value) { set(value) {
throw UnsupportedOperationException() throw UnsupportedOperationException()
......
...@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color ...@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.Terrarum import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gameactors.ActorWBMovable import net.torvald.terrarum.gameactors.ActorWBMovable
import net.torvald.terrarum.gameworld.GameWorld
import net.torvald.terrarum.modulebasegame.worldgenerator.RoguelikeRandomiser import net.torvald.terrarum.modulebasegame.worldgenerator.RoguelikeRandomiser
/** /**
......
...@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.gameactors ...@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.gameactors
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.gdx.graphics.Cvec
import net.torvald.terrarum.Point2d import net.torvald.terrarum.Point2d
import net.torvald.terrarum.Terrarum import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.blockproperties.Block import net.torvald.terrarum.blockproperties.Block
...@@ -31,8 +32,8 @@ open class ProjectileSimple( ...@@ -31,8 +32,8 @@ open class ProjectileSimple(
val speed: Int val speed: Int
override var color: Color override var color: Cvec
get() = (bulletDatabase[type][OFFSET_LUMINOSITY] as Color).cpy() get() = (bulletDatabase[type][OFFSET_LUMINOSITY] as Cvec).cpy()
set(value) { set(value) {
} }
/** /**
...@@ -118,8 +119,8 @@ open class ProjectileSimple( ...@@ -118,8 +119,8 @@ open class ProjectileSimple(
val OFFSET_LUMINOSITY = 4 val OFFSET_LUMINOSITY = 4
val bulletDatabase = arrayOf( val bulletDatabase = arrayOf(
// damage, display colour, no gravity, speed // damage, display colour, no gravity, speed
arrayOf(7, Color(0xFF5429_FF.toInt()), true, 40, 32), arrayOf(7, Cvec(0xFF5429_FF.toInt()), true, 40, 32),
arrayOf(8, Color(0xFF5429_FF.toInt()), true, 20, 0)