diff --git a/package.json b/package.json index b87c167..8836063 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@fms-cat/automaton-fxs": "^4.1.0", "@fms-cat/automaton-with-gui": "^4.1.1", "@fms-cat/experimental": "^0.5.0", - "@fms-cat/glcat-ts": "^0.14.0", + "@fms-cat/glcat-ts": "^0.14.2", "@types/webpack-env": "^1.16.0", "@typescript-eslint/eslint-plugin": "^4.17.0", "@typescript-eslint/parser": "^4.17.0", diff --git a/src/Music.ts b/src/Music.ts index 6bad0bc..0e0b357 100644 --- a/src/Music.ts +++ b/src/Music.ts @@ -13,20 +13,20 @@ export class Music { public time: number; public deltaTime: number; public audio: AudioContext; - public samples?: GLCatTexture; + public samples?: GLCatTexture; - private __program: GLCatProgram; - private __bufferOff: GLCatBuffer; + private __program: GLCatProgram; + private __bufferOff: GLCatBuffer; private __bufferTransformFeedbacks: [ - GLCatBuffer, - GLCatBuffer + GLCatBuffer, + GLCatBuffer ]; - private __transformFeedback: GLCatTransformFeedback; + private __transformFeedback: GLCatTransformFeedback; private __prevAudioTime: number; private __bufferPool: Pool; private __prevBufferSource: AudioBufferSourceNode | null = null; - constructor( glCat: GLCat, audio: AudioContext ) { + constructor( glCat: GLCat, audio: AudioContext ) { this.audio = audio; // == yoinked from wavenerd-deck =============================================================== diff --git a/src/entities/CameraEntity.ts b/src/entities/CameraEntity.ts index 2ea7145..2a2bca3 100644 --- a/src/entities/CameraEntity.ts +++ b/src/entities/CameraEntity.ts @@ -18,8 +18,8 @@ export interface CameraEntityOptions { root: Entity; target: RenderTarget; lights: LightEntity[]; - textureIBLLUT: GLCatTexture; - textureEnv: GLCatTexture; + textureIBLLUT: GLCatTexture; + textureEnv: GLCatTexture; } export class CameraEntity { diff --git a/src/entities/EnvironmentMap.ts b/src/entities/EnvironmentMap.ts index ad95171..9109b6c 100644 --- a/src/entities/EnvironmentMap.ts +++ b/src/entities/EnvironmentMap.ts @@ -16,7 +16,7 @@ export class EnvironmentMap { public swap: Swap; - public get texture(): GLCatTexture { + public get texture(): GLCatTexture { return this.swap.o.texture; } diff --git a/src/entities/IBLLUT.ts b/src/entities/IBLLUT.ts index 287470d..9f8a09f 100644 --- a/src/entities/IBLLUT.ts +++ b/src/entities/IBLLUT.ts @@ -16,7 +16,7 @@ export class IBLLUT { public swap: Swap; - public get texture(): GLCatTexture { + public get texture(): GLCatTexture { return this.swap.o.texture; } diff --git a/src/heck/BufferRenderTarget.ts b/src/heck/BufferRenderTarget.ts index dc8e917..4da83e1 100644 --- a/src/heck/BufferRenderTarget.ts +++ b/src/heck/BufferRenderTarget.ts @@ -13,9 +13,9 @@ export interface BufferRenderTargetOptions { export class BufferRenderTarget extends RenderTarget { public static nameMap = new Map(); - private readonly __framebuffer: GLCatFramebuffer; + private readonly __framebuffer: GLCatFramebuffer; - public get framebuffer(): GLCatFramebuffer { + public get framebuffer(): GLCatFramebuffer { return this.__framebuffer; } @@ -85,11 +85,11 @@ export class BufferRenderTarget extends RenderTarget { } } - public get texture(): GLCatTexture { + public get texture(): GLCatTexture { return this.__framebuffer.texture!; } - public getTexture( attachment: number ): GLCatTexture | null { + public getTexture( attachment: number ): GLCatTexture | null { return this.__framebuffer.getTexture( attachment ); } diff --git a/src/heck/Geometry.ts b/src/heck/Geometry.ts index aa57069..564a8d3 100644 --- a/src/heck/Geometry.ts +++ b/src/heck/Geometry.ts @@ -3,7 +3,7 @@ import { gl, glCat } from '../globals/canvas'; import { Material } from './Material'; export interface GeometryAttribute { - buffer: GLCatBuffer; + buffer: GLCatBuffer; size: number; divisor?: number; type: GLenum; @@ -12,7 +12,7 @@ export interface GeometryAttribute { } export interface GeometryIndex { - buffer: GLCatBuffer; + buffer: GLCatBuffer; type: GLenum; } @@ -28,7 +28,7 @@ export class Geometry { [ gl.FLOAT ]: 4, }; - public transformFeedback?: GLCatTransformFeedback | null; + public transformFeedback?: GLCatTransformFeedback | null; protected __attributes: { [ name: string ]: GeometryAttribute; diff --git a/src/heck/Material.ts b/src/heck/Material.ts index f915674..2f78ed3 100644 --- a/src/heck/Material.ts +++ b/src/heck/Material.ts @@ -25,7 +25,7 @@ export class Material { protected __uniformTextures: { [ name: string ]: { - texture: GLCatTexture | null; + texture: GLCatTexture | null; }; } = {}; @@ -49,7 +49,7 @@ export class Material { return this.__withDefines( this.frag ); } - public get program(): GLCatProgram { + public get program(): GLCatProgram { return SHADERPOOL.getProgram( this, this.vertWithDefines, @@ -85,7 +85,7 @@ export class Material { this.__uniformVectors[ name ] = { type, value }; } - public addUniformTexture( name: string, texture: GLCatTexture | null ): void { + public addUniformTexture( name: string, texture: GLCatTexture | null ): void { this.__uniformTextures[ name ] = { texture }; } diff --git a/src/heck/ShaderPool.ts b/src/heck/ShaderPool.ts index 81c68a2..50953c6 100644 --- a/src/heck/ShaderPool.ts +++ b/src/heck/ShaderPool.ts @@ -3,18 +3,18 @@ import { glCat } from '../globals/canvas'; import { Material } from './Material'; export class ShaderPool { - private __programMap: Map> = new Map(); + private __programMap: Map = new Map(); - private __ongoingPromises: Map>> = new Map(); + private __ongoingPromises: Map> = new Map(); - private __programUsersMap: Map, Set> = new Map(); + private __programUsersMap: Map> = new Map(); public getProgram( user: TUser, vert: string, frag: string, options?: GLCatProgramLinkOptions, - ): GLCatProgram { + ): GLCatProgram { let program = this.__programMap.get( vert + frag ); if ( !program ) { if ( process.env.DEV ) { @@ -41,7 +41,7 @@ export class ShaderPool { vert: string, frag: string, options?: GLCatProgramLinkOptions - ): Promise> { + ): Promise { let program = this.__programMap.get( vert + frag ); if ( !program ) { let promise = this.__ongoingPromises.get( vert + frag ); @@ -85,7 +85,7 @@ export class ShaderPool { } } - private __setUser( user: TUser, program: GLCatProgram ): void { + private __setUser( user: TUser, program: GLCatProgram ): void { let users = this.__programUsersMap.get( program ); if ( !users ) { users = new Set(); @@ -97,7 +97,7 @@ export class ShaderPool { } } - private __deleteUser( user: TUser, program: GLCatProgram ): void { + private __deleteUser( user: TUser, program: GLCatProgram ): void { const users = this.__programUsersMap.get( program )!; if ( !users.has( user ) ) { @@ -108,7 +108,7 @@ export class ShaderPool { users.delete( user ); } - private __countUsers( program: GLCatProgram ): number { + private __countUsers( program: GLCatProgram ): number { const users = this.__programUsersMap.get( program )!; return users.size; } diff --git a/src/utils/RandomTexture.ts b/src/utils/RandomTexture.ts index 056d2f2..7d5010f 100644 --- a/src/utils/RandomTexture.ts +++ b/src/utils/RandomTexture.ts @@ -3,14 +3,14 @@ import GLCat, { GLCatTexture } from '@fms-cat/glcat-ts'; import { gl } from '../globals/canvas'; export class RandomTexture { - private __texture: GLCatTexture; + private __texture: GLCatTexture; private __array: Uint8Array; private __rng: Xorshift; private __width: number; private __height: number; public constructor( - glCat: GLCat, + glCat: GLCat, width: number, height: number, ) { @@ -22,7 +22,7 @@ export class RandomTexture { this.__texture.textureWrap( gl.REPEAT ); } - public get texture(): GLCatTexture { + public get texture(): GLCatTexture { return this.__texture; } diff --git a/yarn.lock b/yarn.lock index 2462f9d..37c339e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -74,10 +74,10 @@ resolved "https://registry.yarnpkg.com/@fms-cat/experimental/-/experimental-0.5.0.tgz#41ebe9ce2b4bfca7b194f3a5c8aad951264a4ac0" integrity sha512-01vnWv6fCrwvR0hsEhmDKhrQ/k0NjAsbV4+lDJJ8xCOdHDjbtHxSjv92Px2WxDMpv2JYfIpw2d8iqGZzVAvcAg== -"@fms-cat/glcat-ts@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@fms-cat/glcat-ts/-/glcat-ts-0.14.0.tgz#881573c559c9a56f2b429c919011fbdfbbdd6c55" - integrity sha512-qaRvW1Hua0quOdsp58f0LAEaaYuU8LwG6hwoA/y7lmMGppuAeTmssnL+i/WKbI/h7TVI3JmPhPwRBXS1/+t55Q== +"@fms-cat/glcat-ts@^0.14.2": + version "0.14.2" + resolved "https://registry.yarnpkg.com/@fms-cat/glcat-ts/-/glcat-ts-0.14.2.tgz#548019d8b31ccf9d5aa6e1bfd01d73bd1ad2e4de" + integrity sha512-Pv32IeyZXJiFaf8mhAzOkoef4gaaVWYITuwENrtKi+4rwkebLcx9SEqoG8qDAFeWmm0ANKFYsYCRyhns4VSnRA== "@nodelib/fs.scandir@2.1.4": version "2.1.4"