Refactored the renderer to use fixed point math and wrote a loader for .obj files. Around 320 triangles at 23 fps (without Mirror recording), all Lua.

Planet by Liz Reddington [CC-BY] via Poly Pizza

#playdate

@markuslatvala fixed-point in Lua? 😱
Sounds… fun
@scoopr It's just integer math really, but the dynamic typing certainly doesn't help.
@markuslatvala I might forgotten the little Lua I knew, but I see to recall that there was a single number type, which is double, akin to JS, but perhaps there is a fast path for integers? But also that the bit-ops were somehow cumbersome, though perhaps I was just unfamiliar with them, coming from C family of languages.
@scoopr In Lua 5.4 the numbers are internally double, int or uint depending on the last operation. Bitwise operators are actually pretty standard, but you obviously have to guess the underlying type. Binary buffers on the other hand are really funky as you operate them through strings.
@markuslatvala @scoopr TIL Lua has hidden integer arithmetics

@markuslatvala @scoopr
> Binary buffers on the other hand are really funky as you operate them through strings.

Are you still sure that Lua is the optimal way to make what you’re doing? :/

@boozook @scoopr Of course it's not 😅