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' import { ConfigIniParser } from 'config-ini-parser'
const OPTIONS = document.getElementById("options"); const OPTIONS = document.getElementById("options");
@ -14,6 +14,7 @@ fetch(game_location)
}).catch(console.error); }).catch(console.error);
export function handle(location) { export function handle(location) {
set_loading(true);
fetch(location) fetch(location)
.then((r) => r.text()) .then((r) => r.text())
@ -64,6 +65,4 @@ function parse_ini(inifile: string) {
create_option(loc+name, game , turns, players) create_option(loc+name, game , turns, players)
); );
} }
console.log(parser);
} }

View file

@ -28,7 +28,7 @@ document.getElementById("addbutton").onclick = function() {
FILESELECTOR.click(); FILESELECTOR.click();
} }
function set_loading(loading: boolean) { export function set_loading(loading: boolean) {
if (loading) { if (loading) {
if (!LOADER.classList.contains("loading")) { if (!LOADER.classList.contains("loading")) {
LOADER.classList.add("loading"); LOADER.classList.add("loading");
@ -85,8 +85,6 @@ class GameInstance {
this.renderer = new Renderer(); this.renderer = new Renderer();
this.game.update_turn(0); this.game.update_turn(0);
console.log(this.resizer);
// Setup key handling // Setup key handling
document.addEventListener('keydown', this.handleKey.bind(this)); document.addEventListener('keydown', this.handleKey.bind(this));
@ -274,6 +272,8 @@ export async function set_instance(source: string) {
CANVAS.width = CANVAS.getBoundingClientRect().width; CANVAS.width = CANVAS.getBoundingClientRect().width;
CANVAS.height = CANVAS.getBoundingClientRect().height; CANVAS.height = CANVAS.getBoundingClientRect().height;
game_instance = new GameInstance(Game.new(source), meshes.slice(1), meshes[0]); game_instance = new GameInstance(Game.new(source), meshes.slice(1), meshes[0]);
set_loading(false);
} }
SLIDER.oninput = function() { SLIDER.oninput = function() {
@ -300,10 +300,7 @@ SPEED.onchange = function() {
function step(time: number) { function step(time: number) {
if (game_instance) { if (game_instance) {
set_loading(false);
game_instance.render(time); game_instance.render(time);
} else {
set_loading(true);
} }
requestAnimationFrame(step); requestAnimationFrame(step);

View file

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

View file

@ -36,9 +36,6 @@ function loadShader(
return null; return null;
} }
console.log("created shader with source");
console.log(shaderSource);
return shader; return shader;
} }
@ -185,7 +182,7 @@ export class Shader {
this.bind(gl); this.bind(gl);
const location = this.getUniformLocation(gl, name); const location = this.getUniformLocation(gl, name);
if (location < 0) { if (location < 0) {
console.log("No location found with name " + name); console.error("No location found with name " + name);
} }
uniform.setUniform(gl, location); uniform.setUniform(gl, location);