Change Naming Convention, add scroll to microui

This commit is contained in:
SamratGhale
2026-03-28 13:42:24 +05:45
parent a74b46cd64
commit c1b64e9066
12 changed files with 90 additions and 97 deletions
+12 -12
View File
@@ -18,13 +18,13 @@ import draw "./draw"
A Typical level code
*/
engine_world :: struct {
Engine_World :: struct {
world_id : b2.WorldId,
//This in engine code?
static_indexes : map[static_index]int `cbor:"-"`,
relations : map[^static_index][dynamic]static_index_global `cbor:"-"`,
relations_serializeable : map[ static_index][dynamic]static_index_global,
static_indexes : map[Static_Index]int `cbor:"-"`,
relations : map[^Static_Index][dynamic]Static_Index_Global `cbor:"-"`,
relations_serializeable : map[ Static_Index][dynamic]Static_Index_Global,
/*
@@ -67,7 +67,7 @@ cbor_flags : cbor.Encoder_Flags :
level_load_from_files :: proc(
$G, $L, $E: typeid,
game: ^G,
state: ^engine_state
state: ^Engine_State
)
{
files, err := os.read_all_directory_by_path("levels", context.allocator)
@@ -103,11 +103,11 @@ level_init_from_path :: proc(
$T, $E: typeid,
level_data : ^T,
path : string,
state: ^engine_state,
state: ^Engine_State,
) -> (ret : bool)
{
level := cast(^engine_world)level_data
level := cast(^Engine_World)level_data
if os.is_file(path)
{
@@ -118,7 +118,7 @@ level_init_from_path :: proc(
//?
level.relations = {}
level.relations = make(map[^static_index][dynamic]static_index_global)
level.relations = make(map[^Static_Index][dynamic]Static_Index_Global)
if len(data) > 0
{
@@ -261,10 +261,10 @@ level_reload :: proc($T: typeid, $E: typeid, level: ^T)
If both hash is same the exits
*/
level_save_to_file :: proc(level_data: ^$T, state: ^engine_state)
level_save_to_file :: proc(level_data: ^$T, state: ^Engine_State)
{
level := cast(^engine_world)level_data
level := cast(^Engine_World)level_data
level_path := fmt.tprintf("levels/%s.cbor", level.name)
level.cam = state.draw.cam
@@ -370,11 +370,11 @@ level_save_to_file :: proc(level_data: ^$T, state: ^engine_state)
/*
The engine assumes that it has attribute entities
*/
game_to_engine_entities :: proc($Game: typeid, game_data: ^Game, state: ^engine_state)
game_to_engine_entities :: proc($Game: typeid, game_data: ^Game, state: ^Engine_State)
{
level := &game_data.levels[game_data.curr_level]
interface : ^interface_state = &game_data.interface
interface : ^Interface_State = &game_data.interface
clear(&interface.entities)
clear(&interface.entity_defs)