Created
May 23, 2012 11:08
-
-
Save PrimaryFeather/2774587 to your computer and use it in GitHub Desktop.
The code generator used to create the 'QuadBatch.getImageProgramName' method in the Starling Framework.
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
var tab:String = " "; | |
for each (var tinted:Boolean in [true, false]) | |
{ | |
trace(tinted ? "if (tinted)" : "else"); | |
trace("{"); | |
for each (var mipMap:Boolean in [true, false]) | |
{ | |
trace(tab, mipMap ? "if (mipMap)" : "else"); | |
trace(tab, "{"); | |
for each (var repeat:Boolean in [true, false]) | |
{ | |
trace(tab, tab, repeat ? "if (repeat)" : "else"); | |
trace(tab, tab, "{"); | |
var name:String = tinted ? "QB_i*" : "QB_i'"; | |
if (mipMap) name += "M"; | |
if (repeat) name += "R"; | |
trace(tab, tab, tab, "if (smoothing == 'bilinear') return \"" + name + "B" + "\";"); | |
trace(tab, tab, tab, "else if (smoothing == 'trilinear') return \"" + name + "T" + "\";"); | |
trace(tab, tab, tab, "else return \"" + name + "N" + "\";"); | |
trace(tab, tab, "}"); | |
} | |
trace(tab, "}"); | |
} | |
trace("}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to vync79 for the initial version of this code generator!