Remove pointer index, fix memoery leak in glyph

This commit is contained in:
SamratGhale
2026-03-29 06:34:00 +05:45
parent c1b64e9066
commit 06664f9f67
5 changed files with 47 additions and 57 deletions
+10 -39
View File
@@ -33,13 +33,13 @@ Edit_Mode :: enum
{
entity_defs : [dynamic]^Engine_Entity_Def,
entities : [dynamic]^Engine_Entity,
selected_entity : i32,
selected_entity : i32,
world : ^Engine_World,
state : ^Engine_State,
vertex_index : i32,
chain_index : ^i32,
chain_index : i32,
edit_mode : Edit_Mode,
curr_joint_index : i32,
@@ -97,38 +97,14 @@ mui_text_height :: proc(font: mu.Font) -> i32
{
interface.selected_entity = 0
interface.vertex_index = 0
interface.vertex_index^ = 0
interface.chain_index = new(i32)
interface.chain_index^ = 0
}
interface.chain_index = 0
}
mu_interface_game_mode :: proc(state: ^Engine_State, interface: ^Interface_State)
interface_draw_options :: proc(state: ^engine_state)
{
debug_draw := &state.debug_draw
im.SliderFloat("Zoom", &state.draw.cam.zoom, 0, 100)
im.Checkbox("Shapes", &debug_draw.drawShapes)
im.Checkbox("Joints", &debug_draw.drawJoints)
im.Checkbox("Joint Extras", &debug_draw.drawJointExtras)
im.Checkbox("Bounds", &debug_draw.drawBounds)
im.Checkbox("Contact Points", &debug_draw.drawContacts)
im.Checkbox("Contact Normals", &debug_draw.drawContactNormals)
im.Checkbox("Contact Inpulses", &debug_draw.drawContactImpulses)
im.Checkbox("Contact Features", &debug_draw.drawContactFeatures)
im.Checkbox("Friction Inpulses", &debug_draw.drawFrictionImpulses)
im.Checkbox("Mass ", &debug_draw.drawMass)
im.Checkbox("Body Names", &debug_draw.drawBodyNames)
im.Checkbox("Graph Colors", &debug_draw.drawGraphColors)
im.Checkbox("Islands ", &debug_draw.drawIslands)
im.SliderFloat("Rotation", &state.draw.cam.rotation, 0, 360)
}
*/
mu_interface_game_mode :: proc(state: ^Engine_State, interface: ^Interface_State)
{
width :i32 = 250
{
if mu.begin_window(&state.mu_ctx, "Edit Mode", {state.width - width, 0, width, 170})
{
for type in Edit_Mode
{
b : bool = interface.edit_mode == type
@@ -141,7 +117,7 @@ mu_interface_game_mode :: proc(state: ^Engine_State, interface: ^Interface_State
mu_interface_draw_options :: proc(state: ^Engine_State)
{
if mu.begin_window(&state.mu_ctx, "Options", {0, 150, 200, 400}){
debug_draw := &state.debug_draw
debug_draw := &state.debug_draw
mu.label(&state.mu_ctx, "Zoom")
mu.slider(&state.mu_ctx, &state.draw.cam.zoom,0, 100)
@@ -177,18 +153,15 @@ interface_all :: proc($E: typeid, interface: ^Interface_State, game_data : $G) -
}
state := interface.state
//if handle_input(E, interface.state, game_data) do return true
state := interface.state
mu.begin(&state.mu_ctx)
mu_interface_draw_options(interface.state)
mu_interface_draw_options(interface.state)
mu_interface_game_mode(state, interface)
width : i32 = 250
{
if mu.begin_window(&state.mu_ctx, "B2d Interface", {state.width - width, 170, width, 450}, { .NO_TITLE})
{
if interface.edit_mode == .ENTITY
{
@@ -203,9 +176,7 @@ interface_all :: proc($E: typeid, interface: ^Interface_State, game_data : $G) -
//if interface_joints(interface) do ret = true
mu.end(&state.mu_ctx)
mu.end(&state.mu_ctx)
return ret
return ret
}