Skip to content

Commit

Permalink
Fix #13, merge #14, #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Triang3l committed Aug 7, 2014
1 parent 1a812cb commit 5608e1b
Show file tree
Hide file tree
Showing 4 changed files with 1,276 additions and 1,272 deletions.
4 changes: 2 additions & 2 deletions Client/WebQuake/Def.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Def = {};

Def.webquake_version = 47;
Def.timedate = 'Exe: 21:19:52 Mar 6 2014\n';
Def.webquake_version = 48;
Def.timedate = 'Exe: 12:39:20 Aug 7 2014\n';

Def.max_edicts = 600;

Expand Down
26 changes: 14 additions & 12 deletions Client/WebQuake/GL.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ GL.Upload = function(data, width, height)
scaled_height |= (scaled_height >> 16);
++scaled_height;
}
if (scaled_width > 1024)
scaled_width = 1024;
if (scaled_height > 1024)
scaled_height = 1024;
if (scaled_width > GL.maxtexturesize)
scaled_width = GL.maxtexturesize;
if (scaled_height > GL.maxtexturesize)
scaled_height = GL.maxtexturesize;
if ((scaled_width !== width) || (scaled_height !== height))
data = GL.ResampleTexture(data, width, height, scaled_width, scaled_height);
var trans = new ArrayBuffer((scaled_width * scaled_height) << 2)
Expand Down Expand Up @@ -172,10 +172,10 @@ GL.LoadTexture = function(identifier, width, height, data)
scaled_height |= (scaled_height >> 16);
++scaled_height;
}
if (scaled_width > 1024)
scaled_width = 1024;
if (scaled_height > 1024)
scaled_height = 1024;
if (scaled_width > GL.maxtexturesize)
scaled_width = GL.maxtexturesize;
if (scaled_height > GL.maxtexturesize)
scaled_height = GL.maxtexturesize;
scaled_width >>= GL.picmip.value;
if (scaled_width === 0)
scaled_width = 1;
Expand Down Expand Up @@ -212,10 +212,10 @@ GL.LoadPicTexture = function(pic)
scaled_height |= (scaled_height >> 16);
++scaled_height;
}
if (scaled_width > 1024)
scaled_width = 1024;
if (scaled_height > 1024)
scaled_height = 1024;
if (scaled_width > GL.maxtexturesize)
scaled_width = GL.maxtexturesize;
if (scaled_height > GL.maxtexturesize)
scaled_height = GL.maxtexturesize;
if ((scaled_width !== pic.width) || (scaled_height !== pic.height))
data = GL.ResampleTexture(data, pic.width, pic.height, scaled_width, scaled_height);

Expand Down Expand Up @@ -349,6 +349,8 @@ GL.Init = function()
if (gl == null)
Sys.Error('Unable to initialize WebGL. Your browser may not support it.');

GL.maxtexturesize = gl.getParameter(gl.MAX_TEXTURE_SIZE);

gl.clearColor(0.0, 0.0, 0.0, 0.0);
gl.cullFace(gl.FRONT);
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);
Expand Down
2 changes: 1 addition & 1 deletion Client/WebQuake/IN.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ IN.StartupMouse = function()
IN.requestPointerLock = 'webkitRequestPointerLock';
IN.pointerlockchange = 'onwebkitpointerlockchange';
}
if (VID.mainwindow.mozRequestPointerLock != null)
else if (VID.mainwindow.mozRequestPointerLock != null)
{
IN.movementX = 'mozMovementX';
IN.movementY = 'mozMovementY';
Expand Down
Loading

0 comments on commit 5608e1b

Please sign in to comment.