summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/controller/gamecontext.ts6
-rw-r--r--src/index.ts2
-rw-r--r--src/model/data/map.ts (renamed from src/model/data/MapData.ts)6
-rw-r--r--src/view/entity.ts4
-rw-r--r--src/view/input/directionhandler.ts (renamed from src/view/input/DirectionHandler.ts)9
-rw-r--r--src/view/input/inputhandler.ts (renamed from src/view/input/InputHandler.ts)4
-rw-r--r--src/view/map.ts9
-rw-r--r--src/view/renderer/renderer.ts (renamed from src/view/renderer/Renderer.ts)6
-rw-r--r--src/view/renderer/shaders.ts (renamed from src/view/renderer/Shaders.ts)6
-rw-r--r--src/view/renderer/shaders/default.fs (renamed from src/view/renderer/default.fs)0
-rw-r--r--src/view/renderer/shaders/default.vs (renamed from src/view/renderer/default.vs)0
-rw-r--r--src/view/sprite.ts2
12 files changed, 27 insertions, 27 deletions
diff --git a/src/controller/gamecontext.ts b/src/controller/gamecontext.ts
index 792e160..c4b56b0 100644
--- a/src/controller/gamecontext.ts
+++ b/src/controller/gamecontext.ts
@@ -1,9 +1,9 @@
-import MapData from '../model/data/MapData';
+import { MapData } from '../model/data/map';
import { loadSimpleEntity } from '../view/entity';
-import DirectionHandler from '../view/input/DirectionHandler';
+import { DirectionHandler } from '../view/input/directionhandler';
import { loadMap } from '../view/map';
-import Renderer from '../view/renderer/Renderer';
+import { Renderer } from '../view/renderer/renderer';
import { SpriteView } from '../view/sprite';
import { getJSON } from '../util';
diff --git a/src/index.ts b/src/index.ts
index a5ac4a2..da119a8 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,6 +1,6 @@
import { GameContext } from './controller/gamecontext';
-import Renderer from './view/renderer/Renderer';
+import { Renderer } from './view/renderer/renderer';
window.onload = async () => {
const canvas = document.getElementById('rpgedit') as HTMLCanvasElement;
diff --git a/src/model/data/MapData.ts b/src/model/data/map.ts
index 0c44d94..50b9175 100644
--- a/src/model/data/MapData.ts
+++ b/src/model/data/map.ts
@@ -1,12 +1,10 @@
-import {mapFromObject} from '../../util';
-
-interface Input {
+export interface Input {
readonly tiles: string[];
readonly collision: boolean[][];
readonly layers: number[][][];
}
-export default class MapData {
+export class MapData {
public readonly tiles: string[];
public readonly collision: boolean[][];
public readonly layers: number[][][];
diff --git a/src/view/entity.ts b/src/view/entity.ts
index 57969a2..015875a 100644
--- a/src/view/entity.ts
+++ b/src/view/entity.ts
@@ -1,5 +1,5 @@
-import Renderer from './renderer/Renderer';
-import { SpriteCoords, SpriteView, SpriteViewBuilder } from './sprite';
+import { Renderer } from './renderer/renderer';
+import { SpriteView, SpriteViewBuilder } from './sprite';
import { loadImage, mkTexture } from './util/image';
export async function loadSimpleEntity(
diff --git a/src/view/input/DirectionHandler.ts b/src/view/input/directionhandler.ts
index 691ba01..0a3687e 100644
--- a/src/view/input/DirectionHandler.ts
+++ b/src/view/input/directionhandler.ts
@@ -1,7 +1,8 @@
-import {Listenable} from '../../util';
-import InputHandler from './InputHandler';
+import { InputHandler } from './inputhandler';
-import {vec2} from 'gl-matrix';
+import { Listenable } from '../../util';
+
+import { vec2 } from 'gl-matrix';
export const enum Keycode {
Left = 37,
@@ -10,7 +11,7 @@ export const enum Keycode {
Down = 40,
}
-export default class DirectionHandler extends Listenable<[vec2]> {
+export class DirectionHandler extends Listenable<[vec2]> {
private readonly input: InputHandler;
constructor() {
diff --git a/src/view/input/InputHandler.ts b/src/view/input/inputhandler.ts
index a6f1293..96f15dd 100644
--- a/src/view/input/InputHandler.ts
+++ b/src/view/input/inputhandler.ts
@@ -1,6 +1,6 @@
-import {Listenable} from '../../util';
+import { Listenable } from '../../util';
-export default class InputHandler extends Listenable<[]> {
+export class InputHandler extends Listenable<[]> {
private readonly keys: Set<number> = new Set();
constructor(relevantKeys: Set<number>) {
diff --git a/src/view/map.ts b/src/view/map.ts
index d7c9ce9..ff37737 100644
--- a/src/view/map.ts
+++ b/src/view/map.ts
@@ -1,10 +1,11 @@
-import MapData from '../model/data/MapData';
-import { nextPowerOf2 } from '../util';
-
-import Renderer from './renderer/Renderer';
+import { Renderer } from './renderer/renderer';
import { SpriteCoords, SpriteView, SpriteViewBuilder } from './sprite';
import { loadImage, mkTexture } from './util/image';
+import { MapData } from '../model/data/map';
+
+import { nextPowerOf2 } from '../util';
+
interface Tileset {
texture: WebGLTexture;
tiles: SpriteCoords[];
diff --git a/src/view/renderer/Renderer.ts b/src/view/renderer/renderer.ts
index 75dc265..062c868 100644
--- a/src/view/renderer/Renderer.ts
+++ b/src/view/renderer/renderer.ts
@@ -1,8 +1,8 @@
-import { mat4, vec2 } from 'gl-matrix';
+import { Shaders } from './shaders';
-import Shaders from './Shaders';
+import { mat4, vec2 } from 'gl-matrix';
-export default class Renderer {
+export class Renderer {
private readonly viewScale = 64;
private readonly gl: WebGLRenderingContext;
diff --git a/src/view/renderer/Shaders.ts b/src/view/renderer/shaders.ts
index da75a18..8fd1fda 100644
--- a/src/view/renderer/Shaders.ts
+++ b/src/view/renderer/shaders.ts
@@ -1,7 +1,7 @@
-import fragmentShaderSrc from './default.fs';
-import vertexShaderSrc from './default.vs';
+import fragmentShaderSrc from './shaders/default.fs';
+import vertexShaderSrc from './shaders/default.vs';
-export default class Shaders {
+export class Shaders {
public readonly viewportLoc: WebGLUniformLocation;
public readonly translateLoc: WebGLUniformLocation;
diff --git a/src/view/renderer/default.fs b/src/view/renderer/shaders/default.fs
index 2c8ad15..2c8ad15 100644
--- a/src/view/renderer/default.fs
+++ b/src/view/renderer/shaders/default.fs
diff --git a/src/view/renderer/default.vs b/src/view/renderer/shaders/default.vs
index 4715a17..4715a17 100644
--- a/src/view/renderer/default.vs
+++ b/src/view/renderer/shaders/default.vs
diff --git a/src/view/sprite.ts b/src/view/sprite.ts
index 02fa77a..3a5ebcb 100644
--- a/src/view/sprite.ts
+++ b/src/view/sprite.ts
@@ -1,4 +1,4 @@
-import Renderer from './renderer/Renderer';
+import { Renderer } from './renderer/renderer';
export type SpriteCoords = [number, number, number, number];