<commit_before>"use strict";
var pl, controls, scene, renderer, composer;
var renderTargetParametersRGBA, renderTargetParametersRGB;
var colorTarget, depthTarget, depthPassPlugin;
var lightManager, animationManager, soundManager, aiManager, dungeon;
var projector = new THREE.Projector();
var clock = new THREE.Clock();
var cache = new Cache();
var passes = {};

function init() {
	scene = new Physijs.Scene({ fixedTimeStep: 1 / CONFIG.physicsFPS });
	scene.setGravity(new THREE.Vector3(0, -10, 0));
	scene.fog = new THREE.FogExp2(0x000000, 0.05);
	scene.addEventListener('update', function() {
		if (CONFIG.showStats) physicsStats.update();
	});

	pl = new Physijs.CapsuleMesh(
		new THREE.CylinderGeometry(0.8, 0.8, 2.0),
		new THREE.MeshBasicMaterial({ color: 0xff00ff }),
		100
	);
	pl.visible = false;
	pl.geometry.dynamic = false;
	pl.addEventListener('collision', function(other, vel, rot) {
		if (this.dead) return;
		if (other.items) {
			for (var i in other.items) {
				if (pl[i] !== undefined) {
					if (typeof(other.items[i]) === "number") pl[i] += other.items[i];
					else pl[i] = other.items[i];
				}
			}
			soundManager.play("pick-up");
			displayMinorMessage("Picked up " + other.itemName);
			updateHUD();
			other.items = undefined;
			other.visible = false;
			other.parent.remove(other);
		}
		if (other.damage && other.position.y > 0.3 && pl.faction != other.faction) {
			this.hp -= other.damage;
			updateHUD();
			// Death is checked in render loop
			// TODO: Hit sound?
			// TODO: Screen effect?
		}
	});
	// Add pl later to the scene

	// Player stats
	var loadedStats = {};
	if (hashParams.level && localStorage.getItem("campaingState-" + hashParams.level)) {
		loadedStats = JSON.parse(localStorage.getItem("campaingState-" + hashParams.level));
		pl.hp = loadedStats.hp;
		pl.bulletsPerClip = loadedStats.bulletsPerClip;
		pl.bullets = loadedStats.bullets;
		pl.clips = loadedStats.clips;
		pl.ammoType = loadedStats.ammoType || "plain";
	} else {
		pl.hp = 100;
		pl.bulletsPerClip = 15;
		pl.bullets = pl.bulletsPerClip;
		pl.clips = 5;
		pl.ammoType = "plain";
	}
	pl.reloading = false;
	pl.faction = 0;
	updateHUD();

	pl.camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 25);

	controls = new Controls(pl.camera, { mouse: mouseHandler });
	controls.movementSpeed = 10;
	controls.lookSpeed = 0.5;
	controls.lookVertical = true;
	controls.constrainVerticalLook = true;
	controls.verticalMin = 1.1;
	controls.verticalMax = 2.2;

	renderer = new THREE.WebGLRenderer({
		clearColor: 0x000000,
		antialias: CONFIG.antialias,
		preserveDrawingBuffer: true
	});
	renderer.setSize(window.innerWidth, window.innerHeight);
	renderer.shadowMapEnabled = CONFIG.shadows;
	renderer.shadowMapSoft = CONFIG.softShadows;
	renderer.shadowMapDebug = false;
	renderer.gammaInput = true;
	renderer.gammaOutput = true;
	renderer.physicallyBasedShading = CONFIG.physicalShading;
	renderer.autoClear = false;
	if (!CONFIG.anisotropy) CONFIG.anisotropy = renderer.getMaxAnisotropy();

	renderTargetParametersRGB  = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
	renderTargetParametersRGBA = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
	depthTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, renderTargetParametersRGBA);
	colorTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, renderTargetParametersRGB);

	// Postprocessing effects
	passes.scene = new THREE.RenderPass(scene, pl.camera);
	passes.ssao = new THREE.ShaderPass(THREE.ShaderExtras.ssao);
	passes.ssao.uniforms.tDepth.value = depthTarget;<commit_msg>Remove redundant renderer configuration.<commit_after>"use strict";
