post vet cleanup

This commit is contained in:
Synthasmagoria 2026-09-15 15:18:25 +02:00
commit 67e37e2a3d
5 changed files with 8 additions and 19 deletions

View file

@ -189,7 +189,7 @@ animation_draw :: proc(animation: ^Animation, global_transform: mat3, mode: Anim
transform := linalg.identity(mat3)
matrices := slice.reinterpret([]mat3, animation.matrices[:animation.matrix_count * 9])
for mat, i in matrices {
transform *= mat
transform = mat * transform
rectangles[i + 1] = rectangle_corners_transform_mat3(transform, animation.shapes.rectangle)
}
if animation.matrix_count == 0 {

View file

@ -1,7 +1,6 @@
package game
import rl "libraries/raylib"
import "base:runtime"
WINDOW_WIDTH :: 1280
WINDOW_HEIGHT :: 720

View file

@ -333,8 +333,6 @@ matrix_pool_get_mat3 :: proc() -> (value_strings: []InputFloatField, values: []f
matrix_move_to :: proc(floats: []f32, inputs: []InputFloatField, from, to: int) {
if from == to do return
floats := program.matrix_float_pool
inputs := program.matrix_value_string_pool
floats_values_size := size_of(f32) * 9
inputs_buffer_size := size_of(InputFloatField) * 9
floats_moving_matrix := &floats[from * 9]
@ -460,7 +458,6 @@ program_get_master_matrix :: proc() -> mat3 {
program_set_animation_state :: proc(state: ProgramAnimationState) {
if program.animation_state == state do return
previous_state := program.animation_state
program.animation_state = state
switch program.animation_state {
case .Ready:
@ -817,9 +814,7 @@ program_build_workspace_ui :: proc(ctx: ^ui.Context) -> (elements: []ui.Element,
top_bar_inner_height := ui.get_element_inner_area(top_bar_container^).height
top_bar_button_width := ui.Size_Pixels(top_bar_inner_height)
top_bar_button_dimensions := ui.Dimensions {top_bar_button_width, ui.Size_Percentage(1.0)}
top_bar_button_config := ui.ElementConfiguration {margin = top_bar_element_margin}
top_bar_dropdown_dimensions := ui.Dimensions {ui.Size_Pixels(160.0), ui.Size_Percentage(1.0)}
top_bar_dropdown_config := ui.ElementConfiguration {margin = top_bar_element_margin}
{
button_margin := top_bar_element_margin
button_config: ui.ElementConfiguration
@ -898,7 +893,6 @@ program_build_workspace_ui :: proc(ctx: ^ui.Context) -> (elements: []ui.Element,
ui.same_line()
ui.element(.Divider, divider_dimensions, divider_config)
play_button_label: cstring
button_data = new(UiElementData_Button, context.temp_allocator)
switch program.animation_state {
case .Ready:
@ -1054,7 +1048,6 @@ program_handle_mouse :: proc(mouse_state: MouseState, top_bar_container, matrix_
break state_label
}
draggable := program.mouse_current_draggable
position := matrix3_transform_xy(world_to_grid_matrix, mouse)
drag_to_position := matrix3_transform_xy(world_to_grid_matrix, mouse)
if program.grid_snap {
grid_line_sep := grid_get_line_separation(program.grid.zoom, program.grid.cell_size_px)
@ -1133,8 +1126,7 @@ program_render_ui_and_handle_focus :: proc(ctx: ^ui.Context, focus_element_id: u
animation_matrix_index := animation_get_eased_progress(program.animation)
matrix_animation_distance := element_matrix_index - animation_matrix_index
alpha := max(0.0, 1.0 - abs(matrix_animation_distance))
color := rl.Color{128, 255, 128, u8(alpha * 64.0)}
rl.DrawRectangleRec(area, color)
rl.DrawRectangleRec(area, rl.Color{128, 255, 128, u8(alpha * 64.0)})
matrix_area := ui.rect_grow(ui.rect2(area), element.margin / 2.0)
tl, tr, br, bl := ui.rect_get_corners(matrix_area)
@ -1281,7 +1273,7 @@ program_render_ui_and_handle_focus :: proc(ctx: ^ui.Context, focus_element_id: u
rl.DrawRectangleRec(rect2(ui.get_element_outer_area(element)), color)
case .ToggleGroup:
data := cast(^UiElementData_ToggleGroup)element.data
tooltips := strings.string_from_ptr(transmute(^byte)element.tooltip, len(element.tooltip))
tooltips := strings.string_from_ptr(cast(^byte)element.tooltip, len(element.tooltip))
area_individual := area
area_individual.width /= f32(strings.count(tooltips, ";") + 1)
mouse := rl.GetMousePosition()
@ -1384,8 +1376,7 @@ ui_mat3 :: proc(idx: int, mat: []f32, value_strings: []InputFloatField, dimensio
}
ui_labeled_input_float_element :: proc(label: cstring, margin: f32, value: ^f32, value_string: ^InputFloatField, allocator := context.temp_allocator) -> ^ui.Element {
label := fmt.ctprintf("%s: ", label)
label_element := ui.element(.Label, {}, {label = label, color = ui.col(rl.WHITE), margin = margin})
label_element := ui.element(.Label, {}, {label = fmt.ctprintf("%s: ", label), color = ui.col(rl.WHITE), margin = margin})
dimensions := ui.Dimensions{ui.Size_Pixels(64.0), ui.dimensions_pixels(ui.rect_get_size(ui.get_element_outer_area(label_element^))).height}
ui.same_line()
input_data := new(UiElementData_FloatInput, context.temp_allocator)
@ -1394,8 +1385,7 @@ ui_labeled_input_float_element :: proc(label: cstring, margin: f32, value: ^f32,
}
ui_labeled_input_text_element :: proc(label: cstring, margin: f32, str: []byte, allocator := context.temp_allocator) -> ^ui.Element {
label := fmt.ctprintf("%s: ", label)
label_element := ui.element(.Label, {}, {label = label, color = ui.col(rl.WHITE), margin = margin})
label_element := ui.element(.Label, {}, {label = fmt.ctprintf("%s: ", label), color = ui.col(rl.WHITE), margin = margin})
dimensions := ui.Dimensions{ui.Size_Pixels(224.0), ui.dimensions_pixels(ui.rect_get_size(ui.get_element_outer_area(label_element^))).height}
ui.same_line()
input_data := new(UiElementData_TextInput, context.temp_allocator)

View file

@ -47,7 +47,7 @@ _project_read :: proc(project: ^ProjectData, path: string) -> ProjectReadError {
r := io.to_reader(os.to_stream(f))
header := PROJECT_DATA_HEADER
header_buffer: [len(PROJECT_DATA_HEADER)]byte
if num, err := io.read_full(r, header_buffer[:]); err != nil {
if _, err := io.read_full(r, header_buffer[:]); err != nil {
return ProjectReadErrorType.FailedReadingHeader
}
if mem.compare(transmute([]byte)header, header_buffer[:]) != 0 {

View file

@ -132,7 +132,7 @@ V2_DOWN :: v2{0.0, 1.0}
/// ### ENUM STRINGIFICATION ### ///
enum_to_raygui_options_string :: proc($T: typeid, allocator: mem.Allocator) -> cstring where IS_ENUM(T) {
b := strings.builder_make(allocator)
for element, i in T {
for element in T {
option := fmt.aprint(element, allocator = allocator)
fmt.sbprint(&b, strings.to_ada_case(option, allocator), ";", sep = "")
}