mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[godot] Fixes for latest 4.0 commits, automatically install MoltenVK on macOS via setup.sh
This commit is contained in:
parent
2b28510acd
commit
1c150203ab
10
spine-godot/build/install-macos-vulkan-sdk.sh
Executable file
10
spine-godot/build/install-macos-vulkan-sdk.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
# Download and install the Vulkan SDK.
|
||||||
|
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg" -o /tmp/vulkan-sdk.dmg
|
||||||
|
hdiutil attach /tmp/vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
|
||||||
|
/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \
|
||||||
|
--accept-licenses --default-answer --confirm-command install
|
||||||
|
hdiutil detach /Volumes/vulkan-sdk
|
||||||
|
rm -f /tmp/vulkan-sdk.dmg
|
||||||
@ -32,6 +32,10 @@ if [ $dev = "true" ]; then
|
|||||||
git apply ../build/livepp-v4.patch
|
git apply ../build/livepp-v4.patch
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ `uname` == 'Darwin' ] && [ ! -d "$HOME/VulkanSDK" ]; then
|
||||||
|
./build/install-macos-vulkan-sdk.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
cp -r ../spine-cpp/spine-cpp spine_godot
|
cp -r ../spine-cpp/spine-cpp spine_godot
|
||||||
popd
|
popd
|
||||||
|
|||||||
@ -831,16 +831,16 @@ void SpineSprite::draw() {
|
|||||||
auto global_scale = get_global_scale();
|
auto global_scale = get_global_scale();
|
||||||
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
||||||
|
|
||||||
float line_height = default_font->get_height() + default_font->get_descent();
|
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
||||||
float rect_width = 0;
|
float rect_width = 0;
|
||||||
for (int i = 0; i < hover_text_lines.size(); i++) {
|
for (int i = 0; i < hover_text_lines.size(); i++) {
|
||||||
rect_width = MAX(rect_width, default_font->get_string_size(hover_text_lines[i]).x);
|
rect_width = MAX(rect_width, default_font->get_string_size(hover_text_lines[i]).x);
|
||||||
}
|
}
|
||||||
Rect2 background_rect(0, -default_font->get_height() - 5, rect_width + 20, line_height * hover_text_lines.size() + 10);
|
Rect2 background_rect(0, -default_font->get_height(Font::DEFAULT_FONT_SIZE) - 5, rect_width + 20, line_height * hover_text_lines.size() + 10);
|
||||||
if (hover_text_lines.size() > 0) draw_rect(background_rect, Color(0, 0, 0, 0.8));
|
if (hover_text_lines.size() > 0) draw_rect(background_rect, Color(0, 0, 0, 0.8));
|
||||||
for (int i = 0; i < hover_text_lines.size(); i++) {
|
for (int i = 0; i < hover_text_lines.size(); i++) {
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, Font::DEFAULT_FONT_SIZE, Color(1, 1, 1, 1));
|
draw_string(default_font, Vector2(10, 0 + i * default_font->get_height(Font::DEFAULT_FONT_SIZE)), hover_text_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, Font::DEFAULT_FONT_SIZE, Color(1, 1, 1, 1));
|
||||||
#else
|
#else
|
||||||
draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], Color(1, 1, 1, 1));
|
draw_string(default_font, Vector2(10, 0 + i * default_font->get_height()), hover_text_lines[i], Color(1, 1, 1, 1));
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user