-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterface.kt
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef GODOT_JVM_JAVA_ARCHIVE_H | ||
#define GODOT_JVM_JAVA_ARCHIVE_H | ||
|
||
#include <core/io/resource.h> | ||
|
||
class JavaArchive : public Resource { | ||
GDCLASS(JavaArchive, Resource); | ||
|
||
protected: | ||
static void _bind_methods() {}; | ||
}; | ||
|
||
#endif// GODOT_JVM_JAVA_ARCHIVE_H |
34 changes: 34 additions & 0 deletions
34
src/resource_format/java_archive_resource_format_loader.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#include "java_archive_resource_format_loader.h" | ||
|
||
#include "java_archive.h" | ||
#include "logging.h" | ||
|
||
void JavaArchiveFormatLoader::get_recognized_extensions(List<String>* p_extensions) const { | ||
p_extensions->push_back("jar"); | ||
p_extensions->push_back("dex"); | ||
} | ||
|
||
String JavaArchiveFormatLoader::get_resource_type(const String& p_path) const { | ||
String ext = p_path.get_extension().to_lower(); | ||
if(ext == "jar" || ext == "dex"){ return "JavaArchive";} | ||
return ""; | ||
} | ||
|
||
bool JavaArchiveFormatLoader::handles_type(const String& p_type) const { | ||
return p_type == "JavaArchive"; | ||
} | ||
|
||
Ref<Resource> JavaArchiveFormatLoader::load( | ||
const String& p_path, | ||
const String& p_original_path, | ||
Error* r_error, | ||
bool p_use_sub_threads, | ||
float* r_progress, | ||
ResourceFormatLoader::CacheMode p_cache_mode | ||
) { | ||
LOG_VERBOSE(vformat("Loading usercode file at: %s", p_path)); | ||
Ref<JavaArchive> ref; | ||
ref.instantiate(); | ||
return ref; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef GODOT_JVM_JAVA_ARCHIVE_LOADER_H | ||
#define GODOT_JVM_JAVA_ARCHIVE_LOADER_H | ||
|
||
#include <core/io/resource_loader.h> | ||
|
||
class JavaArchiveFormatLoader : public ResourceFormatLoader { | ||
public: | ||
JavaArchiveFormatLoader() = default; | ||
~JavaArchiveFormatLoader() = default; | ||
JavaArchiveFormatLoader(const JavaArchiveFormatLoader&) = delete; | ||
void operator=(const JavaArchiveFormatLoader&) = delete; | ||
|
||
void get_recognized_extensions(List<String>* p_extensions) const override; | ||
String get_resource_type(const String& p_path) const override; | ||
bool handles_type(const String& p_type) const override; | ||
Ref<Resource> load(const String& p_path, const String& p_original_path, Error* r_error, bool p_use_sub_threads, float* r_progress, CacheMode p_cache_mode) override; | ||
}; | ||
|
||
#endif// GODOT_JVM_JAVA_ARCHIVE_LOADER_H |