File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,10 @@ var functionBuilder = (function() {
9797 function webglString_fromFunctionNames ( functionList ) {
9898 var ret = [ ] ;
9999 for ( var i = 0 ; i < functionList . length ; ++ i ) {
100- ret . push ( this . nodeMap [ functionList [ i ] ] . getWebglFunctionString ( ) ) ;
100+ var node = this . nodeMap [ functionList [ i ] ] ;
101+ if ( node ) {
102+ ret . push ( this . nodeMap [ functionList [ i ] ] . getWebglFunctionString ( ) ) ;
103+ }
101104 }
102105 return ret . join ( "\n" ) ;
103106 }
@@ -120,5 +123,24 @@ var functionBuilder = (function() {
120123 }
121124 functionBuilder . prototype . webglString = webglString ;
122125
126+ //---------------------------------------------------------
127+ //
128+ // Polyfill stuff
129+ //
130+ //---------------------------------------------------------
131+
132+ // Round function used in polyfill
133+ function round ( a ) { return Math . floor ( a + 0.5 ) ; }
134+
135+ ///
136+ /// Function: polyfillStandardFunctions
137+ ///
138+ /// Polyfill in the missing Math funcitons (round)
139+ ///
140+ function polyfillStandardFunctions ( ) {
141+ this . addFunction ( null , round ) ;
142+ }
143+ functionBuilder . prototype . polyfillStandardFunctions = polyfillStandardFunctions ;
144+
123145 return functionBuilder ;
124146} ) ( ) ;
You can’t perform that action at this time.
0 commit comments