Add files

This commit is contained in:
schmelczerandras 2020-09-15 10:08:16 +02:00
commit 77bde04db3
97 changed files with 10327 additions and 0 deletions

1
.eslintignore Normal file
View file

@ -0,0 +1 @@
**/*.js

29
.eslintrc.json Normal file
View 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
View file

@ -0,0 +1 @@
*.psd filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
dist
node_modules
package-lock.json

7
.prettierrc Normal file
View file

@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"printWidth": 90,
"tabWidth": 2,
"singleQuote": true,
"endOfLine": "lf"
}

8
.vscode/settings.json vendored Normal file
View 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

File diff suppressed because it is too large Load diff

0
build/src/game.d.ts vendored Normal file
View file

View file

@ -0,0 +1,7 @@
import { IDrawable } from './i-drawable';
export interface IDrawableDescriptor {
uniformName: string;
countMacroName: string;
shaderCombinationSteps: Array<number>;
readonly empty: IDrawable;
}

View 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;
}

View 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;
}

View 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;
}

View file

@ -0,0 +1,2 @@
import { IDrawable } from '../i-drawable';
export declare type ILight = IDrawable;

View file

@ -0,0 +1 @@
export declare const checkProgram: (gl: WebGL2RenderingContext, program: WebGLProgram) => void;

View file

@ -0,0 +1 @@
export declare const checkShader: (gl: WebGL2RenderingContext, shader: WebGLShader) => void;

View file

@ -0,0 +1,3 @@
export declare const createProgram: (gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string, substitutions: {
[name: string]: string;
}) => Promise<WebGLProgram>;

View file

@ -0,0 +1,3 @@
export declare const createShader: (gl: WebGL2RenderingContext, type: GLenum, source: string, substitutions: {
[name: string]: string;
}) => WebGLShader;

View file

@ -0,0 +1,5 @@
import { FrameBuffer } from './frame-buffer';
export declare class DefaultFrameBuffer extends FrameBuffer {
constructor(gl: WebGL2RenderingContext);
setSize(): boolean;
}

View 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;
}

View 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