Optimization: Rendpolys are no longer allocated on the stack each and every time they are needed. Added a rendpoly allocation mechanism which allows the same rendpolys to be re-used whenever possible. Number of vertices are also allocated dynamically at this time, this meant I was able to remove the RL_MAX_POLY_SIDES limit. Note, the number of verts is still stored as a byte in rendpoly_t so we have a hard limit of 255 verts now. Rendpoly wall data is now allocated dynamically and only for rendpolys which are to be used as walls. These changes should result in a noticeable speed boost in-game.
Optimization: Rendpolys are no longer allocated on the stack each and every time they are needed. Added a rendpoly allocation mechanism which allows the same rendpolys to be re-used whenever possible.
Number of vertices are also allocated dynamically at this time, this meant I was able to remove the RL_MAX_POLY_SIDES limit. Note, the number of verts is still stored as a byte in rendpoly_t so we have a hard limit of 255 verts now.
Rendpoly wall data is now allocated dynamically and only for rendpolys which are to be used as walls.
These changes should result in a noticeable speed boost in-game.