mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 08:36:07 +09:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user