@wayward/types 2.11.4-beta.dev.20220218.1 → 2.11.4-beta.dev.20220219.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/game/game/IGame.d.ts +1 -1
- package/definitions/game/renderer/Renderer.d.ts +1 -1
- package/definitions/game/renderer/RendererConstants.d.ts +2 -0
- package/definitions/game/renderer/context/RendererContext.d.ts +1 -0
- package/definitions/game/renderer/particle/IParticleRenderer.d.ts +16 -0
- package/definitions/game/renderer/particle/ParticleRenderer1.d.ts +25 -0
- package/definitions/game/renderer/particle/ParticleRenderer2.d.ts +27 -0
- package/definitions/game/renderer/particle/{Particle.d.ts → ParticleSystem.d.ts} +4 -7
- package/definitions/game/renderer/spriteBatch/SpriteBatch2.d.ts +0 -1
- package/definitions/game/renderer/world/WorldRenderer.d.ts +2 -2
- package/package.json +1 -1
|
@@ -259,5 +259,5 @@ export declare const TURN_DELAY_MAX: number;
|
|
|
259
259
|
export declare const TURN_DELAY_DEFAULT: number;
|
|
260
260
|
export declare const LIGHT_COLOR_DEFAULT: import("utilities/Color").IRGB;
|
|
261
261
|
export declare const TOOLTIP_DELAY_DEFAULT = 170;
|
|
262
|
-
export declare const ZOOM_LEVEL_MAX =
|
|
262
|
+
export declare const ZOOM_LEVEL_MAX = 16;
|
|
263
263
|
export declare const ZOOM_LEVEL_MIN = 1;
|
|
@@ -39,7 +39,7 @@ export default class Renderer extends EventEmitter.Host<IRendererEvents> {
|
|
|
39
39
|
delete(): Promise<void>;
|
|
40
40
|
get fieldOfView(): import("./fieldOfView/FieldOfView").default;
|
|
41
41
|
get notifier(): import("./notifier/Notifier").default;
|
|
42
|
-
get particle(): import("./particle/
|
|
42
|
+
get particle(): import("./particle/ParticleSystem").default;
|
|
43
43
|
get isFadingIn(): boolean;
|
|
44
44
|
get isUpdatingThumbnail(): boolean;
|
|
45
45
|
start(): void;
|
|
@@ -17,3 +17,5 @@ export declare function getPixelOffset(pixels: number): number;
|
|
|
17
17
|
export declare const fourPixelOffset: number;
|
|
18
18
|
export declare const negativeFivePixelOffset: number;
|
|
19
19
|
export declare const defaultFadeInTime = 2000;
|
|
20
|
+
export declare const texCordsPerSprite = 6;
|
|
21
|
+
export declare function createTexCordArray(capacity: number): Float32Array;
|
|
@@ -20,6 +20,7 @@ export default class RendererContext {
|
|
|
20
20
|
readonly gl: WebGL2RenderingContext;
|
|
21
21
|
readonly webGlContext: WebGlContext;
|
|
22
22
|
constructor(renderer: Renderer, baseRendererContext: BaseRendererContext);
|
|
23
|
+
get isWebGl2(): boolean;
|
|
23
24
|
get origin(): IRendererOrigin;
|
|
24
25
|
createSpriteBatch(capacity: number, depthOffset?: number, yOffset?: number): SpriteBatch2 | SpriteBatch1;
|
|
25
26
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
8
|
+
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
|
9
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import type { IProgramDescription } from "renderer/CompiledProgram";
|
|
12
|
+
export interface IParticleRenderer {
|
|
13
|
+
render(x: number, y: number, count: number): void;
|
|
14
|
+
delete(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare const particleRendererShaderProgramDescription: IProgramDescription;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
8
|
+
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
|
9
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import type RendererContext from "renderer/context/RendererContext";
|
|
12
|
+
/**
|
|
13
|
+
* Particle renderer for webgl 1
|
|
14
|
+
*/
|
|
15
|
+
export declare class ParticleRenderer1 {
|
|
16
|
+
private readonly context;
|
|
17
|
+
private readonly positionSizeData;
|
|
18
|
+
private readonly colorData;
|
|
19
|
+
private readonly shaderProgram;
|
|
20
|
+
private readonly positionSizeBuffer;
|
|
21
|
+
private readonly colorBuffer;
|
|
22
|
+
constructor(context: RendererContext, maxParticles: number, positionSizeData: Float32Array, colorData: Uint8Array);
|
|
23
|
+
delete(): void;
|
|
24
|
+
render(x: number, y: number, count: number): boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
8
|
+
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
|
9
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import type RendererContext from "renderer/context/RendererContext";
|
|
12
|
+
/**
|
|
13
|
+
* Particle renderer for webgl 2
|
|
14
|
+
*/
|
|
15
|
+
export declare class ParticleRenderer2 {
|
|
16
|
+
private readonly context;
|
|
17
|
+
private readonly dataArray;
|
|
18
|
+
private readonly colorArray;
|
|
19
|
+
private readonly shaderProgram;
|
|
20
|
+
private readonly texCordBuffer;
|
|
21
|
+
private readonly dataBuffer;
|
|
22
|
+
private readonly colorBuffer;
|
|
23
|
+
private readonly vertexArray;
|
|
24
|
+
constructor(context: RendererContext, maxParticles: number, dataArray: Float32Array, colorArray: Uint8Array);
|
|
25
|
+
delete(): void;
|
|
26
|
+
render(x: number, y: number, count: number): boolean;
|
|
27
|
+
}
|
|
@@ -13,21 +13,18 @@ import type RendererContext from "renderer/context/RendererContext";
|
|
|
13
13
|
import type WebGlContext from "renderer/WebGlContext";
|
|
14
14
|
import type WorldRenderer from "renderer/world/WorldRenderer";
|
|
15
15
|
import type { IRGB } from "utilities/Color";
|
|
16
|
-
export default class
|
|
16
|
+
export default class ParticleSystem {
|
|
17
17
|
private readonly context;
|
|
18
18
|
private readonly worldRenderer;
|
|
19
|
-
private readonly
|
|
20
|
-
private readonly capacity;
|
|
21
|
-
private readonly positionSizeBuffer;
|
|
22
|
-
private readonly colorBuffer;
|
|
19
|
+
private readonly maxParticles;
|
|
23
20
|
private readonly particles;
|
|
24
21
|
private readonly positionSizeData;
|
|
25
22
|
private readonly colorData;
|
|
26
|
-
private readonly
|
|
27
|
-
private readonly vertexArray;
|
|
23
|
+
private readonly dataPerParticle;
|
|
28
24
|
private count;
|
|
29
25
|
private lastUsedParticle;
|
|
30
26
|
private nextUpdate;
|
|
27
|
+
private readonly renderer;
|
|
31
28
|
static initializePrograms(webGlContext: WebGlContext): Promise<void>;
|
|
32
29
|
constructor(context: RendererContext, worldRenderer: WorldRenderer, maxParticles?: number);
|
|
33
30
|
delete(): void;
|
|
@@ -25,7 +25,6 @@ export default class SpriteBatch2 implements ISpriteBatch {
|
|
|
25
25
|
inverseSpriteTextureSize: Vector2 | undefined;
|
|
26
26
|
private spriteCount;
|
|
27
27
|
private readonly texCordBuffer;
|
|
28
|
-
private texCordArray;
|
|
29
28
|
private readonly dataBuffer;
|
|
30
29
|
private dataArray;
|
|
31
30
|
private readonly colorBuffer;
|
|
@@ -16,7 +16,6 @@ import { TerrainType } from "game/tile/ITerrain";
|
|
|
16
16
|
import type { ITile } from "game/tile/ITerrain";
|
|
17
17
|
import FieldOfView from "renderer/fieldOfView/FieldOfView";
|
|
18
18
|
import Notifier from "renderer/notifier/Notifier";
|
|
19
|
-
import Particle from "renderer/particle/Particle";
|
|
20
19
|
import type RendererContext from "renderer/context/RendererContext";
|
|
21
20
|
import type ISpriteBatch from "renderer/spriteBatch/ISpriteBatch";
|
|
22
21
|
import Fence from "renderer/tile/adaptors/Fence";
|
|
@@ -29,6 +28,7 @@ import WorldLayerRenderer from "renderer/world/WorldLayerRenderer";
|
|
|
29
28
|
import Vector2 from "utilities/math/Vector2";
|
|
30
29
|
import type { TerrainTileInfo } from "renderer/tile/TerrainTileInfo";
|
|
31
30
|
import type { IRendererOrigin } from "renderer/context/RendererOrigin";
|
|
31
|
+
import ParticleSystem from "renderer/particle/ParticleSystem";
|
|
32
32
|
export interface IWorldRendererEvents {
|
|
33
33
|
/**
|
|
34
34
|
* Called when calculating creatures in the viewport
|
|
@@ -108,7 +108,7 @@ export default class WorldRenderer extends EventEmitter.Host<IWorldRendererEvent
|
|
|
108
108
|
private readonly worldShaderProgram;
|
|
109
109
|
private readonly fogShaderProgram;
|
|
110
110
|
readonly fieldOfView: FieldOfView;
|
|
111
|
-
readonly
|
|
111
|
+
readonly particleSystem: ParticleSystem;
|
|
112
112
|
readonly notifier: Notifier;
|
|
113
113
|
layers: Record<number, WorldLayerRenderer>;
|
|
114
114
|
tillAdaptor: ITileAdaptor;
|
package/package.json
CHANGED