mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 02:06:53 +08:00
[godot] Remove debug defines
This commit is contained in:
parent
15ecabc4a8
commit
7e6671456b
@ -35,7 +35,6 @@
|
|||||||
#include "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
#include <spine/TextureLoader.h>
|
#include <spine/TextureLoader.h>
|
||||||
|
|
||||||
#define TOOLS_ENABLED
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "editor/editor_file_system.h"
|
#include "editor/editor_file_system.h"
|
||||||
#endif
|
#endif
|
||||||
@ -105,13 +104,8 @@ public:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void load(spine::AtlasPage &page, const spine::String &path) override {
|
void import_image_resource(const String &path) {
|
||||||
Error error = OK;
|
#ifdef VERSION_MAJOR> 4
|
||||||
String fixed_path = String(path.buffer());
|
|
||||||
bool is_resource = fix_path(fixed_path);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERSION_MAJOR > 4
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
// Required when importing into editor by e.g. drag & drop. The .png files
|
// Required when importing into editor by e.g. drag & drop. The .png files
|
||||||
// of the atlas might not have been imported yet.
|
// of the atlas might not have been imported yet.
|
||||||
@ -119,10 +113,18 @@ public:
|
|||||||
if (is_importing) {
|
if (is_importing) {
|
||||||
HashMap<StringName, Variant> custom_options;
|
HashMap<StringName, Variant> custom_options;
|
||||||
Dictionary generator_parameters;
|
Dictionary generator_parameters;
|
||||||
EditorFileSystem::get_singleton()->reimport_append(fixed_path, custom_options, "", generator_parameters);
|
EditorFileSystem::get_singleton()->reimport_append(path, custom_options, "", generator_parameters);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void load(spine::AtlasPage &page, const spine::String &path) override {
|
||||||
|
Error error = OK;
|
||||||
|
String fixed_path = String(path.buffer());
|
||||||
|
bool is_resource = fix_path(fixed_path);
|
||||||
|
|
||||||
|
import_image_resource(fixed_path);
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
Ref<Texture2D> texture = get_texture_from_image(fixed_path, is_resource);
|
Ref<Texture2D> texture = get_texture_from_image(fixed_path, is_resource);
|
||||||
@ -145,6 +147,7 @@ public:
|
|||||||
|
|
||||||
String new_path = vformat("%s/%s_%s", fixed_path.get_base_dir(), normal_map_prefix, fixed_path.get_file());
|
String new_path = vformat("%s/%s_%s", fixed_path.get_base_dir(), normal_map_prefix, fixed_path.get_file());
|
||||||
if (ResourceLoader::exists(new_path)) {
|
if (ResourceLoader::exists(new_path)) {
|
||||||
|
import_image_resource(new_path);
|
||||||
Ref<Texture> normal_map = get_texture_from_image(new_path, is_resource);
|
Ref<Texture> normal_map = get_texture_from_image(new_path, is_resource);
|
||||||
normal_maps->append(normal_map);
|
normal_maps->append(normal_map);
|
||||||
renderer_object->normal_map = normal_map;
|
renderer_object->normal_map = normal_map;
|
||||||
|
|||||||
@ -26,7 +26,6 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
||||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#define TOOLS_ENABLED
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user