This commit is contained in:
luboslenco
2025-09-03 19:44:57 +02:00
9 changed files with 41 additions and 36 deletions
+13 -8
View File
@@ -19,6 +19,14 @@ function add_thread_backend(name) {
project.add_define("BACKEND_THREAD_H=\"backends/" + name + "_thread.h\"");
}
function get_version_code() {
const now = new Date();
const year = now.getFullYear().toString().slice(-2);
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
return parseInt(year + month + day, 10);
}
// flags: make.js/load_project
let flags = globalThis.flags;
let dir = flags.name.substr(5).toLowerCase(); // ArmorPaint -> paint
@@ -94,6 +102,8 @@ else if (platform == "ios") {
project.add_cfiles("sources/backends/data/ios.plist");
project.add_cfiles("sources/backends/ios_file_dialog.m");
project.add_define("IRON_METAL");
project.target_options.ios.build = get_version_code() + "";
project.target_options.ios.version = get_version_code() + "";
}
else if (platform == "android") {
add_sys_backend("android");
@@ -113,19 +123,11 @@ else if (platform == "android") {
if (flags.with_audio) {
project.add_lib("OpenSLES");
}
project.target_options.android.package = flags.package;
project.target_options.android.permissions = ["android.permission.READ_MEDIA_IMAGES", "android.permission.INTERNET"];
project.target_options.android.screenOrientation = ["sensorLandscape"];
project.target_options.android.minSdkVersion = 33; // android 13
project.target_options.android.targetSdkVersion = 36;
function get_version_code() {
const now = new Date();
const year = now.getFullYear().toString().slice(-2);
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
return parseInt(year + month + day, 10);
}
project.target_options.android.versionCode = get_version_code();
project.target_options.android.versionName = "1.0 alpha";
}
@@ -238,6 +240,9 @@ if (fs_exists(os_cwd() + "/icon.png")) {
if (platform == "macos" && fs_exists(os_cwd() + "/icon_macos.png")) {
project.icon = "icon_macos.png";
}
else if (platform == "ios" && fs_exists(os_cwd() + "/icon_ios.png")) {
project.icon = "icon_ios.png";
}
else if (platform == "linux") {
project.add_assets("../" + dir + "/icon.png", { destination: "{name}", noprocessing: true, noembed: true });
}
+7 -3
View File
@@ -2,11 +2,15 @@
#import <UIKit/UIKit.h>
static UIDocumentPickerViewController *documentPicker = nil;
void IOSFileDialogOpen() {
UIViewController<UIDocumentPickerDelegate> *myViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeOpen];
documentPicker.delegate = myViewController;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
if (documentPicker == nil) {
documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeOpen];
documentPicker.delegate = myViewController;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
}
[myViewController presentViewController:documentPicker animated:YES completion:nil];
}
+11 -14
View File
@@ -495,13 +495,10 @@ void importFile(NSURL *url) {
iron_internal_drop_files_callback(wpath);
}
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url {
// wchar_t *filePath = (wchar_t *)[url.path cStringUsingEncoding:NSUTF32LittleEndianStringEncoding];
// CFURLRef cfurl = (__bridge CFURLRef)url;
// CFURLStartAccessingSecurityScopedResource(cfurl);
// iron_internal_drop_files_callback(filePath);
// CFURLStopAccessingSecurityScopedResource(cfurl);
importFile(url);
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
for (NSURL *url in urls) {
importFile(url);
}
}
- (void)dropInteraction:(UIDropInteraction *)interaction performDrop:(id<UIDropSession>)session {
@@ -522,7 +519,7 @@ void importFile(NSURL *url) {
}
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
return UIRectEdgeAll;
return UIRectEdgeAll;
}
@end
@@ -544,9 +541,9 @@ void importFile(NSURL *url) {
#endif
UIWindowScene *windowScene = (UIWindowScene *)scene;
self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
self.window.frame = windowScene.coordinateSpace.bounds;
[self.window setBackgroundColor:[UIColor blackColor]];
[self.window setBackgroundColor:[UIColor blackColor]];
my_view_controller = [[MyViewController alloc] init];
my_view_controller.view.multipleTouchEnabled = YES;
@@ -561,19 +558,19 @@ void importFile(NSURL *url) {
}
- (void)sceneDidBecomeActive:(UIScene *)scene {
iron_internal_resume_callback();
iron_internal_resume_callback();
}
- (void)sceneWillResignActive:(UIScene *)scene {
iron_internal_pause_callback();
iron_internal_pause_callback();
}
- (void)sceneWillEnterForeground:(UIScene *)scene {
iron_internal_foreground_callback();
iron_internal_foreground_callback();
}
- (void)sceneDidEnterBackground:(UIScene *)scene {
iron_internal_background_callback();
iron_internal_background_callback();
}
@end
+2 -7
View File
@@ -1100,7 +1100,7 @@ class XCodeExporter extends Exporter {
frameworks.push(new Framework(lib));
}
let target_options = {
bundle: 'org.$(PRODUCT_NAME)',
bundle: 'org.armory3d.' + project.getName().toLowerCase(),
version: "1.0",
build: "1",
organizationName: "Armory3D",
@@ -1108,16 +1108,10 @@ class XCodeExporter extends Exporter {
};
if (project.target_options && project.target_options.ios) {
let userOptions = project.target_options.ios;
if (userOptions.bundle)
target_options.bundle = userOptions.bundle;
if (userOptions.version)
target_options.version = userOptions.version;
if (userOptions.build)
target_options.build = userOptions.build;
if (userOptions.organizationName)
target_options.organizationName = userOptions.organizationName;
if (userOptions.developmentTeam)
target_options.developmentTeam = userOptions.developmentTeam;
}
let projectId = new_path_id("_projectId");
let appFileId = new_path_id("_appFileId");
@@ -2779,6 +2773,7 @@ class Project {
this.includes = [];
this.target_options = {
android: {},
ios: {}
};
this.executable_name = null;
this.sources = [];
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

+3 -1
View File
@@ -8,8 +8,10 @@ let _import_asset_done: ()=>void;
function import_asset_run(path: string, drop_x: f32 = -1.0, drop_y: f32 = -1.0, show_box: bool = true, hdr_as_envmap: bool = true, done: ()=>void = null) {
if (starts_with(path, "cloud")) {
///if (arm_android || arm_ios)
///if arm_android
console_toast(tr("Downloading"));
///else
console_info(tr("Downloading"));
///end
_import_asset_drop_x = drop_x;
+1
View File
@@ -57,6 +57,7 @@ function import_envmap_run(path: string, image: gpu_texture_t) {
scene_world._.radiance = import_envmap_radiance;
scene_world._.radiance_mipmaps = import_envmap_mips;
context_raw.saved_envmap = image;
context_raw.show_envmap = true;
if (context_raw.show_envmap_blur) {
scene_world._.envmap = scene_world._.radiance_mipmaps[0];
}
+3 -3
View File
@@ -105,6 +105,9 @@ function ui_base_init() {
scene_world._.envmap = context_raw.show_envmap ? context_raw.saved_envmap : context_raw.empty_envmap;
context_raw.ddirty = 1;
let resources: string[] = ["cursor.k", "icons.k"];
resource_load(resources);
let scale: f32 = config_raw.window_scale;
let ops: ui_options_t = {
theme: base_theme,
@@ -133,9 +136,6 @@ function ui_base_init() {
context_raw.gizmo_rotate_y = object_get_child(context_raw.gizmo, ".RotateY");
context_raw.gizmo_rotate_z = object_get_child(context_raw.gizmo, ".RotateZ");
let resources: string[] = ["cursor.k", "icons.k"];
resource_load(resources);
project_new(false);
if (project_filepath == "") {
+1
View File
@@ -345,6 +345,7 @@ function ui_menubar_draw_category_items() {
context_raw.ddirty = 2;
}
context_raw.show_envmap_handle.selected = context_raw.show_envmap;
context_raw.show_envmap = ui_check(context_raw.show_envmap_handle, " " + tr("Envmap"));
if (context_raw.show_envmap_handle.changed) {
context_load_envmap();