Temporary resolution change and fixes

This commit is contained in:
2026-04-26 13:21:04 +02:00
parent a66a0a1e07
commit b31bbd9391
3 changed files with 7 additions and 12 deletions

View File

@@ -3,9 +3,9 @@ package common
import rl "vendor:raylib"
// Screen Width
WIDTH :: 1920
WIDTH :: 1366
// Screen Height
HEIGHT :: 1080
HEIGHT :: 768
// Default Monitor
MONITOR :: 0

View File

@@ -37,7 +37,10 @@ handle_mouse_input :: proc(self: ^Simulator, pos: rl.Vector2) {
// Handles left click functionality
@(private="file")
left_click_event :: proc(self: ^Simulator, pos: rl.Vector2) {
demolish_road(self)
if road, ok := self.highlighted_road.?; ok && self.delete_mode {
delete_road(self, road)
return
}
create_road(self, pos)
}

View File

@@ -41,14 +41,6 @@ update :: proc(self: ^Simulator, pos: rl.Vector2) {
update_highlighted_road(self, pos)
}
// Implementation of removing the road after a click has been registered
@private
demolish_road :: proc(self: ^Simulator) {
if !self.delete_mode do return
if road, ok := self.highlighted_road.?; ok do delete_road(self, road)
}
// Implementation of road building after a click has been registered
@private
create_road :: proc(self: ^Simulator, pos: rl.Vector2) {
@@ -156,7 +148,7 @@ add_road :: proc(self: ^Simulator, start: u32, end: u32) {
}
// Deletes the road which index was sent in, alongside deleting references of said road and removal of nodes if that road was their only connection
@(private="file")
@private
delete_road :: proc(self: ^Simulator, road_to_delete: u32) {
// First we need to unreference this road from surrounding nodes and then delete those nodes IF this was the last road connection
road := self.roads[road_to_delete]