Temporal fix to collision detector — Full quantisation of float-point hitboxes. "Jump to teleport to ceiling" was my shit

Former-commit-id: a3421b000b9ecf71ca5f03f79f11658cf57a17db
Former-commit-id: e4e540ed339161d3c89228077f217fcb57d01c06
This commit is contained in:
Song Minjae
2016-03-02 01:20:22 +09:00
parent 9eb5b00a95
commit 630f0c6118
25 changed files with 141 additions and 171 deletions

View File

@@ -23,9 +23,14 @@ def getB40(raw):
def intFromCol(r, g, b):
return r * MUL_2 + g * MUL + b
return int(r * MUL_2 + g * MUL + b)
def intFromRGB24(r24, g24, b24):
roundR = round(r24 / 255.0 * 39)
roundG = round(g24 / 255.0 * 39)
roundB = round(b24 / 255.0 * 39)
return intFromCol(roundR, roundG, roundB)
def colFromNum(raw):
return getR40(raw), getG40(raw), getB40(raw)
print(colFromNum(9979))
print(intFromCol(3,5,9))
print(intFromRGB24(255, 164, 78))