aboutsummaryrefslogtreecommitdiff
path: root/src/player.zig
AgeCommit message (Collapse)Author
2021-10-10Refactor: extract rendering code from Player struct into Renderertslil clingman
Some bonus off by ones and rounding corrections
2021-10-10Off by ones!tslil clingman
2021-10-08Fixed some artefacts for walls with both lower and upper partstslil clingman
I can't quite explain it, but something about the way floating point numbers round meant that we weren't calculating consistent distances (in pixels) for the length of the strip between the top of the floor and the bottom of the ceiling in cells which had both.
2021-10-07Variable height ceilings!tslil clingman
Plus bonus graphical artefacts around the edges of such! In the end the majority of this code was rather easy: take the upwards floor drawing code and reflect it. However, there were many edge-cases and plenty of off-by-one pixels and rounding issues that didn't quite work the same way going down as they do going up. Also the object drawing code used to take advantage of the fact that the z-buffer was painted bottom-up only, so that required change too.
2021-09-26Of course i didn't need i32 ...tslil clingman
2021-09-22There was really no reason to use a BoundedArray instead of an arraytslil clingman
2021-09-22Switch to more accurate versiontslil clingman
Pre-emptive micro-optimisation is bad. There aren't that many sprites pixels usually anyway.
2021-09-22Colour blendingtslil clingman
Some amount of work went into finding appropriate integer arithmetic formulae that were reasonably accurate. At this point i've settled for the incorrect-but-faster version. The better-though-slower formulas are still there in case i change my mind. It would help to have an assumption such as, but not limited to, the surfaces are always going to be fully opaque.
2021-09-20Render objects by writing pixelstslil clingman
This confines hardware acceleration to scaling and the background sprite. Unfortunately it would seem that to do proper object rendering (partial transparency) i'll have to implement colour mixing myself.
2021-09-20Corrected rendering bugtslil clingman
2021-09-20Render walls by pixels, instead of using hard. accel. spritestslil clingman
2021-09-16Corrected movementtslil clingman