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
+16 -16
View File
@@ -3,9 +3,9 @@ package edit2d
import b2 "vendor:box2d"
import "core:fmt"
static_index :: i32
Static_Index :: i32
static_index_global :: struct
Static_Index_Global :: struct
{
index : i32,
level : string,
@@ -20,7 +20,7 @@ static_index_global :: struct
*/
engine_entity_flags_enum :: enum u64 {
Engine_Entity_Flags_Enum :: enum u64 {
POLYGON_IS_BOX,
MULTI_BODIES,
CHAIN,
@@ -28,9 +28,9 @@ engine_entity_flags_enum :: enum u64 {
MULTI_SHAPES,
}
engine_entity_flags :: bit_set[engine_entity_flags_enum]
Engine_Entity_Flags :: bit_set[Engine_Entity_Flags_Enum]
engine_entity_def :: struct {
Engine_Entity_Def :: struct {
body_def : b2.BodyDef,
shape_def : b2.ShapeDef,
shape_type : b2.ShapeType,
@@ -44,9 +44,9 @@ engine_entity_def :: struct {
vertices : [dynamic; b2.MAX_POLYGON_VERTICES]b2.Vec2,
name_buf : [255]u8 `fmt:"-" cbor:"-"`,
entity_flags : engine_entity_flags,
entity_flags : Engine_Entity_Flags,
index : static_index,
index : Static_Index,
//For chain bodies
//It will replicate itself to the body count and connect themselves with rev_joints
@@ -58,9 +58,9 @@ engine_entity_def :: struct {
link_length_array : [dynamic]b2.Vec2,
}
default_engine_entity_def :: proc() -> engine_entity_def
default_engine_entity_def :: proc() -> Engine_Entity_Def
{
ret : engine_entity_def
ret : Engine_Entity_Def
ret.body_def = b2.DefaultBodyDef()
ret.shape_def = b2.DefaultShapeDef()
ret.shape_type = .polygonShape
@@ -85,7 +85,7 @@ default_engine_entity_def :: proc() -> engine_entity_def
}
compare_engine_entity_def :: proc(a, b : engine_entity_def) -> bool
compare_engine_entity_def :: proc(a, b : Engine_Entity_Def) -> bool
{
ret := false
@@ -122,14 +122,14 @@ engine_entity :: struct {
bodies : [dynamic]b2.BodyId,
shapes : [dynamic]b2.ShapeId,
joints : [dynamic]b2.JointId,
entity_flags : engine_entity_flags,
index : ^static_index,
entity_flags : Engine_Entity_Flags,
index : ^Static_Index,
joint_id : b2.JointId,
}
engine_entity_single_body :: proc(def : ^engine_entity_def, world_id: b2.WorldId, index : i32) -> engine_entity
engine_entity_single_body :: proc(def : ^Engine_Entity_Def, world_id: b2.WorldId, index : i32) -> engine_entity
{
def := def
@@ -139,7 +139,7 @@ engine_entity_single_body :: proc(def : ^engine_entity_def, world_id: b2.WorldId
if def.index != 0
{
new_entity.index = new(static_index)
new_entity.index = new(Static_Index)
new_entity.index^ = def.index
}
@@ -267,7 +267,7 @@ engine_entity_single_body :: proc(def : ^engine_entity_def, world_id: b2.WorldId
}
engine_create_chain_shape :: proc(
def : ^engine_entity_def,
def : ^Engine_Entity_Def,
world_id : b2.WorldId,
index : i32
) -> engine_entity
@@ -308,7 +308,7 @@ engine_create_chain_shape :: proc(
engine_create_entity :: proc(
def : ^engine_entity_def,
def : ^Engine_Entity_Def,
world_id : b2.WorldId,
index : i32
) -> engine_entity