From 657e09ecf2fe49dc214711e52076b8b87d2aa90b Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Wed, 5 Aug 2026 08:09:32 +0200 Subject: [PATCH] Formatting and cleanup. --- src/events.odin | 1 - src/game.odin | 2 +- src/main.odin | 58 ++++++++++++++++++++++++------------------------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/events.odin b/src/events.odin index f23010e..bfd9f36 100644 --- a/src/events.odin +++ b/src/events.odin @@ -1,6 +1,5 @@ package game -import "core:fmt" import rl "vendor:raylib" game_poll_events :: proc() -> Actions { diff --git a/src/game.odin b/src/game.odin index 01f18b6..6474e31 100644 --- a/src/game.odin +++ b/src/game.odin @@ -112,7 +112,7 @@ game_draw :: proc(game: ^Game) { // draw objects draw_enemies(&game.enemies, game.enemy_count) draw_player(&game.player) - + // @ DEBUG debug_bounds(game) debug_camera_draw(&game.camera, game.debug.camera_active) diff --git a/src/main.odin b/src/main.odin index 9ab02fa..998d0cb 100644 --- a/src/main.odin +++ b/src/main.odin @@ -12,44 +12,44 @@ WINDOW_WIDTH :: 1920 WINDOW_HEIGHT :: 1080 GAME_WIDTH :: 480 GAME_HEIGHT :: 270 -MAX_ENEMIES :: 0 +MAX_ENEMIES :: 35 MAX_PROPS :: 64 TILE_SIZE :: 32 // ----------------------------------------------------------------------------- main :: proc() { - context.logger = log.create_console_logger() - defer log.destroy_console_logger(context.logger) + context.logger = log.create_console_logger() + defer log.destroy_console_logger(context.logger) - when DEBUG_MODE { - track: mem.Tracking_Allocator - mem.tracking_allocator_init(&track, context.allocator) - defer mem.tracking_allocator_destroy(&track) - context.allocator = mem.tracking_allocator(&track) - } + when DEBUG_MODE { + track: mem.Tracking_Allocator + mem.tracking_allocator_init(&track, context.allocator) + defer mem.tracking_allocator_destroy(&track) + context.allocator = mem.tracking_allocator(&track) + } - game := game_init() + game := game_init() - for game_should_run(&game) { - game_update(&game) - game_draw(&game) - } + for game_should_run(&game) { + game_update(&game) + game_draw(&game) + } - game_close(&game) + game_close(&game) - when DEBUG_MODE { - if len(track.allocation_map) > 0 { - log.errorf("\nMEMORY LEAKS: %v allocation(s)", len(track.allocation_map)) - for _, entry in track.allocation_map { - log.errorf(" %v bytes @ %v", entry.size, entry.location) - } - } - if len(track.bad_free_array) > 0 { - log.errorf("\nBAD FREES: %v", len(track.bad_free_array)) - for entry in track.bad_free_array { - log.errorf(" %v @ %v", entry.memory, entry.location) - } - } - } + when DEBUG_MODE { + if len(track.allocation_map) > 0 { + log.errorf("\nMEMORY LEAKS: %v allocation(s)", len(track.allocation_map)) + for _, entry in track.allocation_map { + log.errorf(" %v bytes @ %v", entry.size, entry.location) + } + } + if len(track.bad_free_array) > 0 { + log.errorf("\nBAD FREES: %v", len(track.bad_free_array)) + for entry in track.bad_free_array { + log.errorf(" %v @ %v", entry.memory, entry.location) + } + } + } }