aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE
diff options
context:
space:
mode:
authorhwc4872012-02-27 10:28:03 -0800
committerhwc4872012-02-27 10:28:03 -0800
commit8578322c60adaaf65f37ba96f2a0f7ed9de8e1dc (patch)
treecb167012f42f9c29879951c4d86c44ed7a447301 /js/helper-classes/RDGE
parentd0661d6c587aced68a68e36a5ec4e81f8a2096e8 (diff)
downloadninja-8578322c60adaaf65f37ba96f2a0f7ed9de8e1dc.tar.gz
Fixed various rendering bugs.
Diffstat (limited to 'js/helper-classes/RDGE')
-rwxr-xr-xjs/helper-classes/RDGE/GLCircle.js4
-rwxr-xr-xjs/helper-classes/RDGE/GLGeomObj.js4
-rwxr-xr-xjs/helper-classes/RDGE/GLLine.js2
-rwxr-xr-xjs/helper-classes/RDGE/GLRectangle.js24
-rwxr-xr-xjs/helper-classes/RDGE/GLWorld.js2
5 files changed, 21 insertions, 15 deletions
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js
index 656657f6..15ed6b6d 100755
--- a/js/helper-classes/RDGE/GLCircle.js
+++ b/js/helper-classes/RDGE/GLCircle.js
@@ -47,8 +47,8 @@ function GLCircle()
47 47
48 this._strokeWidth = strokeSize; 48 this._strokeWidth = strokeSize;
49 this._innerRadius = innerRadius; 49 this._innerRadius = innerRadius;
50 this._strokeColor = strokeColor; 50 if (strokeColor) this._strokeColor = strokeColor;
51 this._fillColor = fillColor; 51 if (fillColor) this._fillColor = fillColor;
52 52
53 this._strokeStyle = strokeStyle; 53 this._strokeStyle = strokeStyle;
54 } 54 }
diff --git a/js/helper-classes/RDGE/GLGeomObj.js b/js/helper-classes/RDGE/GLGeomObj.js
index 5d7497ad..c1ee01ba 100755
--- a/js/helper-classes/RDGE/GLGeomObj.js
+++ b/js/helper-classes/RDGE/GLGeomObj.js
@@ -38,8 +38,8 @@ function GLGeomObj()
38 this.m_world = null; 38 this.m_world = null;
39 39
40 // stroke and fill colors 40 // stroke and fill colors
41 this._strokeColor; 41 this._strokeColor = [0,0,0,0];
42 this._fillColor; 42 this._fillColor = [0,0,0,0];
43 43
44 // stroke and fill materials 44 // stroke and fill materials
45 this._fillMaterial; 45 this._fillMaterial;
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js
index 5228ac09..5b966896 100755
--- a/js/helper-classes/RDGE/GLLine.js
+++ b/js/helper-classes/RDGE/GLLine.js
@@ -43,7 +43,7 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
43 43
44 this._slope = slope; 44 this._slope = slope;
45 this._strokeWidth = strokeSize; 45 this._strokeWidth = strokeSize;
46 this._strokeColor = strokeColor; 46 if (strokeCOlor)this._strokeColor = strokeColor;
47 47
48 this._strokeStyle = strokeStyle; 48 this._strokeStyle = strokeStyle;
49 this._scaleX = (world.getViewportWidth())/(world.getViewportHeight()); 49 this._scaleX = (world.getViewportWidth())/(world.getViewportHeight());
diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js
index cf9c123e..a801d3c4 100755
--- a/js/helper-classes/RDGE/GLRectangle.js
+++ b/js/helper-classes/RDGE/GLRectangle.js
@@ -400,27 +400,33 @@ function GLRectangle()
400 var w = world.getViewportWidth(), 400 var w = world.getViewportWidth(),
401 h = world.getViewportHeight(); 401 h = world.getViewportHeight();
402 402
403 // set the fill 403 // render the fill
404 ctx.beginPath(); 404 ctx.beginPath();
405 if (this._fillColor) 405 if (this._fillColor)
406 { 406 {
407 var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")"; 407 var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")";
408 ctx.fillStyle = c; 408 ctx.fillStyle = c;
409
410 ctx.lineWidth = lw;
411 var inset = Math.ceil( lw ) + 0.5;
412 this.renderPath( inset, ctx );
413 ctx.fill();
414 ctx.closePath();
409 } 415 }
410 416
411 // set the stroke 417 // render the stroke
418 ctx.beginPath();
412 if (this._strokeColor) 419 if (this._strokeColor)
413 { 420 {
414 var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; 421 var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")";
415 ctx.strokeStyle = c; 422 ctx.strokeStyle = c;
416 }
417 423
418 ctx.lineWidth = lw; 424 ctx.lineWidth = lw;
419 var inset = Math.ceil( 0.5*lw ) + 0.5; 425 var inset = Math.ceil( 0.5*lw ) + 0.5;
420 this.renderPath( inset, ctx ); 426 this.renderPath( inset, ctx );
421 if (this._fillColor) ctx.fill(); 427 ctx.stroke();
422 if (this._strokeColor) ctx.stroke(); 428 ctx.closePath();
423 ctx.closePath(); 429 }
424 } 430 }
425 431
426 this.createStroke = function(ctr, width, height, strokeWidth, tlRad, blRad, brRad, trRad, material) 432 this.createStroke = function(ctr, width, height, strokeWidth, tlRad, blRad, brRad, trRad, material)
diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js
index 0addcadc..646faa24 100755
--- a/js/helper-classes/RDGE/GLWorld.js
+++ b/js/helper-classes/RDGE/GLWorld.js
@@ -157,7 +157,7 @@ function GLWorld( canvas, use3D )
157 157
158 // change clear color 158 // change clear color
159 //this.renderer.setClearFlags(g_Engine.getContext().DEPTH_BUFFER_BIT); 159 //this.renderer.setClearFlags(g_Engine.getContext().DEPTH_BUFFER_BIT);
160 this.renderer.setClearColor([1.0, 1.0, 1.0, 0.0]); 160 this.renderer.setClearColor([0.0, 0.0, 0.0, 0.0]);
161 //this.renderer.NinjaWorld = this; 161 //this.renderer.NinjaWorld = this;
162 162
163 // create an empty scene graph 163 // create an empty scene graph