Skip to content

Commit

Permalink
Adjust things for the html5/emscripten-rename in Kinc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jul 31, 2022
1 parent ba18dd5 commit e6318e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
3 changes: 2 additions & 1 deletion out/Platform.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 5 additions & 16 deletions out/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export const Platform = {
Empty: 'empty',
Pi: 'pi',
tvOS: 'tvos',
FreeBSD: 'freebsd'
FreeBSD: 'freebsd',
Emscripten: 'emscripten'
};
18 changes: 5 additions & 13 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,8 @@ function createKorefile(name: string, exporter: KhaExporter, options: Options, t
if (targetOptions) {
let koreTargetOptions: any = {};
for (let option in targetOptions) {
if (option.endsWith('_native')) continue;
koreTargetOptions[option] = targetOptions[option];
}
for (let option in targetOptions) {
if (option.endsWith('_native')) {
koreTargetOptions[option.substr(0, option.length - '_native'.length)] = targetOptions[option];
}
}
out += 'project.targetOptions = ' + JSON.stringify(koreTargetOptions) + ';\n';
}

Expand Down Expand Up @@ -280,7 +274,7 @@ function checkKorePlatform(platform: string) {
|| platform === 'osx'
|| platform === 'android'
|| platform === 'linux'
|| platform === 'html5'
|| platform === 'emscripten'
|| platform === 'pi'
|| platform === 'tvos'
|| platform === 'ps4'
Expand All @@ -292,9 +286,7 @@ function checkKorePlatform(platform: string) {
}

function koreplatform(platform: string) {
if (platform.endsWith('-native')) return platform.substr(0, platform.length - '-native'.length);
else if (platform.endsWith('-native-hl')) return platform.substr(0, platform.length - '-native-hl'.length);
else if (platform.endsWith('-hl')) return platform.substr(0, platform.length - '-hl'.length);
if (platform.endsWith('-hl')) return platform.substr(0, platform.length - '-hl'.length);
else return platform;
}

Expand Down Expand Up @@ -760,16 +752,16 @@ export async function run(options: Options, loglog: any): Promise<string> {
options.theora = options.ffmpeg + ' -nostdin -i {in} {out}';
}

if (options.target === 'html5-native') {
if (options.target === 'emscripten') {
console.log();
console.log('Please note that the html5 target\n'
+ 'is usually a better choice.\n'
+ 'In particular the html5 target usually runs faster\n'
+ 'than the html5-native target. That is because\n'
+ 'than the emscripten target. That is because\n'
+ 'Haxe and JavaScript are similar in many ways and\n'
+ 'therefore the html5 target can make direct use of\n'
+ 'all of the optimizations in modern JavaScript\n'
+ 'runtimes. The html5-native target on the other hand\n'
+ 'runtimes. The emscripten target on the other hand\n'
+ 'has to provide its own garbage collector and many\n'
+ 'other performance critical pieces of infrastructure.'
);
Expand Down

0 comments on commit e6318e3

Please sign in to comment.