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/texture.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/texture.cpp') diff --git a/src/texture.cpp b/src/texture.cpp index 24cdc95..0bfac25 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 Frederico de Oliveira Linhares + * Copyright 2022-2024 Frederico de Oliveira Linhares * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ #include "core.hpp" #include "font.hpp" -#include "vk/texture.hpp" +#include "blucat/texture.hpp" void cg_free_texture(mrb_state *mrb, void* obj) { - auto *ptr = static_cast*>(obj); + auto *ptr = static_cast*>(obj); ptr->~shared_ptr(); mrb_free(mrb, ptr); @@ -48,15 +48,15 @@ cg_cTexture_from_image(mrb_state *mrb, mrb_value self) { struct mrb_value texture = texture_alloc(mrb, self); const char *file_path; - std::shared_ptr *ptr; + std::shared_ptr *ptr; mrb_get_args(mrb, "z", &file_path); - ptr = (std::shared_ptr*)DATA_PTR(texture); + ptr = (std::shared_ptr*)DATA_PTR(texture); if(ptr) mrb_free(mrb, ptr); - ptr = (std::shared_ptr*)mrb_malloc( - mrb, sizeof(std::shared_ptr)); - new(ptr)std::shared_ptr( - std::make_shared(file_path)); + ptr = (std::shared_ptr*)mrb_malloc( + mrb, sizeof(std::shared_ptr)); + new(ptr)std::shared_ptr( + std::make_shared(file_path)); mrb_data_init(texture, ptr, &cg_texture_type); return texture; @@ -68,17 +68,17 @@ cg_cTexture_from_text(mrb_state *mrb, mrb_value self) const char *text; unsigned int width, height; struct mrb_value texture = texture_alloc(mrb, self); - VK::Font *font_ptr; - std::shared_ptr *ptr; + BluCat::Font *font_ptr; + std::shared_ptr *ptr; mrb_get_args(mrb, "dz", &font_ptr, &cg_font_type, &text); - ptr = (std::shared_ptr*)DATA_PTR(texture); + ptr = (std::shared_ptr*)DATA_PTR(texture); if(ptr) mrb_free(mrb, ptr); - ptr = (std::shared_ptr*)mrb_malloc( - mrb, sizeof(std::shared_ptr)); - new(ptr)std::shared_ptr( - std::make_shared(font_ptr, text)); + ptr = (std::shared_ptr*)mrb_malloc( + mrb, sizeof(std::shared_ptr)); + new(ptr)std::shared_ptr( + std::make_shared(font_ptr, text)); mrb_data_init(texture, ptr, &cg_texture_type); return texture; @@ -87,14 +87,14 @@ cg_cTexture_from_text(mrb_state *mrb, mrb_value self) static mrb_value cg_cTexture_width(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); + auto ptr = (std::shared_ptr*)DATA_PTR(self); return mrb_int_value(mrb, (*ptr)->width); } static mrb_value cg_cTexture_height(mrb_state *mrb, mrb_value self) { - auto ptr = (std::shared_ptr*)DATA_PTR(self); + auto ptr = (std::shared_ptr*)DATA_PTR(self); return mrb_int_value(mrb, (*ptr)->height); } -- cgit v1.2.3