add more mutex locks to fix a race condition
It seems to be the solution to many problems.
Ramblings about hobbyist game development
add more mutex locks to fix a race condition
It seems to be the solution to many problems.
initial wall building support
Mostly wires up the code from the previous commits and adds the logic for first selecting a starting point and then a target for a new wall.
But maybe a short videos says it better:
add a partial implementation of an algorithm that determines if a given position is a suitable build position (only checks for objects right now, misses the wall intersection check)
It does exactly that and also simplifies the vertex generation code quite a bite.
add skeleton for the wall placement mechanics
While not sounding particularly spectacular, quite a bit happened under the bonnet here.
The concept of specific BuildModes was introduced when inside the Build game mode (remember game modes?), so we always know how to handle input.
This also adds code to make the markers clickable. Furthermore, once in wall placement mode it will also draw the walls in the “lower” setting, so that you can actually see what you are doing. It will also draw the marks in a way to completely ignore drawing depth and just draw them on top of everything else, once again, so you can always see what is happening.
These SelectionIndicators, as they are called internally, also get a stub function so that we know where to draw them already, as you can tell, it does not do much yet.
bring the wall building marks closer to something workable
Building on the previous commit, this improves the vertex generation for the rendering markers, still does not add any logic that determines when and how to place them however.
– add render code and shaders for the wall build markers
– push coordinates and vertices data to render some examples
– rename the shaders to actually be more uniform
– improve the hash function for the walls (again), hopefullly for the last time (sic)
This is the first commit that brings in code for the build markers. The way that OLives deals with this task is done in three steps:
This commit added a lot of the boilerplate code to draw these markers to the renderer and the world, no logic has been added yet to actually determine when or where to draw them.
increase the wall state hash size to 64bit and improve the hashing function slightly
This obviously also means the way that the hash is generated changes. Since many different factors play a role in there (position, type, hover statuses in different colours) it tended to overlap beforehand, resulting in no visual changes even though one of these factors may have changed.
add function to completely remove walls
Now, besides changing the type of existing walls we support removing walls. In order to enable this function one keeps hitting the magical ‘o’ hotkey while in build mode due to lack of a UI.
fix conditions in shader that made selected dynamic objects transparent
We only want them to be slightly brighter, not transparent.
rename shader files to be more consistent
The models were a special case so far, since those were the first shaders be added.