Created
August 26, 2018 21:46
-
-
Save jt0dd/57434d50ee7701c5b429894b4481578e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_getMainConstantsString() { | |
const result = []; | |
if (this.constants) { | |
for (let name in this.constants) { | |
if (!this.constants.hasOwnProperty(name)) continue; | |
let value = this.constants[name]; | |
let type = utils.getArgumentType(value); | |
console.log("Constant detected of type:", type); | |
switch (type) { | |
case 'Integer': | |
result.push('const float constants_' + name + ' = ' + parseInt(value) + '.0'); | |
break; | |
case 'Float': | |
result.push('const float constants_' + name + ' = ' + parseFloat(value)); | |
break; | |
case 'Texture': | |
result.push(???); | |
break; | |
default: | |
throw new Error(`Unsupported constant ${ name } type ${ type }`); | |
} | |
} | |
} | |
return this._linesToString(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment