From 43821b0cffc5aa419c0218992f06f8962ae54a13 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Wed, 8 May 2024 17:56:29 -0300 Subject: refa Rename graphical engine to BluCat --- src/static_model.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/static_model.cpp') diff --git a/src/static_model.cpp b/src/static_model.cpp index eb9e4c9..3dd0c10 100644 --- a/src/static_model.cpp +++ b/src/static_model.cpp @@ -20,12 +20,12 @@ #include "static_mesh.hpp" #include "texture.hpp" #include "vector_3d.hpp" -#include "vk/static_model.hpp" +#include "blucat/static_model.hpp" void cg_free_static_model(mrb_state *mrb, void *obj) { - auto ptr = static_cast*>(obj); + auto ptr = static_cast*>(obj); ptr->~shared_ptr(); mrb_free(mrb, ptr); @@ -37,23 +37,23 @@ const struct mrb_data_type cg_static_model_type = { static mrb_value cg_cStaticModel_initialize(mrb_state *mrb, mrb_value self) { - std::shared_ptr *static_mesh; - std::shared_ptr *texture; + std::shared_ptr *static_mesh; + std::shared_ptr *texture; std::shared_ptr *position; std::shared_ptr *orientation; - std::shared_ptr *ptr; + std::shared_ptr *ptr; mrb_get_args( mrb, "dddd", &static_mesh, &cg_static_mesh_type, &texture, &cg_texture_type, &position, &cg_vector_3d_type, &orientation, &cg_orientation_3d_type); - ptr = (std::shared_ptr*)DATA_PTR(self); + ptr = (std::shared_ptr*)DATA_PTR(self); if(ptr) mrb_free(mrb, ptr); - ptr = (std::shared_ptr*)mrb_malloc( - mrb, sizeof(std::shared_ptr)); + ptr = (std::shared_ptr*)mrb_malloc( + mrb, sizeof(std::shared_ptr)); - new(ptr)std::shared_ptr( - std::make_shared( + new(ptr)std::shared_ptr( + std::make_shared( *static_mesh, *texture, *position, *orientation)); mrb_data_init(self, ptr, &cg_static_model_type); @@ -63,7 +63,7 @@ cg_cStaticModel_initialize(mrb_state *mrb, mrb_value self) static mrb_value cg_cStaticModel_set_orientation(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); + auto ptr = (std::shared_ptr*)DATA_PTR(self); std::shared_ptr *orientation; mrb_get_args(mrb, "d", &orientation, &cg_orientation_3d_type); @@ -75,7 +75,7 @@ cg_cStaticModel_set_orientation(mrb_state *mrb, mrb_value self) static mrb_value cg_cStaticModel_set_position(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); + auto ptr = (std::shared_ptr*)DATA_PTR(self); std::shared_ptr *position; mrb_get_args(mrb, "d", &position, &cg_vector_3d_type); @@ -87,8 +87,8 @@ cg_cStaticModel_set_position(mrb_state *mrb, mrb_value self) static mrb_value cg_cStaticModel_set_texture(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); - std::shared_ptr *texture; + auto ptr = (std::shared_ptr*)DATA_PTR(self); + std::shared_ptr *texture; mrb_get_args(mrb, "d", &texture, &cg_texture_type); (*ptr)->texture = *texture; @@ -99,7 +99,7 @@ cg_cStaticModel_set_texture(mrb_state *mrb, mrb_value self) static mrb_value cg_cStaticModel_draw(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); + auto ptr = (std::shared_ptr*)DATA_PTR(self); auto &instances = cg_core.vk_renderer->static_models_to_draw[ cg_core.vk_swapchain->current_frame][(*ptr)->static_mesh]; -- cgit v1.2.3