Additional comments
This commit is contained in:
@@ -2,19 +2,32 @@ package common
|
||||
|
||||
import rl "vendor:raylib"
|
||||
|
||||
// Screen Width
|
||||
WIDTH :: 1920
|
||||
// Screen Height
|
||||
HEIGHT :: 1080
|
||||
// Default Monitor
|
||||
MONITOR :: 0
|
||||
|
||||
// Thickness of the road being drawn
|
||||
ROAD_SIZE :: 20
|
||||
// Radius of the node
|
||||
NODE_RADIUS :: 20
|
||||
// Size of designated radius that determines when position is within node's 'sphere'
|
||||
NODE_SNAP_RADIUS :: 3
|
||||
// Default text size
|
||||
TEXT_SIZE :: 50
|
||||
|
||||
// Default road colour
|
||||
ROAD_COLOUR :: rl.BLACK
|
||||
// Node colour once it's fully built
|
||||
NODE_DONE_COLOUR :: rl.BROWN
|
||||
// Node colour while node is being built
|
||||
NODE_BUILD_COLOUR :: rl.GOLD
|
||||
// Node colour while being able to start building but not doing that yet
|
||||
NODE_CURSOR_COLOUR :: rl.BLUE
|
||||
// The colour of the overlay displaying the snap radius
|
||||
NODE_SNAP_COLOUR :: rl.PINK
|
||||
|
||||
// Background Colour
|
||||
BACKGROUND_COLOUR :: rl.LIGHTGRAY
|
||||
@@ -2,7 +2,10 @@ package common
|
||||
|
||||
import rl "vendor:raylib"
|
||||
|
||||
// Stores data about intersections
|
||||
Intersection_Data :: struct {
|
||||
// Index of the road that is intersected
|
||||
road: u32,
|
||||
// The exact point of intersection
|
||||
point: rl.Vector2,
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import inf "infrastructure"
|
||||
|
||||
// PLAN AREA
|
||||
// TODO implement deleting of roads
|
||||
// TODO text/debug
|
||||
// TODO full colour constant utilisation
|
||||
|
||||
Simulator :: struct {
|
||||
// Stores all nodes
|
||||
@@ -36,7 +38,12 @@ init :: proc() -> Simulator {
|
||||
// Destructor
|
||||
deinit :: proc(self: ^Simulator) {
|
||||
self.temp_node_index = nil
|
||||
|
||||
delete(self.roads)
|
||||
|
||||
for &node in self.nodes {
|
||||
inf.node_deinit(&node)
|
||||
}
|
||||
delete(self.nodes)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user