colorutil update, some code cleanup

Former-commit-id: 47b13e7e899dc9151f7a1ae71977ed8d4b403345
Former-commit-id: 136f9c787b76aec75d76535891cf264170bd3b04
This commit is contained in:
Song Minjae
2017-01-15 20:51:42 +09:00
parent e7276513d7
commit 1f1e2f6899
17 changed files with 227 additions and 168 deletions

View File

@@ -274,8 +274,8 @@ open class ActorWithBody : Actor() {
/**
* @param w
* @param h
* @param tx +: translate drawn sprite to LEFT.
* @param ty +: translate drawn sprite to DOWN.
* @param tx positive: translate drawn sprite to LEFT.
* @param ty positive: translate drawn sprite to DOWN.
* @see ActorWithBody.drawBody
* @see ActorWithBody.drawGlow
*/
@@ -1180,6 +1180,7 @@ open class ActorWithBody : Actor() {
fun Double.floorInt() = Math.floor(this).toInt()
fun Float.floorInt() = FastMath.floor(this)
fun Float.floor() = FastMath.floor(this).toFloat()
fun Float.ceilInt() = FastMath.ceil(this)
fun Double.round() = Math.round(this).toDouble()
fun Double.floor() = Math.floor(this)

View File

@@ -232,6 +232,9 @@ internal class AILuaAPI(g: Globals, actor: ActorWithBody) {
if (radius < 0) {
return LuaValue.NONE
}
else if (radius > 8) {
throw IllegalArgumentException("Radius too large -- must be 8 or less")
}
else {
val luatable = LuaTable()
val feetTilePos = actor.feetPosTile