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.
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:
Showing markers in tile intersections from which you are able to build from
From there, show intersections to which one can build from there
Once clicked upon, add walls in-between the two points
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.
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.
Similar to adding objects and tiles the user can now also set/reset the wall types (read: wall papers) on either side of a piece of wall. This is slightly more complicated as in the case of tiles, as here both sides of a piece of wall have to be regarded individually. This change had effects on the shaders, the renderer, the World class, the SelectionState, the GameState and some other crowd favourites. What is, however, still missing though is the removal and placement of walls.