From 1b66d6289bf32433a2239b20f968fc7336036d6d Mon Sep 17 00:00:00 2001 From: ajuvercr Date: Sat, 21 Sep 2019 20:13:57 +0200 Subject: [PATCH] remove console logs --- frontend/www/games.ts | 5 ++--- frontend/www/index.ts | 9 +++------ frontend/www/tsconfig.json | 3 +-- frontend/www/webgl/shader.ts | 5 +---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/www/games.ts b/frontend/www/games.ts index edc6335..dea4a76 100644 --- a/frontend/www/games.ts +++ b/frontend/www/games.ts @@ -1,5 +1,5 @@ -import { LOCATION, set_instance } from './index' +import { set_loading, LOCATION, set_instance } from './index' import { ConfigIniParser } from 'config-ini-parser' const OPTIONS = document.getElementById("options"); @@ -14,6 +14,7 @@ fetch(game_location) }).catch(console.error); export function handle(location) { + set_loading(true); fetch(location) .then((r) => r.text()) @@ -64,6 +65,4 @@ function parse_ini(inifile: string) { create_option(loc+name, game , turns, players) ); } - - console.log(parser); } diff --git a/frontend/www/index.ts b/frontend/www/index.ts index c245ed0..5fe287e 100644 --- a/frontend/www/index.ts +++ b/frontend/www/index.ts @@ -28,7 +28,7 @@ document.getElementById("addbutton").onclick = function() { FILESELECTOR.click(); } -function set_loading(loading: boolean) { +export function set_loading(loading: boolean) { if (loading) { if (!LOADER.classList.contains("loading")) { LOADER.classList.add("loading"); @@ -85,8 +85,6 @@ class GameInstance { this.renderer = new Renderer(); this.game.update_turn(0); - console.log(this.resizer); - // Setup key handling document.addEventListener('keydown', this.handleKey.bind(this)); @@ -274,6 +272,8 @@ export async function set_instance(source: string) { CANVAS.width = CANVAS.getBoundingClientRect().width; CANVAS.height = CANVAS.getBoundingClientRect().height; game_instance = new GameInstance(Game.new(source), meshes.slice(1), meshes[0]); + + set_loading(false); } SLIDER.oninput = function() { @@ -300,10 +300,7 @@ SPEED.onchange = function() { function step(time: number) { if (game_instance) { - set_loading(false); game_instance.render(time); - } else { - set_loading(true); } requestAnimationFrame(step); diff --git a/frontend/www/tsconfig.json b/frontend/www/tsconfig.json index f5c8a2e..6606902 100644 --- a/frontend/www/tsconfig.json +++ b/frontend/www/tsconfig.json @@ -5,8 +5,7 @@ "noImplicitAny": false, "module": "commonjs", "target": "es6", - "jsx": "react", - "declaration": true + "jsx": "react" }, "exclude": [ "node_modules", diff --git a/frontend/www/webgl/shader.ts b/frontend/www/webgl/shader.ts index 3b49421..31c2bf7 100644 --- a/frontend/www/webgl/shader.ts +++ b/frontend/www/webgl/shader.ts @@ -36,9 +36,6 @@ function loadShader( return null; } - console.log("created shader with source"); - console.log(shaderSource); - return shader; } @@ -185,7 +182,7 @@ export class Shader { this.bind(gl); const location = this.getUniformLocation(gl, name); if (location < 0) { - console.log("No location found with name " + name); + console.error("No location found with name " + name); } uniform.setUniform(gl, location);