View Single Post
  #4  
Old 06-27-2008, 11:32 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Stefan View Post
Generating images on-the-fly by script is quite interesting though, might need some optimization for big images. The function convertrgbtoascii() is missing though ?
Yeah, it is, forgot! Thanks for reminding me.
Edited the top post.

And these are the functions I was thinking of using instead of the multidimensional arrays:

NPC Code:

function ColorToInt(r, g, b) {
return r * 256 ^ 2 + 256 * g + b;
}



NPC Code:

function IntToColor(i) {
return {int((i / 256 ^ 2)) % 256, int((i / 256)) % 256, (i - 256 ^ 2) % 256};
}



ColorToInt(r, g, b) converts 3 numbers in to it's own unique number (thanks to PFA for that function/idea)
IntToColor(i) outputs the r, g, b generated by ColorToInt.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”

Last edited by Tigairius; 06-27-2008 at 11:43 PM..
Reply With Quote