var pl, controls, scene, renderer, composer;
var renderTargetParametersRGBA, renderTargetParametersRGB;
var colorTarget, depthTarget, depthPassPlugin;
var lightManager, animationManager, soundManager, aiManager, dungeon;
var projector = new THREE.Projector();
var clock = new THREE.Clock();
var cache = new Cache();
var passes = {};

function init() {
	scene = new Physijs.Scene({ fixedTimeStep: 1 / CONFIG.physicsFPS });
	scene.setGravity(new THREE.Vector3(0, -10, 0));
	scene.fog = new THREE.FogExp2(0x000000, 0.05);
	scene.addEventListener('update', function() {
		if (CONFIG.showStats) physicsStats.update();
	});

	pl = new Physijs.CapsuleMesh(
		new THREE.CylinderGeometry(0.8, 0.8, 2.0),
		new THREE.MeshBasicMaterial({ color: 0xff00ff }),
		100
	);
	pl.visible = false;
	pl.geometry.dynamic = false;
	pl.addEventListener('collision', function(other, vel, rot) {
		if (this.dead) return;
		if (other.items) {
			for (var i in other.items) {
				if (pl[i] !== undefined) {
					if (typeof(other.items[i]) === "number") pl[i] += other.items[i];
					else pl[i] = other.items[i];
				}
			}
			soundManager.play("pick-up");
			displayMinorMessage("Picked up " + other.itemName);
			updateHUD();
			other.items = undefined;
			other.visible = false;
			other.parent.remove(other);
		}
		if (other.damage && other.position.y > 0.3 && pl.faction != other.faction) {
			this.hp -= other.damage;
			updateHUD();
			// Death is checked in render loop
			// TODO: Hit sound?
			// TODO: Screen effect?
		}
	});
	// Add pl later to the scene

	// Player stats
	var loadedStats = {};
	if (hashParams.level && localStorage.getItem("campaingState-" + hashParams.level)) {
		loadedStats = JSON.parse(localStorage.getItem("campaingState-" + hashParams.level));
		pl.hp = loadedStats.hp;
		pl.bulletsPerClip = loadedStats.bulletsPerClip;
		pl.bullets = loadedStats.bullets;
		pl.clips = loadedStats.clips;
		pl.ammoType = loadedStats.ammoType || "plain";
	} else {
		pl.hp = 100;
		pl.bulletsPerClip = 15;
		pl.bullets = pl.bulletsPerClip;
		pl.clips = 5;
		pl.ammoType = "plain";
	}
	pl.reloading = false;
	pl.faction = 0;
	updateHUD();

	pl.camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 25);

	controls = new Controls(pl.camera, { mouse: mouseHandler });
	controls.movementSpeed = 10;
	controls.lookSpeed = 0.5;
	controls.lookVertical = true;
	controls.constrainVerticalLook = true;
	controls.verticalMin = 1.1;
	controls.verticalMax = 2.2;

	renderer = new THREE.WebGLRenderer({
		clearColor: 0x000000,
		antialias: CONFIG.antialias,
		preserveDrawingBuffer: true
	});
	renderer.setSize(window.innerWidth, window.innerHeight);
	renderer.shadowMapDebug = false;
	renderer.gammaInput = true;
	renderer.gammaOutput = true;
	renderer.autoClear = false;
	if (!CONFIG.anisotropy) CONFIG.anisotropy = renderer.getMaxAnisotropy();

	renderTargetParametersRGB  = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
	renderTargetParametersRGBA = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
	depthTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, renderTargetParametersRGBA);
	colorTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, renderTargetParametersRGB);

	// Postprocessing effects
	passes.scene = new THREE.RenderPass(scene, pl.camera);
	passes.ssao = new THREE.ShaderPass(THREE.ShaderExtras.ssao);
	passes.ssao.uniforms.tDepth.value = depthTarget;
{'fraction_non_alphanumeric': 0.13400082293238239, 'fraction_numerical': 0.016184336853655192, 'mean_word_length': 4.5791889824024485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '555457', 'n_tokens_mistral': 2673, 'n_tokens_neox': 2417, 'n_words': 516}