Add files
This commit is contained in:
commit
77bde04db3
97 changed files with 10327 additions and 0 deletions
1
.eslintignore
Normal file
1
.eslintignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
**/*.js
|
||||||
29
.eslintrc.json
Normal file
29
.eslintrc.json
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2020": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier",
|
||||||
|
"prettier/@typescript-eslint"
|
||||||
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 11,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": ["unused-imports", "@typescript-eslint", "prettier"],
|
||||||
|
"rules": {
|
||||||
|
"prettier/prettier": "error",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"unused-imports/no-unused-imports-ts": "error",
|
||||||
|
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*.psd filter=lfs diff=lfs merge=lfs -text
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
dist
|
||||||
|
node_modules
|
||||||
|
package-lock.json
|
||||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"printWidth": 90,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"singleQuote": true,
|
||||||
|
"endOfLine": "lf"
|
||||||
|
}
|
||||||
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.organizeImports": true
|
||||||
|
}
|
||||||
|
}
|
||||||
7839
build/main-bundle.js
Normal file
7839
build/main-bundle.js
Normal file
File diff suppressed because it is too large
Load diff
0
build/src/game.d.ts
vendored
Normal file
0
build/src/game.d.ts
vendored
Normal file
7
build/src/graphics/drawables/i-drawable-descriptor.d.ts
vendored
Normal file
7
build/src/graphics/drawables/i-drawable-descriptor.d.ts
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { IDrawable } from './i-drawable';
|
||||||
|
export interface IDrawableDescriptor {
|
||||||
|
uniformName: string;
|
||||||
|
countMacroName: string;
|
||||||
|
shaderCombinationSteps: Array<number>;
|
||||||
|
readonly empty: IDrawable;
|
||||||
|
}
|
||||||
5
build/src/graphics/drawables/i-drawable.d.ts
vendored
Normal file
5
build/src/graphics/drawables/i-drawable.d.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { vec2, mat2d } from 'gl-matrix';
|
||||||
|
export interface IDrawable {
|
||||||
|
distance(target: vec2): number;
|
||||||
|
serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void;
|
||||||
|
}
|
||||||
14
build/src/graphics/drawables/lights/circle-light.d.ts
vendored
Normal file
14
build/src/graphics/drawables/lights/circle-light.d.ts
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { mat2d, vec2, vec3 } from 'gl-matrix';
|
||||||
|
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||||
|
import { ILight } from './i-light';
|
||||||
|
export declare class CircleLight implements ILight {
|
||||||
|
center: vec2;
|
||||||
|
lightDrop: number;
|
||||||
|
color: vec3;
|
||||||
|
lightness: number;
|
||||||
|
static descriptor: IDrawableDescriptor;
|
||||||
|
constructor(center: vec2, lightDrop: number, color: vec3, lightness: number);
|
||||||
|
distance(_: vec2): number;
|
||||||
|
serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void;
|
||||||
|
get value(): vec3;
|
||||||
|
}
|
||||||
15
build/src/graphics/drawables/lights/flashlight.d.ts
vendored
Normal file
15
build/src/graphics/drawables/lights/flashlight.d.ts
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { mat2d, vec2, vec3 } from 'gl-matrix';
|
||||||
|
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||||
|
import { ILight } from './i-light';
|
||||||
|
export declare class Flashlight implements ILight {
|
||||||
|
center: vec2;
|
||||||
|
direction: vec2;
|
||||||
|
lightDrop: number;
|
||||||
|
color: vec3;
|
||||||
|
lightness: number;
|
||||||
|
static descriptor: IDrawableDescriptor;
|
||||||
|
constructor(center: vec2, direction: vec2, lightDrop: number, color: vec3, lightness: number);
|
||||||
|
distance(_: vec2): number;
|
||||||
|
serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void;
|
||||||
|
get value(): vec3;
|
||||||
|
}
|
||||||
2
build/src/graphics/drawables/lights/i-light.d.ts
vendored
Normal file
2
build/src/graphics/drawables/lights/i-light.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { IDrawable } from '../i-drawable';
|
||||||
|
export declare type ILight = IDrawable;
|
||||||
1
build/src/graphics/graphics-library/compiling/check-program.d.ts
vendored
Normal file
1
build/src/graphics/graphics-library/compiling/check-program.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export declare const checkProgram: (gl: WebGL2RenderingContext, program: WebGLProgram) => void;
|
||||||
1
build/src/graphics/graphics-library/compiling/check-shader.d.ts
vendored
Normal file
1
build/src/graphics/graphics-library/compiling/check-shader.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export declare const checkShader: (gl: WebGL2RenderingContext, shader: WebGLShader) => void;
|
||||||
3
build/src/graphics/graphics-library/compiling/create-program.d.ts
vendored
Normal file
3
build/src/graphics/graphics-library/compiling/create-program.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export declare const createProgram: (gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string, substitutions: {
|
||||||
|
[name: string]: string;
|
||||||
|
}) => Promise<WebGLProgram>;
|
||||||
3
build/src/graphics/graphics-library/compiling/create-shader.d.ts
vendored
Normal file
3
build/src/graphics/graphics-library/compiling/create-shader.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export declare const createShader: (gl: WebGL2RenderingContext, type: GLenum, source: string, substitutions: {
|
||||||
|
[name: string]: string;
|
||||||
|
}) => WebGLShader;
|
||||||
5
build/src/graphics/graphics-library/frame-buffer/default-frame-buffer.d.ts
vendored
Normal file
5
build/src/graphics/graphics-library/frame-buffer/default-frame-buffer.d.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { FrameBuffer } from './frame-buffer';
|
||||||
|
export declare class DefaultFrameBuffer extends FrameBuffer {
|
||||||
|
constructor(gl: WebGL2RenderingContext);
|
||||||
|
setSize(): boolean;
|
||||||
|
}
|
||||||
12
build/src/graphics/graphics-library/frame-buffer/frame-buffer.d.ts
vendored
Normal file
12
build/src/graphics/graphics-library/frame-buffer/frame-buffer.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { vec2 } from 'gl-matrix';
|
||||||
|
export declare abstract class FrameBuffer {
|
||||||
|
protected gl: WebGL2RenderingContext;
|
||||||
|
renderScale: number;
|
||||||
|
enableHighDpiRendering: boolean;
|
||||||
|
protected size: vec2;
|
||||||
|
protected frameBuffer: WebGLFramebuffer | null;
|
||||||
|
constructor(gl: WebGL2RenderingContext);
|
||||||
|
bindAndClear(colorInput?: WebGLTexture): void;
|
||||||
|
setSize(): boolean;
|
||||||
|
getSize(): vec2;
|
||||||
|
}
|
||||||
10
build/src/graphics/graphics-library/frame-buffer/intermediate-frame-buffer.d.ts
vendored
Normal file
10
build/src/graphics/graphics-library/frame-buffer/intermediate-frame-buffer.d.ts
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { FrameBuffer } from './frame-buffer';
|
||||||
|
export declare class IntermediateFrameBuffer extends FrameBuffer {
|
||||||
|
private frameTexture;
|
||||||
|
private floatLinearEnabled;
|
||||||
|
constructor(gl: WebGL2RenderingContext);
|
||||||
|
get colorTexture(): WebGLTexture;
|
||||||
|
setSize(): boolean;
|
||||||
|
private configureTexture;
|
||||||
|
private configureFrameBuffer;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue