aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-04-11 17:11:43 -0700
committerhwc4872012-04-11 17:11:43 -0700
commitb5aa082842f798d1eec582428468a322bd5a017f (patch)
treef5cee205faef62cd8cb253ccd4d4425aef3e770e /js
parent1b7592f81c9b47c2b42d78efe385cd979d54d3ca (diff)
downloadninja-b5aa082842f798d1eec582428468a322bd5a017f.tar.gz
Cloud material
Diffstat (limited to 'js')
-rw-r--r--js/lib/rdge/materials/cloud-material.js2
-rw-r--r--js/lib/rdge/texture.js5
2 files changed, 6 insertions, 1 deletions
diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js
index c1dabce8..f253718a 100644
--- a/js/lib/rdge/materials/cloud-material.js
+++ b/js/lib/rdge/materials/cloud-material.js
@@ -188,6 +188,8 @@ var CloudMaterial = function CloudMaterial() {
188 var material = this._materialNode; 188 var material = this._materialNode;
189 if (material) 189 if (material)
190 { 190 {
191 if (this._srcWorld) this._srcWorld.draw();
192
191 var technique = material.shaderProgram['default']; 193 var technique = material.shaderProgram['default'];
192 var renderer = g_Engine.getContext().renderer; 194 var renderer = g_Engine.getContext().renderer;
193 if (renderer && technique) { 195 if (renderer && technique) {
diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js
index 345effd6..569bc364 100644
--- a/js/lib/rdge/texture.js
+++ b/js/lib/rdge/texture.js
@@ -159,6 +159,8 @@ function Texture( dstWorld, texMapName, wrap, mips )
159 var __texCounter = 0; 159 var __texCounter = 0;
160 this.loadFromCanvas = function() 160 this.loadFromCanvas = function()
161 { 161 {
162 var NJUtils = require("js/lib/NJUtils").NJUtils;
163
162 var srcCanvas = this._srcCanvas; 164 var srcCanvas = this._srcCanvas;
163 var wrap = this._wrap; 165 var wrap = this._wrap;
164 var mips = this._mips; 166 var mips = this._mips;
@@ -175,7 +177,8 @@ function Texture( dstWorld, texMapName, wrap, mips )
175 177
176 // create the canvas and context to render into 178 // create the canvas and context to render into
177 var doc = srcCanvas.ownerDocument; 179 var doc = srcCanvas.ownerDocument;
178 this._renderCanvas = doc.createElement("texture_canvas"); 180 //this._renderCanvas = doc.createElement("texture_canvas");
181 this._renderCanvas = NJUtils.makeNJElement("canvas", "texture_canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
179 182
180 this.render(); 183 this.render();
181 184