remove console logs

This commit is contained in:
ajuvercr 2019-09-21 20:13:57 +02:00
parent bbe97e0df9
commit 1b66d6289b
4 changed files with 7 additions and 15 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -5,8 +5,7 @@
"noImplicitAny": false,
"module": "commonjs",
"target": "es6",
"jsx": "react",
"declaration": true
"jsx": "react"
},
"exclude": [
"node_modules",

View file

@ -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);