From 843edde55306e3fbdb5e37ef9b7c09c7b53f50c4 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 24 Feb 2024 13:17:07 +0000 Subject: Added GUIScrollbar and GFXCorneredTileSupportingTexture --- .../openvic-extension/classes/GFXSpriteTexture.cpp | 26 +--------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'extension/src/openvic-extension/classes/GFXSpriteTexture.cpp') diff --git a/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp b/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp index e002461..41bea4b 100644 --- a/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp +++ b/extension/src/openvic-extension/classes/GFXSpriteTexture.cpp @@ -24,15 +24,11 @@ void GFXSpriteTexture::_bind_methods() { OV_BIND_METHOD(GFXSpriteTexture::get_icon_index); OV_BIND_METHOD(GFXSpriteTexture::get_icon_count); - OV_BIND_METHOD(GFXSpriteTexture::is_cornered_tile_texture); - OV_BIND_METHOD(GFXSpriteTexture::draw_rect_cornered, { "to_canvas_item", "rect" }); - ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_index"), "set_icon_index", "get_icon_index"); } GFXSpriteTexture::GFXSpriteTexture() - : gfx_texture_sprite { nullptr }, icon_index { GFX::NO_FRAMES }, icon_count { GFX::NO_FRAMES }, - cornered_tile_texture { false }, cornered_tile_border_size {} {} + : gfx_texture_sprite { nullptr }, icon_index { GFX::NO_FRAMES }, icon_count { GFX::NO_FRAMES } {} Ref GFXSpriteTexture::make_gfx_sprite_texture(GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon) { Ref texture; @@ -47,7 +43,6 @@ void GFXSpriteTexture::clear() { _clear_button_states(); icon_index = GFX::NO_FRAMES; icon_count = GFX::NO_FRAMES; - cornered_tile_texture = false; cornered_tile_border_size = {}; } @@ -84,10 +79,8 @@ Error GFXSpriteTexture::set_gfx_texture_sprite(GFX::TextureSprite const* new_gfx GFX::CorneredTileTextureSprite const* const cornered_tile_texture_sprite = gfx_texture_sprite->cast_to(); if (cornered_tile_texture_sprite != nullptr) { - cornered_tile_texture = true; cornered_tile_border_size = Utilities::to_godot_ivec2(cornered_tile_texture_sprite->get_border_size()); } else { - cornered_tile_texture = false; cornered_tile_border_size = {}; } } @@ -140,20 +133,3 @@ Error GFXSpriteTexture::set_icon_index(int32_t new_icon_index) { _update_button_states(); return OK; } - -void GFXSpriteTexture::draw_rect_cornered(RID const& to_canvas_item, Rect2 const& rect) const { - const Ref atlas_texture = get_atlas(); - if (atlas_texture.is_valid()) { - if (cornered_tile_texture) { - RenderingServer* rendering_server = RenderingServer::get_singleton(); - if (rendering_server != nullptr) { - rendering_server->canvas_item_add_nine_patch( - to_canvas_item, rect, { {}, atlas_texture->get_size() }, atlas_texture->get_rid(), - cornered_tile_border_size, atlas_texture->get_size() - cornered_tile_border_size - ); - } - } else { - draw_rect(to_canvas_item, rect, false); - } - } -} -- cgit v1.2.3-56-ga3b1