mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Fix 3.5 compilation after renderer reworking.
This commit is contained in:
parent
b8a2facf93
commit
1aed9a2aa4
@ -33,14 +33,14 @@
|
||||
#include "SpineSkeleton.h"
|
||||
#include "SpineRendererObject.h"
|
||||
#include "SpineSlotNode.h"
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "servers/rendering_server.h"
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
#include "core/config/engine.h"
|
||||
#include "core/math/geometry_2d.h"
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "servers/rendering_server.h"
|
||||
#else
|
||||
#include "core/engine.h"
|
||||
#endif
|
||||
@ -708,7 +708,9 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
||||
}
|
||||
|
||||
mesh_instance->renderer_object = renderer_object;
|
||||
#if VERSION > 3
|
||||
mesh_instance->indices_id = (uint64_t) indices;
|
||||
#endif
|
||||
spine::BlendMode blend_mode = slot->getData().getBlendMode();
|
||||
Ref<Material> custom_material;
|
||||
|
||||
@ -766,7 +768,12 @@ void SpineSprite::draw() {
|
||||
if (!animation_state.is_valid() && !skeleton.is_valid()) return;
|
||||
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) return;
|
||||
|
||||
#if VERSION > 3
|
||||
RS::get_singleton()->canvas_item_clear(this->get_canvas_item());
|
||||
#else
|
||||
VisualServer::get_singleton()->canvas_item_clear(this->get_canvas_item());
|
||||
#endif
|
||||
|
||||
auto mouse_position = get_local_mouse_position();
|
||||
spine::Slot *hovered_slot = nullptr;
|
||||
|
||||
@ -973,7 +980,6 @@ void SpineSprite::draw() {
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void SpineSprite::draw_bone(spine::Bone *bone, const Color &color) {
|
||||
|
||||
@ -55,6 +55,8 @@ protected:
|
||||
Vector<Color> colors;
|
||||
Vector<int> indices;
|
||||
SpineRendererObject *renderer_object;
|
||||
|
||||
#if VERSION > 3
|
||||
uint64_t last_indices_id;
|
||||
uint64_t indices_id;
|
||||
RID mesh;
|
||||
@ -65,14 +67,20 @@ protected:
|
||||
PackedByteArray attribute_buffer;
|
||||
uint32_t vertex_stride;
|
||||
uint32_t attribute_stride;
|
||||
#endif
|
||||
|
||||
public:
|
||||
#if VERSION > 3
|
||||
SpineMesh2D() : renderer_object(nullptr), last_indices_id(0), indices_id(0), num_vertices(0), num_indices(0), vertex_stride(0), attribute_stride(0){};
|
||||
~SpineMesh2D() {
|
||||
if (mesh.is_valid()) {
|
||||
RS::get_singleton()->free(mesh);
|
||||
}
|
||||
}
|
||||
#else
|
||||
SpineMesh2D() : renderer_object(nullptr){};
|
||||
~SpineMesh2D() {}
|
||||
#endif
|
||||
|
||||
void update_mesh(const Vector<Point2> &vertices,
|
||||
const Vector<Point2> &uvs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user