mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
refactor: draw coastline
This commit is contained in:
parent
1888b04d54
commit
4833a8ab35
8 changed files with 422 additions and 371 deletions
|
|
@ -5,7 +5,7 @@ import {closeDialogs} from "dialogs/utils";
|
|||
import {openDialog} from "dialogs";
|
||||
import {initLayers, restoreLayers} from "layers";
|
||||
// @ts-expect-error js module
|
||||
import {drawCoastline} from "modules/coastline";
|
||||
import {drawCoastline} from "layers/renderers/drawCoastline";
|
||||
// @ts-expect-error js module
|
||||
import {drawScaleBar, Rulers} from "modules/measurers";
|
||||
// @ts-expect-error js module
|
||||
|
|
@ -29,6 +29,7 @@ import {showStatistics} from "../statistics";
|
|||
import {createGrid} from "./grid";
|
||||
import {createPack} from "./pack";
|
||||
import {getInputValue, setInputValue} from "utils/nodeUtils";
|
||||
// import {Ruler} from "modules/measurers";
|
||||
|
||||
const {Zoom, ThreeD} = window;
|
||||
|
||||
|
|
@ -56,6 +57,8 @@ async function generate(options?: IGenerationOptions) {
|
|||
const newGrid = await createGrid(grid, precreatedGraph);
|
||||
const newPack = createPack(newGrid);
|
||||
|
||||
// TODO: draw default ruler
|
||||
|
||||
// redefine global grid and pack
|
||||
grid = newGrid;
|
||||
pack = newPack;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as d3 from "d3";
|
|||
|
||||
import {renderLayer} from "layers";
|
||||
// @ts-expect-error js module
|
||||
import {drawCoastline} from "modules/coastline";
|
||||
import {drawCoastline} from "layers/renderers/drawCoastline";
|
||||
import {markupPackFeatures} from "modules/markup";
|
||||
// @ts-expect-error js module
|
||||
import {drawScaleBar} from "modules/measurers";
|
||||
|
|
@ -24,6 +24,8 @@ export function createPack(grid: IGrid): IPack {
|
|||
|
||||
const markup = markupPackFeatures(grid, vertices, pick(cells, "v", "c", "b", "p", "h"));
|
||||
|
||||
renderLayer("coastline", vertices, markup.features);
|
||||
|
||||
// drawCoastline({vertices, cells}); // split into vertices definition and rendering
|
||||
|
||||
// Rivers.generate(newPack, grid);
|
||||
|
|
@ -131,3 +133,6 @@ function repackGrid(grid: IGrid) {
|
|||
TIME && console.timeEnd("repackGrid");
|
||||
return pack;
|
||||
}
|
||||
function drawLayer(arg0: string, vertices: IGraphVertices, features: TPackFeatures) {
|
||||
throw new Error("Function not implemented.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue