From bc841a537a4ea46b656d8ef55e3cd7208ef99584 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 3 Nov 2020 15:19:41 +0100 Subject: [PATCH] Add v8 snapshot support --- README.md | 10 ++++++++-- Sources/Main.hx | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc9c9331..7bcaf166 100644 --- a/README.md +++ b/README.md @@ -116,9 +116,15 @@ git submodule update --init --recursive # Delete `armorpaint/build` directory if present ``` -**How to generate or update a locale file** +**Generating a v8 snapshot file** +```bash +./Krom . . --snapshot +# Generates a `krom.bin` file +``` + +**Generating a locale file** ```bash pip install typing_extensions -t Assets/locale/tools python ./Assets/locale/tools/extract_locales.py -# Generated or updated in `Assets/locale/.json` +# Generates an `Assets/locale/.json` file ``` diff --git a/Sources/Main.hx b/Sources/Main.hx index 45a9ca13..d076518d 100644 --- a/Sources/Main.hx +++ b/Sources/Main.hx @@ -26,7 +26,14 @@ class Main { static var tasks: Int; + // Generating snapshot public static function main() { + js.Syntax.code("globalThis.kickstart = Main.kickstart"); + } + + // Program startup + @:keep + public static function kickstart() { // Used to locate external application data folder Krom.setApplicationName("ArmorPaint");