|
@@ -251,7 +251,7 @@
|
|
|
var compileShader = (gl: WebGLRenderingContext, source: string, type: string, defines: string): WebGLShader => {
|
|
|
var shader = gl.createShader(type === "vertex" ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
|
|
|
|
|
|
- gl.shaderSource(shader, (defines ? defines + "\n" : "") + source);
|
|
|
+ gl.shaderSource(shader,(defines ? defines + "\n" : "") + source);
|
|
|
gl.compileShader(shader);
|
|
|
|
|
|
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
@@ -315,7 +315,7 @@
|
|
|
texture._width = potWidth;
|
|
|
texture._height = potHeight;
|
|
|
texture.isReady = true;
|
|
|
-
|
|
|
+
|
|
|
processFunction(potWidth, potHeight);
|
|
|
|
|
|
var filters = getSamplingParameters(samplingMode, !noMipmap, gl);
|
|
@@ -652,10 +652,10 @@
|
|
|
// Pointer lock
|
|
|
this._onPointerLockChange = () => {
|
|
|
this.isPointerLock = (document.mozPointerLockElement === canvas ||
|
|
|
- document.webkitPointerLockElement === canvas ||
|
|
|
- document.msPointerLockElement === canvas ||
|
|
|
- document.pointerLockElement === canvas
|
|
|
- );
|
|
|
+ document.webkitPointerLockElement === canvas ||
|
|
|
+ document.msPointerLockElement === canvas ||
|
|
|
+ document.pointerLockElement === canvas
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
document.addEventListener("pointerlockchange", this._onPointerLockChange, false);
|
|
@@ -866,7 +866,7 @@
|
|
|
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
|
|
|
*/
|
|
|
public setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void {
|
|
|
- var width = requiredWidth || (navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.width);
|
|
|
+ var width = requiredWidth || (navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.width);
|
|
|
var height = requiredHeight || (navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.height);
|
|
|
var x = viewport.x || 0;
|
|
|
var y = viewport.y || 0;
|
|
@@ -898,9 +898,9 @@
|
|
|
* });
|
|
|
*/
|
|
|
public resize(): void {
|
|
|
- var width = navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.clientWidth;
|
|
|
+ var width = navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.clientWidth;
|
|
|
var height = navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.clientHeight;
|
|
|
-
|
|
|
+
|
|
|
this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel);
|
|
|
}
|
|
|
|
|
@@ -1186,7 +1186,7 @@
|
|
|
return effect;
|
|
|
}
|
|
|
|
|
|
- public createEffectForParticles(fragmentName: string, uniformsNames: string[]= [], samplers: string[]= [], defines = "", fallbacks?: EffectFallbacks,
|
|
|
+ public createEffectForParticles(fragmentName: string, uniformsNames: string[] = [], samplers: string[] = [], defines = "", fallbacks?: EffectFallbacks,
|
|
|
onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect {
|
|
|
|
|
|
return this.createEffect(
|
|
@@ -1521,7 +1521,7 @@
|
|
|
|
|
|
var header = Internals.TGATools.GetTGAHeader(data);
|
|
|
|
|
|
- prepareWebGLTexture(texture, this._gl, scene, header.width, header.height, invertY, noMipmap, false, () => {
|
|
|
+ prepareWebGLTexture(texture, this._gl, scene, header.width, header.height, invertY, noMipmap, false,() => {
|
|
|
Internals.TGATools.UploadContent(this._gl, data);
|
|
|
|
|
|
if (onLoad) {
|
|
@@ -1542,7 +1542,7 @@
|
|
|
var info = Internals.DDSTools.GetDDSInfo(data);
|
|
|
|
|
|
var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1);
|
|
|
- prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, () => {
|
|
|
+ prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC,() => {
|
|
|
|
|
|
Internals.DDSTools.UploadDDSLevels(this._gl, this.getCaps().s3tc, data, info, loadMipmap, 1);
|
|
|
|
|
@@ -1561,7 +1561,7 @@
|
|
|
|
|
|
} else {
|
|
|
var onload = (img) => {
|
|
|
- prepareWebGLTexture(texture, this._gl, scene, img.width, img.height, invertY, noMipmap, false, (potWidth, potHeight) => {
|
|
|
+ prepareWebGLTexture(texture, this._gl, scene, img.width, img.height, invertY, noMipmap, false,(potWidth, potHeight) => {
|
|
|
var isPot = (img.width === potWidth && img.height === potHeight);
|
|
|
if (!isPot) {
|
|
|
this._prepareWorkingCanvas();
|