Fix pad compile

This commit is contained in:
luboslenco
2024-08-02 20:35:39 +02:00
parent 6e05d89ff5
commit 6a2b53064b
3 changed files with 21 additions and 35 deletions
-27
View File
@@ -3,30 +3,3 @@
# armorpad # armorpad
ArmorPad is a utility for editing `.arm` files. ArmorPad is a utility for editing `.arm` files.
*Note: If you are compiling git version of ArmorPad, then you need to have a compiler ([Visual Studio](https://visualstudio.microsoft.com/downloads/) - Windows, [clang](https://clang.llvm.org/get_started.html) + [deps](https://github.com/armory3d/armortools/wiki/Linux-Dependencies) - Linux, [Xcode](https://developer.apple.com/xcode/resources/) - macOS) and [git](https://git-scm.com/downloads) installed.*
```bash
git clone --recursive https://github.com/armory3d/armortools
cd armortools/misc/armorpad
```
**Windows**
```bash
..\..\armorcore\Kinc\make --from ..\..\armorcore -g direct3d11 --run
```
**Linux**
```bash
../../armorcore/Kinc/make --from ../../armorcore -g opengl --compiler clang --compile
cd ../../armorcore/Deployment
./ArmorPad ../../misc/armorpad/build/krom
```
**macOS**
```bash
../../armorcore/Kinc/make --from ../../armorcore -g metal
cp -a build/krom/ ../../armorcore/Deployment
# Open generated Xcode project at `build/ArmorPad.xcodeproj`
# Build and run
```
+5 -4
View File
@@ -7,15 +7,16 @@ flags.with_tinydir = true;
flags.with_g2 = true; flags.with_g2 = true;
flags.with_iron = true; flags.with_iron = true;
flags.with_zui = true; flags.with_zui = true;
flags.on_c_project_created = function(c_project) {
c_project.addDefine('IDLE_SLEEP');
}
let project = new Project("ArmorPad"); let project = new Project("ArmorPad");
let root = "../../";
project.addSources("sources"); project.addSources("sources");
let root = "../../";
project.addShaders(root + "armorcore/shaders/*.glsl",); project.addShaders(root + "armorcore/shaders/*.glsl",);
project.addAssets(root + "base/assets/font_mono.ttf", { destination: "data/{name}" }); project.addAssets(root + "base/assets/font_mono.ttf", { destination: "data/{name}" });
project.addAssets(root + "base/assets/text_coloring.json", { destination: "data/{name}" }); project.addAssets(root + "base/assets/text_coloring.json", { destination: "data/{name}" });
project.addDefine('IDLE_SLEEP');
project.addProject("../../armorcore");
return project; return project;
+16 -4
View File
@@ -31,8 +31,12 @@ function drop_files(path: string) {
sidebar_handle.redraws = 1; sidebar_handle.redraws = 1;
} }
function encode_storage(): string {
return "";
}
function shutdown() { function shutdown() {
let storage_string: string = sys_string_to_buffer(json_stringify(storage)); let storage_string: string = sys_string_to_buffer(encode_storage());
krom_file_save_bytes(krom_save_path() + "/config.json", storage_string, 0); krom_file_save_bytes(krom_save_path() + "/config.json", storage_string, 0);
} }
@@ -80,7 +84,11 @@ function main() {
theme = {}; theme = {};
zui_theme_default(theme); zui_theme_default(theme);
let zui_ops: zui_options_t = { scale_factor: 1.0, theme: theme, font: font }; let zui_ops: zui_options_t = {
scale_factor: 1.0,
theme: theme,
font: font
};
ui = zui_create(zui_ops); ui = zui_create(zui_ops);
let blob_coloring: buffer_t = data_get_blob("text_coloring.json"); let blob_coloring: buffer_t = data_get_blob("text_coloring.json");
@@ -96,6 +104,10 @@ function main() {
krom_set_application_state_callback(null, null, null, null, shutdown); krom_set_application_state_callback(null, null, null, null, shutdown);
} }
function armpack_to_string(bytes: buffer_t): string {
return "";
}
function list_folder(path: string) { function list_folder(path: string) {
let files: string[] = string_split(krom_read_directory(path, false), "\n"); let files: string[] = string_split(krom_read_directory(path, false), "\n");
for (let i: i32 = 0; i < files.length; ++i) { for (let i: i32 = 0; i < files.length; ++i) {
@@ -119,7 +131,7 @@ function list_folder(path: string) {
if (is_file) { if (is_file) {
storage.file = abs; storage.file = abs;
let bytes: buffer_t = krom_load_blob(storage.file); let bytes: buffer_t = krom_load_blob(storage.file);
storage.text = ends_with(f, ".arm") ? json_stringify(armpack_decode(bytes)) : sys_buffer_to_string(bytes); storage.text = ends_with(f, ".arm") ? armpack_to_string(bytes) : sys_buffer_to_string(bytes);
storage.text = string_replace_all(storage.text, "\r", ""); storage.text = string_replace_all(storage.text, "\r", "");
text_handle.text = storage.text; text_handle.text = storage.text;
editor_handle.redraws = 1; editor_handle.redraws = 1;
@@ -264,7 +276,7 @@ function build_file(): string {
} }
function build_project() { function build_project() {
krom_sys_command(storage.project + build_file() + " " + storage.project, null); krom_sys_command(storage.project + build_file() + " " + storage.project);
} }
function draw_minimap() { function draw_minimap() {