From 17e385b637fa5d860ad1c1deae29ef6182af2b0a Mon Sep 17 00:00:00 2001 From: Lucas Dower Date: Fri, 6 Oct 2023 18:08:36 +0100 Subject: [PATCH] Reorganise modules into two discrete packages --- .../{build.js.yml => build_core.js.yml} | 4 +- .github/workflows/build_editor.js.yml | 13 ++++ .../{tests.js.yml => tests_core.js.yml} | 4 +- .github/workflows/tests_editor.js.yml | 13 ++++ .gitignore | 36 ++++------- Core/index.ts | 3 + jestconfig.json => Core/jestconfig.json | 0 Core/package-lock.json | 35 +++++++++++ Core/package.json | 19 ++++++ {src/runtime => Core/src}/atlas.ts | 0 {src/runtime => Core/src}/block_assigner.ts | 0 {src/runtime => Core/src}/block_atlas.ts | 2 +- {src/runtime => Core/src}/block_mesh.ts | 6 +- {src/runtime => Core/src}/bounds.ts | 0 {src/runtime => Core/src}/colour.ts | 57 ++++++++++++++---- {src/runtime => Core/src}/constants.ts | 0 {src/runtime => Core/src}/dither.ts | 2 +- .../src}/exporters/base_exporter.ts | 0 .../src}/exporters/exporters.ts | 0 .../src}/exporters/indexed_json_exporter .ts | 0 .../src}/exporters/litematic_exporter.ts | 0 .../src}/exporters/nbt_exporter.ts | 0 .../src}/exporters/schem_exporter.ts | 0 .../src}/exporters/schematic_exporter.ts | 2 +- .../exporters/uncompressed_json_exporter.ts | 0 .../src}/importers/base_importer.ts | 0 .../src}/importers/gltf_loader.ts | 0 .../src}/importers/importers.ts | 0 .../src}/importers/obj_importer.ts | 0 {src/runtime => Core/src}/lighting.ts | 0 {src/runtime => Core/src}/linear_allocator.ts | 0 {src/runtime => Core/src}/materials.ts | 0 {src/runtime => Core/src}/math.ts | 0 {src/runtime => Core/src}/occlusion.ts | 0 {src/runtime => Core/src}/ots_mesh.ts | 0 {src/runtime => Core/src}/ots_texture.ts | 0 {src/runtime => Core/src}/ots_voxel_mesh.ts | 0 .../src}/ots_voxel_mesh_converter.ts | 0 .../src}/ots_voxel_mesh_neighbourhood.ts | 0 {src/runtime => Core/src}/ray.ts | 0 {src/runtime => Core/src}/triangle.ts | 0 {src/runtime => Core/src}/util.ts | 0 {src/runtime => Core/src}/util/error_util.ts | 0 {src/runtime => Core/src}/util/file_util.ts | 0 {src/runtime => Core/src}/util/log_util.ts | 0 {src/runtime => Core/src}/util/math_util.ts | 0 {src/runtime => Core/src}/util/nbt_util.ts | 0 {src/runtime => Core/src}/util/path_util.ts | 0 {src/runtime => Core/src}/util/regex_util.ts | 0 {src/runtime => Core/src}/util/type_util.ts | 0 {src/runtime => Core/src}/util/ui_util.ts | 0 {src/runtime => Core/src}/vector.ts | 0 {tests => Core/tests}/data/cube.mtl | 0 {tests => Core/tests}/data/cube.obj | 0 .../tests}/linear_allocator.test.ts | 4 +- {tests => Core/tests}/ots_voxel_mesh.test.ts | 6 +- .../ots_voxel_mesh_neighbourhood.test.ts | 6 +- {tests => Core/tests}/preamble.ts | 4 +- {tests => Core/tests}/ray.test.ts | 8 +-- {tests => Core/tests}/util.test.ts | 6 +- {tools => Core/tools}/benchmark.ts | 12 ++-- {tools => Core/tools}/build-atlas.ts | 6 +- {tools => Core/tools}/headless-config.ts | 4 +- {tools => Core/tools}/headless.ts | 8 +-- {tools => Core/tools}/models-ignore-list.txt | 0 {tools => Core/tools}/run-headless.ts | 4 +- {tools => Core/tools}/util.ts | 2 +- Core/tsconfig.json | 15 +++++ firebase.json => Editor/firebase.json | 0 {loc => Editor/loc}/base.ts | 2 +- {loc => Editor/loc}/en_GB.ts | 0 {loc => Editor/loc}/en_US.ts | 0 {loc => Editor/loc}/fr_FR.ts | 0 {loc => Editor/loc}/ru_RU.ts | 0 {loc => Editor/loc}/zh_CN.ts | 0 Editor/package.json | 16 +++++ {public => Editor/public}/index.html | 0 {public => Editor/public}/styles.css | 0 {res => Editor/res}/atlases/vanilla.atlas | 0 {res => Editor/res}/atlases/vanilla.png | Bin {res => Editor/res}/block_ids.ts | 0 {res => Editor/res}/icon.icns | Bin {res => Editor/res}/icon.ico | Bin {res => Editor/res}/icon.png | Bin {res => Editor/res}/palettes/all.ts | 0 {res => Editor/res}/palettes/colourful.ts | 0 {res => Editor/res}/palettes/greyscale.ts | 0 .../res}/palettes/schematic-friendly.ts | 0 {res => Editor/res}/samples/editor.png | Bin {res => Editor/res}/samples/noodles.png | Bin {res => Editor/res}/samples/skull.jpg | Bin {res => Editor/res}/samples/skull.mtl | 0 {res => Editor/res}/samples/skull.obj | 0 {res => Editor/res}/samples/skull.txt | 0 {res => Editor/res}/shaders/block_fragment.fs | 0 {res => Editor/res}/shaders/block_vertex.vs | 0 {res => Editor/res}/shaders/debug_fragment.fs | 0 {res => Editor/res}/shaders/debug_vertex.vs | 0 .../res}/shaders/solid_tri_fragment.fs | 0 .../res}/shaders/solid_tri_vertex.vs | 0 .../res}/shaders/texture_tri_fragment.fs | 0 .../res}/shaders/texture_tri_vertex.vs | 0 {res => Editor/res}/shaders/voxel_fragment.fs | 0 {res => Editor/res}/shaders/voxel_vertex.vs | 0 {src/editor => Editor/src}/analytics.ts | 0 {src/editor => Editor/src}/app_context.ts | 12 ++-- {src/editor => Editor/src}/buffer.ts | 8 +-- {src/editor => Editor/src}/config.ts | 4 +- {src/editor => Editor/src}/event.ts | 8 +-- {src => Editor/src}/global.d.ts | 0 {src/editor => Editor/src}/localiser.ts | 8 +-- {src/editor => Editor/src}/main.ts | 0 {src/editor => Editor/src}/mouse.ts | 0 {src/editor => Editor/src}/progress.ts | 4 +- .../src}/renderer/buffer_block_mesh.ts | 8 +-- .../src}/renderer/buffer_voxel_mesh.ts | 14 ++--- {src/editor => Editor/src}/renderer/camera.ts | 6 +- .../src}/renderer/geometry.ts | 12 ++-- .../src}/renderer/render_buffer.ts | 2 +- .../src}/renderer/renderer.ts | 16 ++--- .../editor => Editor/src}/renderer/shaders.ts | 0 {src/editor => Editor/src}/status.ts | 2 +- {src/editor => Editor/src}/texture_reader.ts | 4 +- .../src}/ui/components/base.ts | 4 +- .../src}/ui/components/button.ts | 2 +- .../src}/ui/components/checkbox.ts | 4 +- .../src}/ui/components/colour.ts | 2 +- .../src}/ui/components/combobox.ts | 8 +-- .../src}/ui/components/config.ts | 6 +- .../src}/ui/components/file_input.ts | 6 +- .../src}/ui/components/full_config.ts | 0 .../src}/ui/components/header.ts | 8 +-- .../src}/ui/components/image.ts | 10 +-- .../src}/ui/components/material.ts | 8 +-- .../src}/ui/components/material_type.ts | 4 +- .../src}/ui/components/number_input.ts | 2 +- .../src}/ui/components/palette.ts | 14 ++--- .../src}/ui/components/placeholder.ts | 4 +- .../src}/ui/components/slider.ts | 6 +- .../src}/ui/components/solid_material.ts | 2 +- .../src}/ui/components/textured_material.ts | 8 +-- .../src}/ui/components/toolbar_item.ts | 6 +- .../src}/ui/components/vector.ts | 6 +- {src/editor => Editor/src}/ui/console.ts | 4 +- {src/editor => Editor/src}/ui/icons.ts | 0 {src/editor => Editor/src}/ui/layout.ts | 44 +++++++------- {src/editor => Editor/src}/ui/misc.ts | 2 +- .../editor => Editor/src}/util/editor_util.ts | 0 {src/editor => Editor/src}/worker/worker.ts | 2 +- .../src}/worker/worker_client.ts | 18 +++--- .../src}/worker/worker_controller.ts | 10 +-- .../src}/worker/worker_interface.worker.ts | 0 .../src}/worker/worker_types.ts | 16 ++--- tsconfig.json => Editor/tsconfig.json | 0 webpack.common.js => Editor/webpack.common.js | 0 webpack.dev.js => Editor/webpack.dev.js | 0 webpack.prod.js => Editor/webpack.prod.js | 0 157 files changed, 376 insertions(+), 237 deletions(-) rename .github/workflows/{build.js.yml => build_core.js.yml} (69%) create mode 100644 .github/workflows/build_editor.js.yml rename .github/workflows/{tests.js.yml => tests_core.js.yml} (69%) create mode 100644 .github/workflows/tests_editor.js.yml create mode 100644 Core/index.ts rename jestconfig.json => Core/jestconfig.json (100%) create mode 100644 Core/package-lock.json create mode 100644 Core/package.json rename {src/runtime => Core/src}/atlas.ts (100%) rename {src/runtime => Core/src}/block_assigner.ts (100%) rename {src/runtime => Core/src}/block_atlas.ts (90%) rename {src/runtime => Core/src}/block_mesh.ts (98%) rename {src/runtime => Core/src}/bounds.ts (100%) rename {src/runtime => Core/src}/colour.ts (83%) rename {src/runtime => Core/src}/constants.ts (100%) rename {src/runtime => Core/src}/dither.ts (96%) rename {src/runtime => Core/src}/exporters/base_exporter.ts (100%) rename {src/runtime => Core/src}/exporters/exporters.ts (100%) rename {src/runtime => Core/src}/exporters/indexed_json_exporter .ts (100%) rename {src/runtime => Core/src}/exporters/litematic_exporter.ts (100%) rename {src/runtime => Core/src}/exporters/nbt_exporter.ts (100%) rename {src/runtime => Core/src}/exporters/schem_exporter.ts (100%) rename {src/runtime => Core/src}/exporters/schematic_exporter.ts (98%) rename {src/runtime => Core/src}/exporters/uncompressed_json_exporter.ts (100%) rename {src/runtime => Core/src}/importers/base_importer.ts (100%) rename {src/runtime => Core/src}/importers/gltf_loader.ts (100%) rename {src/runtime => Core/src}/importers/importers.ts (100%) rename {src/runtime => Core/src}/importers/obj_importer.ts (100%) rename {src/runtime => Core/src}/lighting.ts (100%) rename {src/runtime => Core/src}/linear_allocator.ts (100%) rename {src/runtime => Core/src}/materials.ts (100%) rename {src/runtime => Core/src}/math.ts (100%) rename {src/runtime => Core/src}/occlusion.ts (100%) rename {src/runtime => Core/src}/ots_mesh.ts (100%) rename {src/runtime => Core/src}/ots_texture.ts (100%) rename {src/runtime => Core/src}/ots_voxel_mesh.ts (100%) rename {src/runtime => Core/src}/ots_voxel_mesh_converter.ts (100%) rename {src/runtime => Core/src}/ots_voxel_mesh_neighbourhood.ts (100%) rename {src/runtime => Core/src}/ray.ts (100%) rename {src/runtime => Core/src}/triangle.ts (100%) rename {src/runtime => Core/src}/util.ts (100%) rename {src/runtime => Core/src}/util/error_util.ts (100%) rename {src/runtime => Core/src}/util/file_util.ts (100%) rename {src/runtime => Core/src}/util/log_util.ts (100%) rename {src/runtime => Core/src}/util/math_util.ts (100%) rename {src/runtime => Core/src}/util/nbt_util.ts (100%) rename {src/runtime => Core/src}/util/path_util.ts (100%) rename {src/runtime => Core/src}/util/regex_util.ts (100%) rename {src/runtime => Core/src}/util/type_util.ts (100%) rename {src/runtime => Core/src}/util/ui_util.ts (100%) rename {src/runtime => Core/src}/vector.ts (100%) rename {tests => Core/tests}/data/cube.mtl (100%) rename {tests => Core/tests}/data/cube.obj (100%) rename {tests => Core/tests}/linear_allocator.test.ts (84%) rename {tests => Core/tests}/ots_voxel_mesh.test.ts (96%) rename {tests => Core/tests}/ots_voxel_mesh_neighbourhood.test.ts (96%) rename {tests => Core/tests}/preamble.ts (70%) rename {tests => Core/tests}/ray.test.ts (92%) rename {tests => Core/tests}/util.test.ts (97%) rename {tools => Core/tools}/benchmark.ts (83%) rename {tools => Core/tools}/build-atlas.ts (98%) rename {tools => Core/tools}/headless-config.ts (90%) rename {tools => Core/tools}/headless.ts (92%) rename {tools => Core/tools}/models-ignore-list.txt (100%) rename {tools => Core/tools}/run-headless.ts (67%) rename {tools => Core/tools}/util.ts (95%) create mode 100644 Core/tsconfig.json rename firebase.json => Editor/firebase.json (100%) rename {loc => Editor/loc}/base.ts (87%) rename {loc => Editor/loc}/en_GB.ts (100%) rename {loc => Editor/loc}/en_US.ts (100%) rename {loc => Editor/loc}/fr_FR.ts (100%) rename {loc => Editor/loc}/ru_RU.ts (100%) rename {loc => Editor/loc}/zh_CN.ts (100%) create mode 100644 Editor/package.json rename {public => Editor/public}/index.html (100%) rename {public => Editor/public}/styles.css (100%) rename {res => Editor/res}/atlases/vanilla.atlas (100%) rename {res => Editor/res}/atlases/vanilla.png (100%) rename {res => Editor/res}/block_ids.ts (100%) rename {res => Editor/res}/icon.icns (100%) rename {res => Editor/res}/icon.ico (100%) rename {res => Editor/res}/icon.png (100%) rename {res => Editor/res}/palettes/all.ts (100%) rename {res => Editor/res}/palettes/colourful.ts (100%) rename {res => Editor/res}/palettes/greyscale.ts (100%) rename {res => Editor/res}/palettes/schematic-friendly.ts (100%) rename {res => Editor/res}/samples/editor.png (100%) rename {res => Editor/res}/samples/noodles.png (100%) rename {res => Editor/res}/samples/skull.jpg (100%) rename {res => Editor/res}/samples/skull.mtl (100%) rename {res => Editor/res}/samples/skull.obj (100%) rename {res => Editor/res}/samples/skull.txt (100%) rename {res => Editor/res}/shaders/block_fragment.fs (100%) rename {res => Editor/res}/shaders/block_vertex.vs (100%) rename {res => Editor/res}/shaders/debug_fragment.fs (100%) rename {res => Editor/res}/shaders/debug_vertex.vs (100%) rename {res => Editor/res}/shaders/solid_tri_fragment.fs (100%) rename {res => Editor/res}/shaders/solid_tri_vertex.vs (100%) rename {res => Editor/res}/shaders/texture_tri_fragment.fs (100%) rename {res => Editor/res}/shaders/texture_tri_vertex.vs (100%) rename {res => Editor/res}/shaders/voxel_fragment.fs (100%) rename {res => Editor/res}/shaders/voxel_vertex.vs (100%) rename {src/editor => Editor/src}/analytics.ts (100%) rename {src/editor => Editor/src}/app_context.ts (97%) rename {src/editor => Editor/src}/buffer.ts (96%) rename {src/editor => Editor/src}/config.ts (95%) rename {src/editor => Editor/src}/event.ts (92%) rename {src => Editor/src}/global.d.ts (100%) rename {src/editor => Editor/src}/localiser.ts (90%) rename {src/editor => Editor/src}/main.ts (100%) rename {src/editor => Editor/src}/mouse.ts (100%) rename {src/editor => Editor/src}/progress.ts (95%) rename {src/editor => Editor/src}/renderer/buffer_block_mesh.ts (96%) rename {src/editor => Editor/src}/renderer/buffer_voxel_mesh.ts (92%) rename {src/editor => Editor/src}/renderer/camera.ts (98%) rename {src/editor => Editor/src}/renderer/geometry.ts (98%) rename {src/editor => Editor/src}/renderer/render_buffer.ts (99%) rename {src/editor => Editor/src}/renderer/renderer.ts (98%) rename {src/editor => Editor/src}/renderer/shaders.ts (100%) rename {src/editor => Editor/src}/status.ts (96%) rename {src/editor => Editor/src}/texture_reader.ts (89%) rename {src/editor => Editor/src}/ui/components/base.ts (96%) rename {src/editor => Editor/src}/ui/components/button.ts (98%) rename {src/editor => Editor/src}/ui/components/checkbox.ts (98%) rename {src/editor => Editor/src}/ui/components/colour.ts (93%) rename {src/editor => Editor/src}/ui/components/combobox.ts (95%) rename {src/editor => Editor/src}/ui/components/config.ts (97%) rename {src/editor => Editor/src}/ui/components/file_input.ts (93%) rename {src/editor => Editor/src}/ui/components/full_config.ts (100%) rename {src/editor => Editor/src}/ui/components/header.ts (96%) rename {src/editor => Editor/src}/ui/components/image.ts (94%) rename {src/editor => Editor/src}/ui/components/material.ts (94%) rename {src/editor => Editor/src}/ui/components/material_type.ts (94%) rename {src/editor => Editor/src}/ui/components/number_input.ts (97%) rename {src/editor => Editor/src}/ui/components/palette.ts (96%) rename {src/editor => Editor/src}/ui/components/placeholder.ts (92%) rename {src/editor => Editor/src}/ui/components/slider.ts (97%) rename {src/editor => Editor/src}/ui/components/solid_material.ts (96%) rename {src/editor => Editor/src}/ui/components/textured_material.ts (93%) rename {src/editor => Editor/src}/ui/components/toolbar_item.ts (96%) rename {src/editor => Editor/src}/ui/components/vector.ts (97%) rename {src/editor => Editor/src}/ui/console.ts (96%) rename {src/editor => Editor/src}/ui/icons.ts (100%) rename {src/editor => Editor/src}/ui/layout.ts (96%) rename {src/editor => Editor/src}/ui/misc.ts (92%) rename {src/editor => Editor/src}/util/editor_util.ts (100%) rename {src/editor => Editor/src}/worker/worker.ts (98%) rename {src/editor => Editor/src}/worker/worker_client.ts (93%) rename {src/editor => Editor/src}/worker/worker_controller.ts (94%) rename {src/editor => Editor/src}/worker/worker_interface.worker.ts (100%) rename {src/editor => Editor/src}/worker/worker_types.ts (91%) rename tsconfig.json => Editor/tsconfig.json (100%) rename webpack.common.js => Editor/webpack.common.js (100%) rename webpack.dev.js => Editor/webpack.dev.js (100%) rename webpack.prod.js => Editor/webpack.prod.js (100%) diff --git a/.github/workflows/build.js.yml b/.github/workflows/build_core.js.yml similarity index 69% rename from .github/workflows/build.js.yml rename to .github/workflows/build_core.js.yml index 8ec6184..8959d02 100644 --- a/.github/workflows/build.js.yml +++ b/.github/workflows/build_core.js.yml @@ -1,4 +1,4 @@ -name: Build +name: Build-Core on: push jobs: build: @@ -6,6 +6,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules + working-directory: ./Core run: npm ci - name: Run build + working-directory: ./Core run: npm run build \ No newline at end of file diff --git a/.github/workflows/build_editor.js.yml b/.github/workflows/build_editor.js.yml new file mode 100644 index 0000000..5976d07 --- /dev/null +++ b/.github/workflows/build_editor.js.yml @@ -0,0 +1,13 @@ +name: Build-Editor +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + working-directory: ./Editor + run: npm ci + - name: Run build + working-directory: ./Editor + run: npm run build \ No newline at end of file diff --git a/.github/workflows/tests.js.yml b/.github/workflows/tests_core.js.yml similarity index 69% rename from .github/workflows/tests.js.yml rename to .github/workflows/tests_core.js.yml index 600cd9a..1b37b85 100644 --- a/.github/workflows/tests.js.yml +++ b/.github/workflows/tests_core.js.yml @@ -1,4 +1,4 @@ -name: Tests +name: Tests-Core on: push jobs: build: @@ -6,6 +6,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules + working-directory: ./Core run: npm ci - name: Run tests + working-directory: ./Core run: npm test diff --git a/.github/workflows/tests_editor.js.yml b/.github/workflows/tests_editor.js.yml new file mode 100644 index 0000000..1be91dd --- /dev/null +++ b/.github/workflows/tests_editor.js.yml @@ -0,0 +1,13 @@ +name: Tests-Editor +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + working-directory: ./Editor + run: npm ci + - name: Run tests + working-directory: ./Editor + run: npm test diff --git a/.gitignore b/.gitignore index d83c027..6f95ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,13 @@ -/node_modules -ObjToSchematic-win32-x64 -ObjToSchematic-linux-x64 -ObjToSchematic-darwin-x64 -/res/atlases/*.atlas -/res/atlases/*.png -!/res/atlases/vanilla.atlas -!/res/atlases/vanilla.png -/res/palettes/empty.palette -/dist -/dev -/gen -/tools/blocks -/tools/models -/tests/out -/tests/__mocks__ -/logs/ -/release/ -notes.txt +# Common *.DS_Store -dependencygraph.svg -.firebase -/webpack/ -.firebaserc -dependencies.jpg \ No newline at end of file + +# Core +/Core/node_modules +/Core/tests/out +/Core/lib + +# Editor +/Editor/node_modules +/Editor/.firebase +/Editor/.firebaserc +/Editor/webpack/ \ No newline at end of file diff --git a/Core/index.ts b/Core/index.ts new file mode 100644 index 0000000..087b630 --- /dev/null +++ b/Core/index.ts @@ -0,0 +1,3 @@ +export function testExport(x: number, y: number) { + return x + y; +} \ No newline at end of file diff --git a/jestconfig.json b/Core/jestconfig.json similarity index 100% rename from jestconfig.json rename to Core/jestconfig.json diff --git a/Core/package-lock.json b/Core/package-lock.json new file mode 100644 index 0000000..e74c1be --- /dev/null +++ b/Core/package-lock.json @@ -0,0 +1,35 @@ +{ + "name": "ots-core", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "ots-core", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "typescript": "^5.2.2" + } + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + }, + "dependencies": { + "typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" + } + } +} diff --git a/Core/package.json b/Core/package.json new file mode 100644 index 0000000..73e7d3b --- /dev/null +++ b/Core/package.json @@ -0,0 +1,19 @@ +{ + "name": "ots-core", + "private": true, + "version": "1.0.0", + "description": "", + "main": "lib/index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "build": "tsc" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "typescript": "^5.2.2" + } +} diff --git a/src/runtime/atlas.ts b/Core/src/atlas.ts similarity index 100% rename from src/runtime/atlas.ts rename to Core/src/atlas.ts diff --git a/src/runtime/block_assigner.ts b/Core/src/block_assigner.ts similarity index 100% rename from src/runtime/block_assigner.ts rename to Core/src/block_assigner.ts diff --git a/src/runtime/block_atlas.ts b/Core/src/block_atlas.ts similarity index 90% rename from src/runtime/block_atlas.ts rename to Core/src/block_atlas.ts index a2fe43c..b916923 100644 --- a/src/runtime/block_atlas.ts +++ b/Core/src/block_atlas.ts @@ -1,4 +1,4 @@ -import { RGBA } from '../runtime/colour'; +import { RGBA } from './colour'; import { UV } from './util'; export interface TextureInfo { diff --git a/src/runtime/block_mesh.ts b/Core/src/block_mesh.ts similarity index 98% rename from src/runtime/block_mesh.ts rename to Core/src/block_mesh.ts index d885e08..543e264 100644 --- a/src/runtime/block_mesh.ts +++ b/Core/src/block_mesh.ts @@ -1,7 +1,7 @@ -import { Atlas, TAtlasBlock } from '../runtime/atlas'; -import { AtlasPalette } from '../runtime/block_assigner'; +import { Atlas, TAtlasBlock } from './atlas'; +import { AtlasPalette } from './block_assigner'; import { BlockInfo } from './block_atlas'; -import { RGBA_255, RGBAUtil } from '../runtime/colour'; +import { RGBA_255, RGBAUtil } from './colour'; import { AppRuntimeConstants } from './constants'; import { Ditherer } from './dither'; import { BlockMeshLighting } from './lighting'; diff --git a/src/runtime/bounds.ts b/Core/src/bounds.ts similarity index 100% rename from src/runtime/bounds.ts rename to Core/src/bounds.ts diff --git a/src/runtime/colour.ts b/Core/src/colour.ts similarity index 83% rename from src/runtime/colour.ts rename to Core/src/colour.ts index b2a6b63..62a955e 100644 --- a/src/runtime/colour.ts +++ b/Core/src/colour.ts @@ -1,7 +1,5 @@ import { TBrand } from './util/type_util'; -const hsv_rgb = require('hsv-rgb'); - export type RGBA = { r: number, g: number, @@ -12,23 +10,58 @@ export type RGBA = { export type RGBA_255 = TBrand; export namespace RGBAUtil { + export function toString(a: RGBA) { return `(${a.r}, ${a.g}, ${a.b}, ${a.a})`; } + // h: [0, 360], s: [0, 1], v: [0, 1] + export function fromHSV(h: number, s: number, v: number): RGBA { + const c = v * s; + const x = c * (1 - Math.abs(((h / 60) % 2) - 1)); + const m = v - c; + + let output = RGBAUtil.copy(RGBAColours.BLACK); + if (h < 60) { + output.r = c; + output.g = x; + output.b = 0; + } else if (h < 120) { + output.r = x; + output.g = c; + output.b = 0; + } else if (h < 180) { + output.r = 0; + output.g = c; + output.b = x; + } else if (h < 240) { + output.r = 0; + output.g = x; + output.b = c; + } else if (h < 300) { + output.r = x; + output.g = 0; + output.b = c; + } else { + output.r = c; + output.g = 0; + output.b = x; + } + + output.r += m; + output.g += m; + output.b += m; + output.a = 1.0; + + return output; + } + export function randomPretty(): RGBA { const hue = Math.random() * 360; - const sat = 65; - const val = 85; + const sat = 65/255; + const val = 85/255; - const rgb: number[] = hsv_rgb(hue, sat, val); - - return { - r: rgb[0] / 255, - g: rgb[1] / 255, - b: rgb[2] / 255, - a: 1.0, - } + return RGBAUtil.fromHSV(hue, sat, val); } export function random(): RGBA { diff --git a/src/runtime/constants.ts b/Core/src/constants.ts similarity index 100% rename from src/runtime/constants.ts rename to Core/src/constants.ts diff --git a/src/runtime/dither.ts b/Core/src/dither.ts similarity index 96% rename from src/runtime/dither.ts rename to Core/src/dither.ts index d4e3449..fc62fe8 100644 --- a/src/runtime/dither.ts +++ b/Core/src/dither.ts @@ -1,4 +1,4 @@ -import { RGBA_255 } from '../runtime/colour'; +import { RGBA_255 } from './colour'; import { ASSERT } from './util/error_util'; import { Vector3 } from './vector'; diff --git a/src/runtime/exporters/base_exporter.ts b/Core/src/exporters/base_exporter.ts similarity index 100% rename from src/runtime/exporters/base_exporter.ts rename to Core/src/exporters/base_exporter.ts diff --git a/src/runtime/exporters/exporters.ts b/Core/src/exporters/exporters.ts similarity index 100% rename from src/runtime/exporters/exporters.ts rename to Core/src/exporters/exporters.ts diff --git a/src/runtime/exporters/indexed_json_exporter .ts b/Core/src/exporters/indexed_json_exporter .ts similarity index 100% rename from src/runtime/exporters/indexed_json_exporter .ts rename to Core/src/exporters/indexed_json_exporter .ts diff --git a/src/runtime/exporters/litematic_exporter.ts b/Core/src/exporters/litematic_exporter.ts similarity index 100% rename from src/runtime/exporters/litematic_exporter.ts rename to Core/src/exporters/litematic_exporter.ts diff --git a/src/runtime/exporters/nbt_exporter.ts b/Core/src/exporters/nbt_exporter.ts similarity index 100% rename from src/runtime/exporters/nbt_exporter.ts rename to Core/src/exporters/nbt_exporter.ts diff --git a/src/runtime/exporters/schem_exporter.ts b/Core/src/exporters/schem_exporter.ts similarity index 100% rename from src/runtime/exporters/schem_exporter.ts rename to Core/src/exporters/schem_exporter.ts diff --git a/src/runtime/exporters/schematic_exporter.ts b/Core/src/exporters/schematic_exporter.ts similarity index 98% rename from src/runtime/exporters/schematic_exporter.ts rename to Core/src/exporters/schematic_exporter.ts index da5ba2f..8408284 100644 --- a/src/runtime/exporters/schematic_exporter.ts +++ b/Core/src/exporters/schematic_exporter.ts @@ -1,6 +1,6 @@ import { NBT, TagType } from 'prismarine-nbt'; -import { BLOCK_IDS } from '../../../res/block_ids'; +import { BLOCK_IDS } from '../../../Editor/res/block_ids'; import { BlockMesh } from '../block_mesh'; import { LOG_WARN } from '../util/log_util'; import { saveNBT } from '../util/nbt_util'; diff --git a/src/runtime/exporters/uncompressed_json_exporter.ts b/Core/src/exporters/uncompressed_json_exporter.ts similarity index 100% rename from src/runtime/exporters/uncompressed_json_exporter.ts rename to Core/src/exporters/uncompressed_json_exporter.ts diff --git a/src/runtime/importers/base_importer.ts b/Core/src/importers/base_importer.ts similarity index 100% rename from src/runtime/importers/base_importer.ts rename to Core/src/importers/base_importer.ts diff --git a/src/runtime/importers/gltf_loader.ts b/Core/src/importers/gltf_loader.ts similarity index 100% rename from src/runtime/importers/gltf_loader.ts rename to Core/src/importers/gltf_loader.ts diff --git a/src/runtime/importers/importers.ts b/Core/src/importers/importers.ts similarity index 100% rename from src/runtime/importers/importers.ts rename to Core/src/importers/importers.ts diff --git a/src/runtime/importers/obj_importer.ts b/Core/src/importers/obj_importer.ts similarity index 100% rename from src/runtime/importers/obj_importer.ts rename to Core/src/importers/obj_importer.ts diff --git a/src/runtime/lighting.ts b/Core/src/lighting.ts similarity index 100% rename from src/runtime/lighting.ts rename to Core/src/lighting.ts diff --git a/src/runtime/linear_allocator.ts b/Core/src/linear_allocator.ts similarity index 100% rename from src/runtime/linear_allocator.ts rename to Core/src/linear_allocator.ts diff --git a/src/runtime/materials.ts b/Core/src/materials.ts similarity index 100% rename from src/runtime/materials.ts rename to Core/src/materials.ts diff --git a/src/runtime/math.ts b/Core/src/math.ts similarity index 100% rename from src/runtime/math.ts rename to Core/src/math.ts diff --git a/src/runtime/occlusion.ts b/Core/src/occlusion.ts similarity index 100% rename from src/runtime/occlusion.ts rename to Core/src/occlusion.ts diff --git a/src/runtime/ots_mesh.ts b/Core/src/ots_mesh.ts similarity index 100% rename from src/runtime/ots_mesh.ts rename to Core/src/ots_mesh.ts diff --git a/src/runtime/ots_texture.ts b/Core/src/ots_texture.ts similarity index 100% rename from src/runtime/ots_texture.ts rename to Core/src/ots_texture.ts diff --git a/src/runtime/ots_voxel_mesh.ts b/Core/src/ots_voxel_mesh.ts similarity index 100% rename from src/runtime/ots_voxel_mesh.ts rename to Core/src/ots_voxel_mesh.ts diff --git a/src/runtime/ots_voxel_mesh_converter.ts b/Core/src/ots_voxel_mesh_converter.ts similarity index 100% rename from src/runtime/ots_voxel_mesh_converter.ts rename to Core/src/ots_voxel_mesh_converter.ts diff --git a/src/runtime/ots_voxel_mesh_neighbourhood.ts b/Core/src/ots_voxel_mesh_neighbourhood.ts similarity index 100% rename from src/runtime/ots_voxel_mesh_neighbourhood.ts rename to Core/src/ots_voxel_mesh_neighbourhood.ts diff --git a/src/runtime/ray.ts b/Core/src/ray.ts similarity index 100% rename from src/runtime/ray.ts rename to Core/src/ray.ts diff --git a/src/runtime/triangle.ts b/Core/src/triangle.ts similarity index 100% rename from src/runtime/triangle.ts rename to Core/src/triangle.ts diff --git a/src/runtime/util.ts b/Core/src/util.ts similarity index 100% rename from src/runtime/util.ts rename to Core/src/util.ts diff --git a/src/runtime/util/error_util.ts b/Core/src/util/error_util.ts similarity index 100% rename from src/runtime/util/error_util.ts rename to Core/src/util/error_util.ts diff --git a/src/runtime/util/file_util.ts b/Core/src/util/file_util.ts similarity index 100% rename from src/runtime/util/file_util.ts rename to Core/src/util/file_util.ts diff --git a/src/runtime/util/log_util.ts b/Core/src/util/log_util.ts similarity index 100% rename from src/runtime/util/log_util.ts rename to Core/src/util/log_util.ts diff --git a/src/runtime/util/math_util.ts b/Core/src/util/math_util.ts similarity index 100% rename from src/runtime/util/math_util.ts rename to Core/src/util/math_util.ts diff --git a/src/runtime/util/nbt_util.ts b/Core/src/util/nbt_util.ts similarity index 100% rename from src/runtime/util/nbt_util.ts rename to Core/src/util/nbt_util.ts diff --git a/src/runtime/util/path_util.ts b/Core/src/util/path_util.ts similarity index 100% rename from src/runtime/util/path_util.ts rename to Core/src/util/path_util.ts diff --git a/src/runtime/util/regex_util.ts b/Core/src/util/regex_util.ts similarity index 100% rename from src/runtime/util/regex_util.ts rename to Core/src/util/regex_util.ts diff --git a/src/runtime/util/type_util.ts b/Core/src/util/type_util.ts similarity index 100% rename from src/runtime/util/type_util.ts rename to Core/src/util/type_util.ts diff --git a/src/runtime/util/ui_util.ts b/Core/src/util/ui_util.ts similarity index 100% rename from src/runtime/util/ui_util.ts rename to Core/src/util/ui_util.ts diff --git a/src/runtime/vector.ts b/Core/src/vector.ts similarity index 100% rename from src/runtime/vector.ts rename to Core/src/vector.ts diff --git a/tests/data/cube.mtl b/Core/tests/data/cube.mtl similarity index 100% rename from tests/data/cube.mtl rename to Core/tests/data/cube.mtl diff --git a/tests/data/cube.obj b/Core/tests/data/cube.obj similarity index 100% rename from tests/data/cube.obj rename to Core/tests/data/cube.obj diff --git a/tests/linear_allocator.test.ts b/Core/tests/linear_allocator.test.ts similarity index 84% rename from tests/linear_allocator.test.ts rename to Core/tests/linear_allocator.test.ts index 9674787..a2c0b56 100644 --- a/tests/linear_allocator.test.ts +++ b/Core/tests/linear_allocator.test.ts @@ -1,5 +1,5 @@ -import { LinearAllocator } from '../src/runtime/linear_allocator'; -import { Vector3 } from '../src/runtime/vector'; +import { LinearAllocator } from '../src/linear_allocator'; +import { Vector3 } from '../src/vector'; import { TEST_PREAMBLE } from './preamble'; test('RegExpBuilder', () => { diff --git a/tests/ots_voxel_mesh.test.ts b/Core/tests/ots_voxel_mesh.test.ts similarity index 96% rename from tests/ots_voxel_mesh.test.ts rename to Core/tests/ots_voxel_mesh.test.ts index 1f6edc9..f964fca 100644 --- a/tests/ots_voxel_mesh.test.ts +++ b/Core/tests/ots_voxel_mesh.test.ts @@ -1,6 +1,6 @@ -import { OtS_VoxelMesh } from '../src/runtime/ots_voxel_mesh'; -import { ASSERT } from '../src/runtime/util/error_util'; -import { Vector3 } from '../src/runtime/vector'; +import { OtS_VoxelMesh } from '../src/ots_voxel_mesh'; +import { ASSERT } from '../src/util/error_util'; +import { Vector3 } from '../src/vector'; test('VoxelMesh #1', () => { const voxelMesh = new OtS_VoxelMesh(); diff --git a/tests/ots_voxel_mesh_neighbourhood.test.ts b/Core/tests/ots_voxel_mesh_neighbourhood.test.ts similarity index 96% rename from tests/ots_voxel_mesh_neighbourhood.test.ts rename to Core/tests/ots_voxel_mesh_neighbourhood.test.ts index 91e822b..159d2cb 100644 --- a/tests/ots_voxel_mesh_neighbourhood.test.ts +++ b/Core/tests/ots_voxel_mesh_neighbourhood.test.ts @@ -1,6 +1,6 @@ -import { RGBAColours } from '../src/runtime/colour'; -import { OtS_VoxelMesh } from '../src/runtime/ots_voxel_mesh'; -import { OtS_FaceVisibility, OtS_VoxelMesh_Neighbourhood } from '../src/runtime/ots_voxel_mesh_neighbourhood'; +import { RGBAColours } from '../src/colour'; +import { OtS_VoxelMesh } from '../src/ots_voxel_mesh'; +import { OtS_FaceVisibility, OtS_VoxelMesh_Neighbourhood } from '../src/ots_voxel_mesh_neighbourhood'; test('VoxelMesh Neighbourhood #1', () => { const voxelMesh = new OtS_VoxelMesh(); diff --git a/tests/preamble.ts b/Core/tests/preamble.ts similarity index 70% rename from tests/preamble.ts rename to Core/tests/preamble.ts index 1370d20..6db21a0 100644 --- a/tests/preamble.ts +++ b/Core/tests/preamble.ts @@ -1,7 +1,7 @@ import fs from 'fs'; -import { Logger } from '../src/runtime/util/log_util'; -import { AppPaths, PathUtil } from '../src/runtime/util/path_util'; +import { Logger } from '../src/util/log_util'; +import { AppPaths, PathUtil } from '../src/util/path_util'; export const TEST_PREAMBLE = () => { Logger.Get.disableLogToFile(); diff --git a/tests/ray.test.ts b/Core/tests/ray.test.ts similarity index 92% rename from tests/ray.test.ts rename to Core/tests/ray.test.ts index d0c2b7e..2f5708a 100644 --- a/tests/ray.test.ts +++ b/Core/tests/ray.test.ts @@ -1,7 +1,7 @@ -import { Axes, Ray, rayIntersectTriangle } from '../src/runtime/ray'; -import { Triangle } from '../src/runtime/triangle'; -import { ASSERT } from '../src/runtime/util/error_util'; -import { Vector3 } from '../src/runtime/vector'; +import { Axes, Ray, rayIntersectTriangle } from '../src/ray'; +import { Triangle } from '../src/triangle'; +import { ASSERT } from '../src/util/error_util'; +import { Vector3 } from '../src/vector'; import { TEST_PREAMBLE } from './preamble'; test('rayIntersectTriangle x-axis #1', () => { diff --git a/tests/util.test.ts b/Core/tests/util.test.ts similarity index 97% rename from tests/util.test.ts rename to Core/tests/util.test.ts index 414056a..f3f9262 100644 --- a/tests/util.test.ts +++ b/Core/tests/util.test.ts @@ -1,6 +1,6 @@ -import { AppUtil } from '../src/runtime/util'; -import { ASSERT } from '../src/runtime/util/error_util'; -import { REGEX_NUMBER, REGEX_NZ_ANY, RegExpBuilder } from '../src/runtime/util/regex_util'; +import { AppUtil } from '../src/util'; +import { ASSERT } from '../src/util/error_util'; +import { REGEX_NUMBER, REGEX_NZ_ANY, RegExpBuilder } from '../src/util/regex_util'; import { TEST_PREAMBLE } from './preamble'; test('RegExpBuilder', () => { diff --git a/tools/benchmark.ts b/Core/tools/benchmark.ts similarity index 83% rename from tools/benchmark.ts rename to Core/tools/benchmark.ts index 826e6a3..03a3798 100644 --- a/tools/benchmark.ts +++ b/Core/tools/benchmark.ts @@ -1,13 +1,13 @@ import fs from 'fs'; import path from 'path'; -import { ObjImporter } from "../src/runtime/importers/obj_importer"; -import { OtS_VoxelMesh_Converter } from '../src/runtime/ots_voxel_mesh_converter'; -import { BlockMesh } from '../src/runtime/block_mesh'; -import { PALETTE_ALL_RELEASE } from '../res/palettes/all'; +import { ObjImporter } from "../src/importers/obj_importer"; +import { OtS_VoxelMesh_Converter } from '../src/ots_voxel_mesh_converter'; +import { BlockMesh } from '../src/block_mesh'; +import { PALETTE_ALL_RELEASE } from '../../Editor/res/palettes/all'; import { createReadableStream, createOtSTexture } from './util'; -import { TexturedMaterial } from 'src/runtime/materials'; -import { ASSERT } from 'src/runtime/util/error_util'; +import { TexturedMaterial } from 'Core/src/materials'; +import { ASSERT } from 'Core/src/util/error_util'; (async () => { const pathModel = path.join(__dirname, '../res/samples/skull.obj'); diff --git a/tools/build-atlas.ts b/Core/tools/build-atlas.ts similarity index 98% rename from tools/build-atlas.ts rename to Core/tools/build-atlas.ts index 384bf3e..08e1906 100644 --- a/tools/build-atlas.ts +++ b/Core/tools/build-atlas.ts @@ -3,9 +3,9 @@ import fs from 'fs'; import path from 'path'; import sharp from 'sharp'; -import { ASSERT } from '../src/runtime/util/error_util'; -import { RGBAUtil } from '../src/runtime/colour'; -import { RGBA } from '../src/runtime/colour'; +import { ASSERT } from '../src/util/error_util'; +import { RGBAUtil } from '../src/colour'; +import { RGBA } from '../src/colour'; export function getAverageColour(image: Uint8ClampedArray): RGBA { let r = 0; diff --git a/tools/headless-config.ts b/Core/tools/headless-config.ts similarity index 90% rename from tools/headless-config.ts rename to Core/tools/headless-config.ts index 4e66bce..1d27a86 100644 --- a/tools/headless-config.ts +++ b/Core/tools/headless-config.ts @@ -1,5 +1,5 @@ -import { PALETTE_ALL_RELEASE } from '../res/palettes/all'; -import { Vector3 } from '../src/runtime/vector'; +import { PALETTE_ALL_RELEASE } from '../../Editor/res/palettes/all'; +import { Vector3 } from '../src/vector'; import { THeadlessConfig } from './headless'; export const headlessConfig: THeadlessConfig = { diff --git a/tools/headless.ts b/Core/tools/headless.ts similarity index 92% rename from tools/headless.ts rename to Core/tools/headless.ts index fec8e54..6a3af0f 100644 --- a/tools/headless.ts +++ b/Core/tools/headless.ts @@ -1,7 +1,7 @@ -import { StatusHandler } from '../src/editor/status'; -import { LOG_MAJOR, Logger, TIME_END, TIME_START } from '../src/runtime/util/log_util'; -import { WorkerClient } from '../src/editor/worker/worker_client'; -import { AssignParams, ExportParams, ImportParams, VoxeliseParams } from '../src/editor/worker/worker_types'; +import { StatusHandler } from '../../Editor/src/status'; +import { LOG_MAJOR, Logger, TIME_END, TIME_START } from '../src/util/log_util'; +import { WorkerClient } from '../../Editor/src/worker/worker_client'; +import { AssignParams, ExportParams, ImportParams, VoxeliseParams } from '../../Editor/src/worker/worker_types'; export type THeadlessConfig = { import: ImportParams.Input, diff --git a/tools/models-ignore-list.txt b/Core/tools/models-ignore-list.txt similarity index 100% rename from tools/models-ignore-list.txt rename to Core/tools/models-ignore-list.txt diff --git a/tools/run-headless.ts b/Core/tools/run-headless.ts similarity index 67% rename from tools/run-headless.ts rename to Core/tools/run-headless.ts index 5c84e06..55522c5 100644 --- a/tools/run-headless.ts +++ b/Core/tools/run-headless.ts @@ -1,5 +1,5 @@ -import { LOG_MAJOR } from '../src/runtime/util/log_util'; -import { AppPaths, PathUtil } from '../src/runtime/util/path_util'; +import { LOG_MAJOR } from '../src/util/log_util'; +import { AppPaths, PathUtil } from '../src/util/path_util'; import { runHeadless } from './headless'; import { headlessConfig } from './headless-config'; diff --git a/tools/util.ts b/Core/tools/util.ts similarity index 95% rename from tools/util.ts rename to Core/tools/util.ts index f625baf..545a022 100644 --- a/tools/util.ts +++ b/Core/tools/util.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import { PNG } from 'pngjs'; import { decode as jpegDecode } from 'jpeg-js'; -import { OtS_Texture } from 'src/runtime/ots_texture'; +import { OtS_Texture } from 'Core/src/ots_texture'; export function createReadableStream(p: fs.PathLike) { return new ReadableStream({ diff --git a/Core/tsconfig.json b/Core/tsconfig.json new file mode 100644 index 0000000..d2bc31f --- /dev/null +++ b/Core/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "lib": [ "es2022" ], + "module": "commonjs", + "target": "es2022", + + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + + "outDir": "lib" + }, + "include": ["src/**/*", "index.ts"] + } \ No newline at end of file diff --git a/firebase.json b/Editor/firebase.json similarity index 100% rename from firebase.json rename to Editor/firebase.json diff --git a/loc/base.ts b/Editor/loc/base.ts similarity index 87% rename from loc/base.ts rename to Editor/loc/base.ts index 727f322..e820225 100644 --- a/loc/base.ts +++ b/Editor/loc/base.ts @@ -1,4 +1,4 @@ -import { DeepPartial } from '../src/runtime/util/type_util'; +import { DeepPartial } from '../../Core/src/util/type_util'; import { en_GB } from './en_GB'; import { en_US } from './en_US'; import { fr_FR } from './fr_FR'; diff --git a/loc/en_GB.ts b/Editor/loc/en_GB.ts similarity index 100% rename from loc/en_GB.ts rename to Editor/loc/en_GB.ts diff --git a/loc/en_US.ts b/Editor/loc/en_US.ts similarity index 100% rename from loc/en_US.ts rename to Editor/loc/en_US.ts diff --git a/loc/fr_FR.ts b/Editor/loc/fr_FR.ts similarity index 100% rename from loc/fr_FR.ts rename to Editor/loc/fr_FR.ts diff --git a/loc/ru_RU.ts b/Editor/loc/ru_RU.ts similarity index 100% rename from loc/ru_RU.ts rename to Editor/loc/ru_RU.ts diff --git a/loc/zh_CN.ts b/Editor/loc/zh_CN.ts similarity index 100% rename from loc/zh_CN.ts rename to Editor/loc/zh_CN.ts diff --git a/Editor/package.json b/Editor/package.json new file mode 100644 index 0000000..c0c8555 --- /dev/null +++ b/Editor/package.json @@ -0,0 +1,16 @@ +{ + "name": "ots-editor", + "private": true, + "version": "1.0.0", + "description": "", + "main": "index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/public/index.html b/Editor/public/index.html similarity index 100% rename from public/index.html rename to Editor/public/index.html diff --git a/public/styles.css b/Editor/public/styles.css similarity index 100% rename from public/styles.css rename to Editor/public/styles.css diff --git a/res/atlases/vanilla.atlas b/Editor/res/atlases/vanilla.atlas similarity index 100% rename from res/atlases/vanilla.atlas rename to Editor/res/atlases/vanilla.atlas diff --git a/res/atlases/vanilla.png b/Editor/res/atlases/vanilla.png similarity index 100% rename from res/atlases/vanilla.png rename to Editor/res/atlases/vanilla.png diff --git a/res/block_ids.ts b/Editor/res/block_ids.ts similarity index 100% rename from res/block_ids.ts rename to Editor/res/block_ids.ts diff --git a/res/icon.icns b/Editor/res/icon.icns similarity index 100% rename from res/icon.icns rename to Editor/res/icon.icns diff --git a/res/icon.ico b/Editor/res/icon.ico similarity index 100% rename from res/icon.ico rename to Editor/res/icon.ico diff --git a/res/icon.png b/Editor/res/icon.png similarity index 100% rename from res/icon.png rename to Editor/res/icon.png diff --git a/res/palettes/all.ts b/Editor/res/palettes/all.ts similarity index 100% rename from res/palettes/all.ts rename to Editor/res/palettes/all.ts diff --git a/res/palettes/colourful.ts b/Editor/res/palettes/colourful.ts similarity index 100% rename from res/palettes/colourful.ts rename to Editor/res/palettes/colourful.ts diff --git a/res/palettes/greyscale.ts b/Editor/res/palettes/greyscale.ts similarity index 100% rename from res/palettes/greyscale.ts rename to Editor/res/palettes/greyscale.ts diff --git a/res/palettes/schematic-friendly.ts b/Editor/res/palettes/schematic-friendly.ts similarity index 100% rename from res/palettes/schematic-friendly.ts rename to Editor/res/palettes/schematic-friendly.ts diff --git a/res/samples/editor.png b/Editor/res/samples/editor.png similarity index 100% rename from res/samples/editor.png rename to Editor/res/samples/editor.png diff --git a/res/samples/noodles.png b/Editor/res/samples/noodles.png similarity index 100% rename from res/samples/noodles.png rename to Editor/res/samples/noodles.png diff --git a/res/samples/skull.jpg b/Editor/res/samples/skull.jpg similarity index 100% rename from res/samples/skull.jpg rename to Editor/res/samples/skull.jpg diff --git a/res/samples/skull.mtl b/Editor/res/samples/skull.mtl similarity index 100% rename from res/samples/skull.mtl rename to Editor/res/samples/skull.mtl diff --git a/res/samples/skull.obj b/Editor/res/samples/skull.obj similarity index 100% rename from res/samples/skull.obj rename to Editor/res/samples/skull.obj diff --git a/res/samples/skull.txt b/Editor/res/samples/skull.txt similarity index 100% rename from res/samples/skull.txt rename to Editor/res/samples/skull.txt diff --git a/res/shaders/block_fragment.fs b/Editor/res/shaders/block_fragment.fs similarity index 100% rename from res/shaders/block_fragment.fs rename to Editor/res/shaders/block_fragment.fs diff --git a/res/shaders/block_vertex.vs b/Editor/res/shaders/block_vertex.vs similarity index 100% rename from res/shaders/block_vertex.vs rename to Editor/res/shaders/block_vertex.vs diff --git a/res/shaders/debug_fragment.fs b/Editor/res/shaders/debug_fragment.fs similarity index 100% rename from res/shaders/debug_fragment.fs rename to Editor/res/shaders/debug_fragment.fs diff --git a/res/shaders/debug_vertex.vs b/Editor/res/shaders/debug_vertex.vs similarity index 100% rename from res/shaders/debug_vertex.vs rename to Editor/res/shaders/debug_vertex.vs diff --git a/res/shaders/solid_tri_fragment.fs b/Editor/res/shaders/solid_tri_fragment.fs similarity index 100% rename from res/shaders/solid_tri_fragment.fs rename to Editor/res/shaders/solid_tri_fragment.fs diff --git a/res/shaders/solid_tri_vertex.vs b/Editor/res/shaders/solid_tri_vertex.vs similarity index 100% rename from res/shaders/solid_tri_vertex.vs rename to Editor/res/shaders/solid_tri_vertex.vs diff --git a/res/shaders/texture_tri_fragment.fs b/Editor/res/shaders/texture_tri_fragment.fs similarity index 100% rename from res/shaders/texture_tri_fragment.fs rename to Editor/res/shaders/texture_tri_fragment.fs diff --git a/res/shaders/texture_tri_vertex.vs b/Editor/res/shaders/texture_tri_vertex.vs similarity index 100% rename from res/shaders/texture_tri_vertex.vs rename to Editor/res/shaders/texture_tri_vertex.vs diff --git a/res/shaders/voxel_fragment.fs b/Editor/res/shaders/voxel_fragment.fs similarity index 100% rename from res/shaders/voxel_fragment.fs rename to Editor/res/shaders/voxel_fragment.fs diff --git a/res/shaders/voxel_vertex.vs b/Editor/res/shaders/voxel_vertex.vs similarity index 100% rename from res/shaders/voxel_vertex.vs rename to Editor/res/shaders/voxel_vertex.vs diff --git a/src/editor/analytics.ts b/Editor/src/analytics.ts similarity index 100% rename from src/editor/analytics.ts rename to Editor/src/analytics.ts diff --git a/src/editor/app_context.ts b/Editor/src/app_context.ts similarity index 97% rename from src/editor/app_context.ts rename to Editor/src/app_context.ts index 38c6c0b..044119b 100644 --- a/src/editor/app_context.ts +++ b/Editor/src/app_context.ts @@ -1,7 +1,7 @@ import ATLAS_VANILLA from '../../res/atlases/vanilla.atlas'; import { AppAnalytics } from './analytics'; -import { FallableBehaviour } from '../runtime/block_mesh'; +import { FallableBehaviour } from '../../Core/src/block_mesh'; import { ArcballCamera } from './renderer/camera'; import { AppConfig } from './config'; import { EAppEvent, EventManager } from './event'; @@ -10,11 +10,11 @@ import { MouseManager } from './mouse'; import { MeshType, Renderer } from './renderer/renderer'; import { AppConsole, TMessage } from './ui/console'; import { UI } from './ui/layout'; -import { EAction } from '../runtime/util'; -import { ASSERT } from '../runtime/util/error_util'; -import { download, downloadAsZip } from '../runtime/util/file_util'; -import { LOG_ERROR, Logger } from '../runtime/util/log_util'; -import { Vector3 } from '../runtime/vector'; +import { EAction } from '../../Core/src/util'; +import { ASSERT } from '../../Core/src/util/error_util'; +import { download, downloadAsZip } from '../../Core/src/util/file_util'; +import { LOG_ERROR, Logger } from '../../Core/src/util/log_util'; +import { Vector3 } from '../../Core/src/vector'; import { WorkerController } from './worker/worker_controller'; import { TFromWorkerMessage } from './worker/worker_types'; diff --git a/src/editor/buffer.ts b/Editor/src/buffer.ts similarity index 96% rename from src/editor/buffer.ts rename to Editor/src/buffer.ts index 35aae5b..b51d029 100644 --- a/src/editor/buffer.ts +++ b/Editor/src/buffer.ts @@ -1,7 +1,7 @@ -import { ASSERT } from '../runtime/util/error_util'; -import { OtS_Mesh } from '../runtime/ots_mesh'; -import { Triangle } from '../runtime/triangle'; -import { Material } from 'src/runtime/materials'; +import { ASSERT } from '../../Core/src/util/error_util'; +import { OtS_Mesh } from '../../Core/src/ots_mesh'; +import { Triangle } from '../../Core/src/triangle'; +import { Material } from 'Core/src/materials'; export type TMeshBuffer = { position: { numComponents: 3, data: Float32Array }, diff --git a/src/editor/config.ts b/Editor/src/config.ts similarity index 95% rename from src/editor/config.ts rename to Editor/src/config.ts index 40cbfdc..a9cc8cc 100644 --- a/src/editor/config.ts +++ b/Editor/src/config.ts @@ -1,5 +1,5 @@ -import { RGBA } from '../runtime/colour'; -import { LOG } from '../runtime/util/log_util'; +import { RGBA } from '../../Core/src/colour'; +import { LOG } from '../../Core/src/util/log_util'; export class AppConfig { /* Singleton */ diff --git a/src/editor/event.ts b/Editor/src/event.ts similarity index 92% rename from src/editor/event.ts rename to Editor/src/event.ts index c87fd52..131cd04 100644 --- a/src/editor/event.ts +++ b/Editor/src/event.ts @@ -1,7 +1,7 @@ -import { AppContext } from '../editor/app_context'; -import { UI } from '../editor/ui/layout'; -import { ASSERT } from '../runtime/util/error_util'; -import { LOG } from '../runtime/util/log_util'; +import { AppContext } from './app_context'; +import { UI } from './ui/layout'; +import { ASSERT } from '../../Core/src/util/error_util'; +import { LOG } from '../../Core/src/util/log_util'; /* eslint-disable */ export enum EAppEvent { diff --git a/src/global.d.ts b/Editor/src/global.d.ts similarity index 100% rename from src/global.d.ts rename to Editor/src/global.d.ts diff --git a/src/editor/localiser.ts b/Editor/src/localiser.ts similarity index 90% rename from src/editor/localiser.ts rename to Editor/src/localiser.ts index f2e8834..63826fe 100644 --- a/src/editor/localiser.ts +++ b/Editor/src/localiser.ts @@ -1,10 +1,10 @@ import i18next from 'i18next'; -import { locales, TTranslationMap } from '../../loc/base'; -import { AppConfig } from '../editor/config'; +import { locales, TTranslationMap } from '../loc/base'; +import { AppConfig } from './config'; import { EAppEvent, EventManager } from './event'; -import { ASSERT } from '../runtime/util/error_util'; -import { DeepPartial, TBrand } from '../runtime/util/type_util'; +import { ASSERT } from '../../Core/src/util/error_util'; +import { DeepPartial, TBrand } from '../../Core/src/util/type_util'; // https://stackoverflow.com/questions/58277973/how-to-type-check-i18n-dictionaries-with-typescript diff --git a/src/editor/main.ts b/Editor/src/main.ts similarity index 100% rename from src/editor/main.ts rename to Editor/src/main.ts diff --git a/src/editor/mouse.ts b/Editor/src/mouse.ts similarity index 100% rename from src/editor/mouse.ts rename to Editor/src/mouse.ts diff --git a/src/editor/progress.ts b/Editor/src/progress.ts similarity index 95% rename from src/editor/progress.ts rename to Editor/src/progress.ts index aed84fe..d6ddd21 100644 --- a/src/editor/progress.ts +++ b/Editor/src/progress.ts @@ -1,6 +1,6 @@ import { EAppEvent, EventManager } from './event'; -import { ASSERT } from '../runtime/util/error_util'; -import { LOGF } from '../runtime/util/log_util'; +import { ASSERT } from '../../Core/src/util/error_util'; +import { LOGF } from '../../Core/src/util/log_util'; export type TTaskID = | 'Importing' diff --git a/src/editor/renderer/buffer_block_mesh.ts b/Editor/src/renderer/buffer_block_mesh.ts similarity index 96% rename from src/editor/renderer/buffer_block_mesh.ts rename to Editor/src/renderer/buffer_block_mesh.ts index d39f219..b99f49b 100644 --- a/src/editor/renderer/buffer_block_mesh.ts +++ b/Editor/src/renderer/buffer_block_mesh.ts @@ -1,9 +1,9 @@ import { TBlockMeshBuffer, TBlockMeshBufferDescription, TVoxelMeshBuffer } from "../buffer"; import { AppConfig } from "../config"; -import { ASSERT } from "../../runtime/util/error_util"; -import { AppUtil } from "../../runtime/util"; -import { AppConstants } from "../../runtime/constants"; -import { Block, BlockMesh } from "../../runtime/block_mesh"; +import { ASSERT } from "../../../Core/src/util/error_util"; +import { AppUtil } from "../../../Core/src/util"; +import { AppConstants } from "../../../Core/src/constants"; +import { Block, BlockMesh } from "../../../Core/src/block_mesh"; import { BufferGenerator_VoxelMesh } from "./buffer_voxel_mesh"; export type TBuffer_BlockMesh = TBlockMeshBufferDescription & { moreBlocksToBuffer: boolean, progress: number }; diff --git a/src/editor/renderer/buffer_voxel_mesh.ts b/Editor/src/renderer/buffer_voxel_mesh.ts similarity index 92% rename from src/editor/renderer/buffer_voxel_mesh.ts rename to Editor/src/renderer/buffer_voxel_mesh.ts index 4507ca7..29fe346 100644 --- a/src/editor/renderer/buffer_voxel_mesh.ts +++ b/Editor/src/renderer/buffer_voxel_mesh.ts @@ -1,14 +1,14 @@ import { TVoxelMeshBuffer, TVoxelMeshBufferDescription } from '../buffer'; import { AppConfig } from "../config"; -import { ASSERT } from "../../runtime/util/error_util"; -import { Vector3 } from "../../runtime/vector"; +import { ASSERT } from "../../../Core/src/util/error_util"; +import { Vector3 } from "../../../Core/src/vector"; import { GeometryTemplates } from "./geometry"; import { AttributeData } from "./render_buffer"; -import { AppUtil, TOptional } from "../../runtime/util"; -import { AppConstants } from "../../runtime/constants"; -import { OcclusionManager } from "../../runtime/occlusion"; -import { OtS_Voxel, OtS_VoxelMesh } from '../../runtime/ots_voxel_mesh'; -import { OtS_VoxelMesh_Neighbourhood } from '../../runtime/ots_voxel_mesh_neighbourhood'; +import { AppUtil, TOptional } from "../../../Core/src/util"; +import { AppConstants } from "../../../Core/src/constants"; +import { OcclusionManager } from "../../../Core/src/occlusion"; +import { OtS_Voxel, OtS_VoxelMesh } from '../../../Core/src/ots_voxel_mesh'; +import { OtS_VoxelMesh_Neighbourhood } from '../../../Core/src/ots_voxel_mesh_neighbourhood'; export type TBuffer_VoxelMesh = TVoxelMeshBufferDescription & { moreVoxelsToBuffer: boolean, progress: number }; diff --git a/src/editor/renderer/camera.ts b/Editor/src/renderer/camera.ts similarity index 98% rename from src/editor/renderer/camera.ts rename to Editor/src/renderer/camera.ts index 2cffa10..2dde114 100644 --- a/src/editor/renderer/camera.ts +++ b/Editor/src/renderer/camera.ts @@ -1,11 +1,11 @@ import { m4, v3 } from 'twgl.js'; import { AppConfig } from '../config'; -import { AppMath, between, clamp, degreesToRadians, roundToNearest, SmoothVariable, SmoothVectorVariable } from '../../runtime/math'; +import { AppMath, between, clamp, degreesToRadians, roundToNearest, SmoothVariable, SmoothVectorVariable } from '../../../Core/src/math'; import { MouseManager } from '../mouse'; import { Renderer } from './renderer'; -import { ASSERT } from '../../runtime/util/error_util'; -import { Vector3 } from '../../runtime/vector'; +import { ASSERT } from '../../../Core/src/util/error_util'; +import { Vector3 } from '../../../Core/src/vector'; export class ArcballCamera { public isUserRotating = false; diff --git a/src/editor/renderer/geometry.ts b/Editor/src/renderer/geometry.ts similarity index 98% rename from src/editor/renderer/geometry.ts rename to Editor/src/renderer/geometry.ts index 80f32cf..dbc9996 100644 --- a/src/editor/renderer/geometry.ts +++ b/Editor/src/renderer/geometry.ts @@ -1,12 +1,12 @@ import * as twgl from 'twgl.js'; -import { Bounds } from '../../runtime/bounds'; -import { RGBA } from '../../runtime/colour'; +import { Bounds } from '../../../Core/src/bounds'; +import { RGBA } from '../../../Core/src/colour'; import { AttributeData, MergeAttributeData, RenderBuffer } from './render_buffer'; -import { Triangle, UVTriangle } from '../../runtime/triangle'; -import { ASSERT } from '../../runtime/util/error_util'; -import { Vector3 } from '../../runtime/vector'; -import { OtS_VoxelMesh } from '../../runtime/ots_voxel_mesh'; +import { Triangle, UVTriangle } from '../../../Core/src/triangle'; +import { ASSERT } from '../../../Core/src/util/error_util'; +import { Vector3 } from '../../../Core/src/vector'; +import { OtS_VoxelMesh } from '../../../Core/src/ots_voxel_mesh'; export class GeometryTemplates { private static readonly _default_cube = twgl.primitives.createCubeVertices(1.0); diff --git a/src/editor/renderer/render_buffer.ts b/Editor/src/renderer/render_buffer.ts similarity index 99% rename from src/editor/renderer/render_buffer.ts rename to Editor/src/renderer/render_buffer.ts index fba7011..40d48c3 100644 --- a/src/editor/renderer/render_buffer.ts +++ b/Editor/src/renderer/render_buffer.ts @@ -1,7 +1,7 @@ import * as twgl from 'twgl.js'; import { Renderer } from './renderer'; -import { ASSERT } from '../../runtime/util/error_util'; +import { ASSERT } from '../../../Core/src/util/error_util'; export interface Attribute { name: string, diff --git a/src/editor/renderer/renderer.ts b/Editor/src/renderer/renderer.ts similarity index 98% rename from src/editor/renderer/renderer.ts rename to Editor/src/renderer/renderer.ts index 2ed0365..542c8b0 100644 --- a/src/editor/renderer/renderer.ts +++ b/Editor/src/renderer/renderer.ts @@ -2,20 +2,20 @@ import ATLAS_VANILLA from '../../../res/atlases/vanilla.atlas'; import * as twgl from 'twgl.js'; import VANILLA_TEXTURE from '../../../res/atlases/vanilla.png'; -import { Bounds } from '../../runtime/bounds'; +import { Bounds } from '../../../Core/src/bounds'; import { ArcballCamera } from './camera'; -import { RGBA, RGBAUtil } from '../../runtime/colour'; +import { RGBA, RGBAUtil } from '../../../Core/src/colour'; import { AppConfig } from '../config'; import { DebugGeometryTemplates } from './geometry'; import { RenderBuffer } from './render_buffer'; import { ShaderManager } from './shaders'; -import { ASSERT } from '../../runtime/util/error_util'; -import { Vector3 } from '../../runtime/vector'; +import { ASSERT } from '../../../Core/src/util/error_util'; +import { Vector3 } from '../../../Core/src/vector'; import { RenderMeshParams, RenderNextBlockMeshChunkParams, RenderNextVoxelMeshChunkParams } from '../worker/worker_types'; -import { UIUtil } from '../../runtime/util/ui_util'; -import { TAxis } from '../../runtime/util/type_util'; -import { Atlas } from '../../runtime/atlas'; -import { Material } from '../../runtime/materials'; +import { UIUtil } from '../../../Core/src/util/ui_util'; +import { TAxis } from '../../../Core/src/util/type_util'; +import { Atlas } from '../../../Core/src/atlas'; +import { Material } from '../../../Core/src/materials'; /* eslint-disable */ export enum MeshType { diff --git a/src/editor/renderer/shaders.ts b/Editor/src/renderer/shaders.ts similarity index 100% rename from src/editor/renderer/shaders.ts rename to Editor/src/renderer/shaders.ts diff --git a/src/editor/status.ts b/Editor/src/status.ts similarity index 96% rename from src/editor/status.ts rename to Editor/src/status.ts index 521e197..03e6b56 100644 --- a/src/editor/status.ts +++ b/Editor/src/status.ts @@ -1,6 +1,6 @@ import { TLocalisedString } from './localiser'; import { TMessage } from './ui/console'; -import { LOG, LOG_ERROR, LOG_WARN } from '../runtime/util/log_util'; +import { LOG, LOG_ERROR, LOG_WARN } from '../../Core/src/util/log_util'; /** * `StatusHandler` is used to track success, info, warning, and error messages. diff --git a/src/editor/texture_reader.ts b/Editor/src/texture_reader.ts similarity index 89% rename from src/editor/texture_reader.ts rename to Editor/src/texture_reader.ts index 19deb94..cacedd3 100644 --- a/src/editor/texture_reader.ts +++ b/Editor/src/texture_reader.ts @@ -1,8 +1,8 @@ import { decode as jpegDecode } from 'jpeg-js'; import { PNG } from 'pngjs'; -import { OtS_Texture } from "../runtime/ots_texture"; -import { TTexelExtension, TTexelInterpolation } from "../runtime/util/type_util"; +import { OtS_Texture } from "../../Core/src/ots_texture"; +import { TTexelExtension, TTexelInterpolation } from "../../Core/src/util/type_util"; export type OtSE_TextureFormat = 'png' | 'jpg'; diff --git a/src/editor/ui/components/base.ts b/Editor/src/ui/components/base.ts similarity index 96% rename from src/editor/ui/components/base.ts rename to Editor/src/ui/components/base.ts index f958056..4a30f30 100644 --- a/src/editor/ui/components/base.ts +++ b/Editor/src/ui/components/base.ts @@ -1,5 +1,5 @@ -import { getRandomID } from '../../../runtime/util'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { getRandomID } from '../../../../Core/src/util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; export interface IInterfaceItem { generateHTML: () => string; diff --git a/src/editor/ui/components/button.ts b/Editor/src/ui/components/button.ts similarity index 98% rename from src/editor/ui/components/button.ts rename to Editor/src/ui/components/button.ts index ef5816e..2ed706b 100644 --- a/src/editor/ui/components/button.ts +++ b/Editor/src/ui/components/button.ts @@ -1,5 +1,5 @@ import { TLocalisedString } from '../../localiser'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { BaseComponent } from './base'; export class ButtonComponent extends BaseComponent { diff --git a/src/editor/ui/components/checkbox.ts b/Editor/src/ui/components/checkbox.ts similarity index 98% rename from src/editor/ui/components/checkbox.ts rename to Editor/src/ui/components/checkbox.ts index 58c1eaa..bcc0689 100644 --- a/src/editor/ui/components/checkbox.ts +++ b/Editor/src/ui/components/checkbox.ts @@ -1,6 +1,6 @@ -import { TTranslationMap } from '../../../../loc/base'; +import { TTranslationMap } from '../../../loc/base'; import { DeepLeafKeys, LOC } from '../../localiser'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { ConfigComponent } from './config'; export class CheckboxComponent extends ConfigComponent { diff --git a/src/editor/ui/components/colour.ts b/Editor/src/ui/components/colour.ts similarity index 93% rename from src/editor/ui/components/colour.ts rename to Editor/src/ui/components/colour.ts index 208e0d8..3a7ec6a 100644 --- a/src/editor/ui/components/colour.ts +++ b/Editor/src/ui/components/colour.ts @@ -1,4 +1,4 @@ -import { RGBA, RGBAUtil } from '../../../runtime/colour'; +import { RGBA, RGBAUtil } from '../../../../Core/src/colour'; import { ConfigComponent } from './config'; export class ColourComponent extends ConfigComponent { diff --git a/src/editor/ui/components/combobox.ts b/Editor/src/ui/components/combobox.ts similarity index 95% rename from src/editor/ui/components/combobox.ts rename to Editor/src/ui/components/combobox.ts index 00f7660..05d19a4 100644 --- a/src/editor/ui/components/combobox.ts +++ b/Editor/src/ui/components/combobox.ts @@ -1,8 +1,8 @@ -import { TTranslationMap } from '../../../../loc/base'; +import { TTranslationMap } from '../../../loc/base'; import { DeepLeafKeys, LOC } from '../../localiser'; -import { UIUtil } from '../../../runtime/util/ui_util'; -import { AppIcons } from '../../../editor/ui/icons'; -import { HTMLBuilder } from '../../../editor/ui/misc'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; +import { AppIcons } from '../icons'; +import { HTMLBuilder } from '../misc'; import { ConfigComponent } from './config'; export type ComboBoxItem = { diff --git a/src/editor/ui/components/config.ts b/Editor/src/ui/components/config.ts similarity index 97% rename from src/editor/ui/components/config.ts rename to Editor/src/ui/components/config.ts index 9a19a24..2de1749 100644 --- a/src/editor/ui/components/config.ts +++ b/Editor/src/ui/components/config.ts @@ -1,7 +1,7 @@ -import { TTranslationMap } from '../../../../loc/base'; +import { TTranslationMap } from '../../../loc/base'; import { DeepLeafKeys, LOC, TLocalisedString } from '../../localiser'; -import { ASSERT } from '../../../runtime/util/error_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { AppIcons } from '../icons'; import { BaseComponent } from './base'; diff --git a/src/editor/ui/components/file_input.ts b/Editor/src/ui/components/file_input.ts similarity index 93% rename from src/editor/ui/components/file_input.ts rename to Editor/src/ui/components/file_input.ts index c48ba9a..8f99280 100644 --- a/src/editor/ui/components/file_input.ts +++ b/Editor/src/ui/components/file_input.ts @@ -1,9 +1,9 @@ import * as path from 'path'; -import { ASSERT } from '../../../runtime/util/error_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { ConfigComponent } from './config'; -import { AppIcons } from '../../../editor/ui/icons'; +import { AppIcons } from '../icons'; import { LOC } from '../../localiser'; export class FileComponent extends ConfigComponent { diff --git a/src/editor/ui/components/full_config.ts b/Editor/src/ui/components/full_config.ts similarity index 100% rename from src/editor/ui/components/full_config.ts rename to Editor/src/ui/components/full_config.ts diff --git a/src/editor/ui/components/header.ts b/Editor/src/ui/components/header.ts similarity index 96% rename from src/editor/ui/components/header.ts rename to Editor/src/ui/components/header.ts index 0cc598e..069a281 100644 --- a/src/editor/ui/components/header.ts +++ b/Editor/src/ui/components/header.ts @@ -1,10 +1,10 @@ import IMAGE_LOGO from '../../../../res/icon.png'; -import { AppConfig } from '../../../editor/config'; +import { AppConfig } from '../../config'; import { LOC } from '../../localiser'; -import { UIUtil } from '../../../runtime/util/ui_util'; -import { AppIcons } from '../../../editor/ui/icons'; -import { BaseComponent } from '../../../editor/ui/components/base'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; +import { AppIcons } from '../icons'; +import { BaseComponent } from './base'; import { ToolbarItemComponent } from './toolbar_item'; export class HeaderComponent extends BaseComponent { diff --git a/src/editor/ui/components/image.ts b/Editor/src/ui/components/image.ts similarity index 94% rename from src/editor/ui/components/image.ts rename to Editor/src/ui/components/image.ts index 12512a0..c899fdf 100644 --- a/src/editor/ui/components/image.ts +++ b/Editor/src/ui/components/image.ts @@ -1,11 +1,11 @@ import { LOC } from '../../localiser'; -import { getRandomID } from '../../../runtime/util'; -import { ASSERT } from '../../../runtime/util/error_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; -import { AppIcons } from '../../../editor/ui/icons'; +import { getRandomID } from '../../../../Core/src/util'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; +import { AppIcons } from '../icons'; import { ConfigComponent } from './config'; import { ToolbarItemComponent } from './toolbar_item'; -import { TImageRawWrap } from 'src/editor/texture_reader'; +import { TImageRawWrap } from 'Editor/src/texture_reader'; export class ImageComponent extends ConfigComponent, HTMLImageElement> { private _switchElement: ToolbarItemComponent; diff --git a/src/editor/ui/components/material.ts b/Editor/src/ui/components/material.ts similarity index 94% rename from src/editor/ui/components/material.ts rename to Editor/src/ui/components/material.ts index 32560f5..7fcf60e 100644 --- a/src/editor/ui/components/material.ts +++ b/Editor/src/ui/components/material.ts @@ -1,11 +1,11 @@ -import { Material, OtS_MaterialType, SolidMaterial, TexturedMaterial, OtS_Util } from '../../../runtime/materials'; +import { Material, OtS_MaterialType, SolidMaterial, TexturedMaterial, OtS_Util } from '../../../../Core/src/materials'; import { ConfigComponent } from "./config"; import { MaterialTypeComponent } from "./material_type"; import { SolidMaterialComponent } from './solid_material'; import { TexturedMaterialComponent } from "./textured_material"; -import { UIUtil } from "../../../runtime/util/ui_util"; -import { RGBAColours, RGBAUtil } from "../../../runtime/colour"; -import { OtS_Texture } from "../../../runtime/ots_texture"; +import { UIUtil } from "../../../../Core/src/util/ui_util"; +import { RGBAColours, RGBAUtil } from "../../../../Core/src/colour"; +import { OtS_Texture } from "../../../../Core/src/ots_texture"; export class MaterialComponent extends ConfigComponent, HTMLDivElement> { diff --git a/src/editor/ui/components/material_type.ts b/Editor/src/ui/components/material_type.ts similarity index 94% rename from src/editor/ui/components/material_type.ts rename to Editor/src/ui/components/material_type.ts index 19f1a49..dcd19a1 100644 --- a/src/editor/ui/components/material_type.ts +++ b/Editor/src/ui/components/material_type.ts @@ -1,8 +1,8 @@ import { LOC } from '../../localiser'; -import { AppIcons } from '../../../editor/ui/icons'; +import { AppIcons } from '../icons'; import { ConfigComponent } from './config'; import { ToolbarItemComponent } from './toolbar_item'; -import { Material, OtS_MaterialType } from '../../../runtime/materials'; +import { Material, OtS_MaterialType } from '../../../../Core/src/materials'; export class MaterialTypeComponent extends ConfigComponent { private _canBeTextured: boolean; diff --git a/src/editor/ui/components/number_input.ts b/Editor/src/ui/components/number_input.ts similarity index 97% rename from src/editor/ui/components/number_input.ts rename to Editor/src/ui/components/number_input.ts index 5c5f36c..dbb2386 100644 --- a/src/editor/ui/components/number_input.ts +++ b/Editor/src/ui/components/number_input.ts @@ -1,4 +1,4 @@ -import { UIUtil } from '../../../runtime/util/ui_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { ConfigComponent } from './config'; export class NumberComponent extends ConfigComponent { diff --git a/src/editor/ui/components/palette.ts b/Editor/src/ui/components/palette.ts similarity index 96% rename from src/editor/ui/components/palette.ts rename to Editor/src/ui/components/palette.ts index 9589170..a3a5a7b 100644 --- a/src/editor/ui/components/palette.ts +++ b/Editor/src/ui/components/palette.ts @@ -1,15 +1,15 @@ -import { PALETTE_ALL_RELEASE } from '../../../../res/palettes/all'; +import { PALETTE_ALL_RELEASE } from '../../../res/palettes/all'; import { LOC } from '../../localiser'; -import { AppUtil } from '../../../runtime/util'; -import { ASSERT } from '../../../runtime/util/error_util'; -import { download } from '../../../runtime/util/file_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { AppUtil } from '../../../../Core/src/util'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { download } from '../../../../Core/src/util/file_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { AppConsole } from '../console'; -import { AppIcons } from '../../../editor/ui/icons'; +import { AppIcons } from '../icons'; import { CheckboxComponent } from './checkbox'; import { ConfigComponent } from './config'; import { ToolbarItemComponent } from './toolbar_item'; -import { BlockPalette } from 'src/runtime/util/type_util'; +import { BlockPalette } from 'Core/src/util/type_util'; export class PaletteComponent extends ConfigComponent { private _checkboxes: { block: string, element: CheckboxComponent }[]; diff --git a/src/editor/ui/components/placeholder.ts b/Editor/src/ui/components/placeholder.ts similarity index 92% rename from src/editor/ui/components/placeholder.ts rename to Editor/src/ui/components/placeholder.ts index dddb328..f65d2b0 100644 --- a/src/editor/ui/components/placeholder.ts +++ b/Editor/src/ui/components/placeholder.ts @@ -1,6 +1,6 @@ -import { TTranslationMap } from '../../../../loc/base'; +import { TTranslationMap } from '../../../loc/base'; import { DeepLeafKeys, LOC, TLocalisedString } from '../../localiser'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { ConfigComponent } from './config'; export class PlaceholderComponent extends ConfigComponent { diff --git a/src/editor/ui/components/slider.ts b/Editor/src/ui/components/slider.ts similarity index 97% rename from src/editor/ui/components/slider.ts rename to Editor/src/ui/components/slider.ts index ece5dd9..e957ac9 100644 --- a/src/editor/ui/components/slider.ts +++ b/Editor/src/ui/components/slider.ts @@ -1,6 +1,6 @@ -import { clamp, mapRange, wayThrough } from '../../../runtime/math'; -import { ASSERT } from '../../../runtime/util/error_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; +import { clamp, mapRange, wayThrough } from '../../../../Core/src/math'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; import { ConfigComponent } from './config'; export type TSliderParams = { diff --git a/src/editor/ui/components/solid_material.ts b/Editor/src/ui/components/solid_material.ts similarity index 96% rename from src/editor/ui/components/solid_material.ts rename to Editor/src/ui/components/solid_material.ts index 9bb6f7c..d7d612f 100644 --- a/src/editor/ui/components/solid_material.ts +++ b/Editor/src/ui/components/solid_material.ts @@ -1,4 +1,4 @@ -import { OtS_Util, SolidMaterial } from '../../../runtime/materials'; +import { OtS_Util, SolidMaterial } from '../../../../Core/src/materials'; import { ColourComponent } from './colour'; import { ConfigComponent } from './config'; import { SliderComponent } from './slider'; diff --git a/src/editor/ui/components/textured_material.ts b/Editor/src/ui/components/textured_material.ts similarity index 93% rename from src/editor/ui/components/textured_material.ts rename to Editor/src/ui/components/textured_material.ts index f059726..3921af0 100644 --- a/src/editor/ui/components/textured_material.ts +++ b/Editor/src/ui/components/textured_material.ts @@ -1,11 +1,11 @@ -import { TTexelExtension, TTexelInterpolation } from '../../../runtime/util/type_util'; -import { HTMLBuilder } from '../../../editor/ui/misc'; +import { TTexelExtension, TTexelInterpolation } from '../../../../Core/src/util/type_util'; +import { HTMLBuilder } from '../misc'; import { ComboboxComponent } from './combobox'; import { ConfigComponent } from './config'; import { ImageComponent } from './image'; -import { TexturedMaterial } from '../../../runtime/materials'; +import { TexturedMaterial } from '../../../../Core/src/materials'; import { OtSE_TextureReader } from '../../texture_reader'; -import { OtS_Texture } from '../../../runtime/ots_texture'; +import { OtS_Texture } from '../../../../Core/src/ots_texture'; export class TexturedMaterialComponent extends ConfigComponent, HTMLDivElement> { //private _localMaterial: TexturedMaterial; diff --git a/src/editor/ui/components/toolbar_item.ts b/Editor/src/ui/components/toolbar_item.ts similarity index 96% rename from src/editor/ui/components/toolbar_item.ts rename to Editor/src/ui/components/toolbar_item.ts index 35dd995..b7ea585 100644 --- a/src/editor/ui/components/toolbar_item.ts +++ b/Editor/src/ui/components/toolbar_item.ts @@ -1,6 +1,6 @@ -import { ASSERT } from '../../../runtime/util/error_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; -import { BaseComponent } from '../../ui/components/base'; +import { ASSERT } from '../../../../Core/src/util/error_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; +import { BaseComponent } from './base'; import { LOC, TLocalisedKey } from '../../localiser'; export type TToolbarBooleanProperty = 'enabled' | 'active'; diff --git a/src/editor/ui/components/vector.ts b/Editor/src/ui/components/vector.ts similarity index 97% rename from src/editor/ui/components/vector.ts rename to Editor/src/ui/components/vector.ts index ef01f86..f64f735 100644 --- a/src/editor/ui/components/vector.ts +++ b/Editor/src/ui/components/vector.ts @@ -1,6 +1,6 @@ -import { TAxis } from '../../../runtime/util/type_util'; -import { UIUtil } from '../../../runtime/util/ui_util'; -import { Vector3 } from '../../../runtime/vector'; +import { TAxis } from '../../../../Core/src/util/type_util'; +import { UIUtil } from '../../../../Core/src/util/ui_util'; +import { Vector3 } from '../../../../Core/src/vector'; import { ConfigComponent } from './config'; export class VectorComponent extends ConfigComponent { diff --git a/src/editor/ui/console.ts b/Editor/src/ui/console.ts similarity index 96% rename from src/editor/ui/console.ts rename to Editor/src/ui/console.ts index e6ef86c..6138656 100644 --- a/src/editor/ui/console.ts +++ b/Editor/src/ui/console.ts @@ -1,6 +1,6 @@ import { TLocalisedString } from '../localiser'; -import { LOG, LOG_ERROR, LOG_WARN } from '../../runtime/util/log_util'; -import { UIUtil } from '../../runtime/util/ui_util'; +import { LOG, LOG_ERROR, LOG_WARN } from '../../../Core/src/util/log_util'; +import { UIUtil } from '../../../Core/src/util/ui_util'; import { HTMLBuilder } from './misc'; export type TMessage = { text: TLocalisedString, type: 'success' | 'info' | 'warning' | 'error' }; diff --git a/src/editor/ui/icons.ts b/Editor/src/ui/icons.ts similarity index 100% rename from src/editor/ui/icons.ts rename to Editor/src/ui/icons.ts diff --git a/src/editor/ui/layout.ts b/Editor/src/ui/layout.ts similarity index 96% rename from src/editor/ui/layout.ts rename to Editor/src/ui/layout.ts index 41f8256..c82dea0 100644 --- a/src/editor/ui/layout.ts +++ b/Editor/src/ui/layout.ts @@ -1,38 +1,38 @@ import Split from 'split.js'; -import { locales } from '../../../loc/base'; +import { locales } from '../../loc/base'; import { AppContext } from '../app_context'; -import { FallableBehaviour } from '../../runtime/block_mesh'; +import { FallableBehaviour } from '../../../Core/src/block_mesh'; import { ArcballCamera } from '../renderer/camera'; import { EAppEvent, EventManager } from '../event'; -import { TExporters } from '../../runtime/exporters/exporters'; +import { TExporters } from '../../../Core/src/exporters/exporters'; import { LOC, Localiser, TLocalisedString } from '../localiser'; import { MeshType, Renderer } from '../renderer/renderer'; -import { EAction } from '../../runtime/util'; -import { ASSERT } from '../../runtime/util/error_util'; -import { TAxis } from '../../runtime/util/type_util'; -import { TDithering } from '../../runtime/util/type_util'; -import { UIUtil } from '../../runtime/util/ui_util'; +import { EAction } from '../../../Core/src/util'; +import { ASSERT } from '../../../Core/src/util/error_util'; +import { TAxis } from '../../../Core/src/util/type_util'; +import { TDithering } from '../../../Core/src/util/type_util'; +import { UIUtil } from '../../../Core/src/util/ui_util'; import { ButtonComponent } from './components/button'; -import { CheckboxComponent } from '../ui/components/checkbox'; -import { ComboboxComponent } from '../ui/components/combobox'; +import { CheckboxComponent } from './components/checkbox'; +import { ComboboxComponent } from './components/combobox'; import { ConfigComponent } from './components/config'; -import { FileComponent } from '../ui/components/file_input'; -import { HeaderComponent } from '../ui/components/header'; -import { PaletteComponent } from '../ui/components/palette'; -import { PlaceholderComponent } from '../ui/components/placeholder'; -import { SliderComponent } from '../ui/components/slider'; -import { SolidMaterialComponent } from '../ui/components/solid_material'; -import { TexturedMaterialComponent } from '../ui/components/textured_material'; -import { ToolbarItemComponent } from '../ui/components/toolbar_item'; -import { VectorComponent } from '../ui/components/vector'; +import { FileComponent } from './components/file_input'; +import { HeaderComponent } from './components/header'; +import { PaletteComponent } from './components/palette'; +import { PlaceholderComponent } from './components/placeholder'; +import { SliderComponent } from './components/slider'; +import { SolidMaterialComponent } from './components/solid_material'; +import { TexturedMaterialComponent } from './components/textured_material'; +import { ToolbarItemComponent } from './components/toolbar_item'; +import { VectorComponent } from './components/vector'; import { AppConsole } from './console'; import { AppIcons } from './icons'; import { HTMLBuilder, MiscComponents } from './misc'; import { AppConfig } from '../config'; -import { OtS_ReplaceMode } from '../../runtime/ots_voxel_mesh'; -import { Material, TexturedMaterial } from 'src/runtime/materials'; -import { OtS_Texture } from 'src/runtime/ots_texture'; +import { OtS_ReplaceMode } from '../../../Core/src/ots_voxel_mesh'; +import { Material, TexturedMaterial } from 'Core/src/materials'; +import { OtS_Texture } from 'Core/src/ots_texture'; import { MaterialComponent } from './components/material'; export type Group = { diff --git a/src/editor/ui/misc.ts b/Editor/src/ui/misc.ts similarity index 92% rename from src/editor/ui/misc.ts rename to Editor/src/ui/misc.ts index daea08f..99e5ef6 100644 --- a/src/editor/ui/misc.ts +++ b/Editor/src/ui/misc.ts @@ -1,4 +1,4 @@ -import { ASSERT } from '../../runtime/util/error_util'; +import { ASSERT } from '../../../Core/src/util/error_util'; export class HTMLBuilder { private _html: string; diff --git a/src/editor/util/editor_util.ts b/Editor/src/util/editor_util.ts similarity index 100% rename from src/editor/util/editor_util.ts rename to Editor/src/util/editor_util.ts diff --git a/src/editor/worker/worker.ts b/Editor/src/worker/worker.ts similarity index 98% rename from src/editor/worker/worker.ts rename to Editor/src/worker/worker.ts index fa9ea71..712c1bb 100644 --- a/src/editor/worker/worker.ts +++ b/Editor/src/worker/worker.ts @@ -1,6 +1,6 @@ import { ProgressManager } from '../progress'; import { StatusHandler } from '../status'; -import { LOG_ERROR } from '../../runtime/util/log_util'; +import { LOG_ERROR } from '../../../Core/src/util/log_util'; import { WorkerClient } from './worker_client'; import { TFromWorkerMessage, TToWorkerMessage } from './worker_types'; import { AppError } from '../util/editor_util'; diff --git a/src/editor/worker/worker_client.ts b/Editor/src/worker/worker_client.ts similarity index 93% rename from src/editor/worker/worker_client.ts rename to Editor/src/worker/worker_client.ts index c7f8142..4121e6a 100644 --- a/src/editor/worker/worker_client.ts +++ b/Editor/src/worker/worker_client.ts @@ -1,22 +1,22 @@ import path from 'path'; -import { BlockMesh } from '../../runtime/block_mesh'; +import { BlockMesh } from '../../../Core/src/block_mesh'; import { BufferGenerator } from '../buffer'; import { EAppEvent, EventManager } from '../event'; -import { IExporter } from '../../runtime/exporters/base_exporter'; -import { ExporterFactory } from '../../runtime/exporters/exporters'; -import { ImporterFactor } from '../../runtime/importers/importers'; +import { IExporter } from '../../../Core/src/exporters/base_exporter'; +import { ExporterFactory } from '../../../Core/src/exporters/exporters'; +import { ImporterFactor } from '../../../Core/src/importers/importers'; import { LOC, Localiser } from '../localiser'; import { ProgressManager, TTaskHandle } from '../progress'; -import { ASSERT } from '../../runtime/util/error_util'; +import { ASSERT } from '../../../Core/src/util/error_util'; import { AssignParams, ExportParams, ImportParams, InitParams, RenderMeshParams, RenderNextBlockMeshChunkParams, RenderNextVoxelMeshChunkParams, SetMaterialsParams, SettingsParams, TFromWorkerMessage, VoxeliseParams } from './worker_types'; import { StatusHandler } from '../status'; import { BufferGenerator_VoxelMesh } from '../renderer/buffer_voxel_mesh'; import { BufferGenerator_BlockMesh } from '../renderer/buffer_block_mesh'; -import { OtS_VoxelMesh } from '../../runtime/ots_voxel_mesh'; -import { OtS_VoxelMesh_Converter } from '../../runtime/ots_voxel_mesh_converter'; -import { OtS_Mesh } from '../../runtime/ots_mesh'; -import { OtS_Texture } from '../../runtime/ots_texture'; +import { OtS_VoxelMesh } from '../../../Core/src/ots_voxel_mesh'; +import { OtS_VoxelMesh_Converter } from '../../../Core/src/ots_voxel_mesh_converter'; +import { OtS_Mesh } from '../../../Core/src/ots_mesh'; +import { OtS_Texture } from '../../../Core/src/ots_texture'; export class WorkerClient { private static _instance: WorkerClient; diff --git a/src/editor/worker/worker_controller.ts b/Editor/src/worker/worker_controller.ts similarity index 94% rename from src/editor/worker/worker_controller.ts rename to Editor/src/worker/worker_controller.ts index 7ad3349..81788d8 100644 --- a/src/editor/worker/worker_controller.ts +++ b/Editor/src/worker/worker_controller.ts @@ -1,10 +1,10 @@ -import { AppConfig } from '../../editor/config'; -import { EAppEvent, EventManager } from '../../editor/event'; -import { ASSERT } from '../../runtime/util/error_util'; -import { LOG } from '../../runtime/util/log_util'; +import { AppConfig } from '../config'; +import { EAppEvent, EventManager } from '../event'; +import { ASSERT } from '../../../Core/src/util/error_util'; +import { LOG } from '../../../Core/src/util/log_util'; import { doWork } from './worker'; // @ts-ignore -import AppWorker from './worker_interface.worker.ts'; +import AppWorker from './worker_interface.worker'; import { TFromWorkerMessage, TToWorkerMessage } from './worker_types'; export type TWorkerJob = { diff --git a/src/editor/worker/worker_interface.worker.ts b/Editor/src/worker/worker_interface.worker.ts similarity index 100% rename from src/editor/worker/worker_interface.worker.ts rename to Editor/src/worker/worker_interface.worker.ts diff --git a/src/editor/worker/worker_types.ts b/Editor/src/worker/worker_types.ts similarity index 91% rename from src/editor/worker/worker_types.ts rename to Editor/src/worker/worker_types.ts index 68ce81b..d289eed 100644 --- a/src/editor/worker/worker_types.ts +++ b/Editor/src/worker/worker_types.ts @@ -1,14 +1,14 @@ -import { BlockMeshParams } from '../../runtime/block_mesh'; -import { Bounds } from '../../runtime/bounds'; +import { BlockMeshParams } from '../../../Core/src/block_mesh'; +import { Bounds } from '../../../Core/src/bounds'; import { TBlockMeshBufferDescription, TMeshBufferDescription, TVoxelMeshBufferDescription } from '../buffer'; -import { TStructureExport } from '../../runtime/exporters/base_exporter'; -import { TExporters } from '../../runtime/exporters/exporters'; +import { TStructureExport } from '../../../Core/src/exporters/base_exporter'; +import { TExporters } from '../../../Core/src/exporters/exporters'; import { TMessage } from '../ui/console'; -import { TAxis } from '../../runtime/util/type_util'; -import { Vector3 } from '../../runtime/vector'; +import { TAxis } from '../../../Core/src/util/type_util'; +import { Vector3 } from '../../../Core/src/vector'; import { AppError } from '../util/editor_util'; -import { OtS_ReplaceMode } from '../../runtime/ots_voxel_mesh'; -import { Material } from 'src/runtime/materials'; +import { OtS_ReplaceMode } from '../../../Core/src/ots_voxel_mesh'; +import { Material } from 'Core/src/materials'; export namespace InitParams { export type Input = { diff --git a/tsconfig.json b/Editor/tsconfig.json similarity index 100% rename from tsconfig.json rename to Editor/tsconfig.json diff --git a/webpack.common.js b/Editor/webpack.common.js similarity index 100% rename from webpack.common.js rename to Editor/webpack.common.js diff --git a/webpack.dev.js b/Editor/webpack.dev.js similarity index 100% rename from webpack.dev.js rename to Editor/webpack.dev.js diff --git a/webpack.prod.js b/Editor/webpack.prod.js similarity index 100% rename from webpack.prod.js rename to Editor/webpack.prod.js