| 259 | } |
| 260 | |
| 261 | _processConstants() { |
| 262 | if (!this.constants) return ''; |
| 263 | |
| 264 | const result = []; |
| 265 | for (let p in this.constants) { |
| 266 | const type = this.constantTypes[p]; |
| 267 | switch (type) { |
| 268 | case 'HTMLCanvas': |
| 269 | case 'HTMLImage': |
| 270 | case 'HTMLVideo': |
| 271 | result.push(` const constants_${p} = this._mediaTo2DArray(this.constants.${p});\n`); |
| 272 | break; |
| 273 | case 'HTMLImageArray': |
| 274 | result.push(` const constants_${p} = this._imageTo3DArray(this.constants.${p});\n`); |
| 275 | break; |
| 276 | case 'Input': |
| 277 | result.push(` const constants_${p} = this.constants.${p}.value;\n`); |
| 278 | break; |
| 279 | default: |
| 280 | result.push(` const constants_${p} = this.constants.${p};\n`); |
| 281 | } |
| 282 | } |
| 283 | return result.join(''); |
| 284 | } |
| 285 | |
| 286 | _earlyThrows() { |
| 287 | if (this.graphical) return ''; |