In more ways than one! icon_states() is by no means a fast proc. You'd do better to cache its return value and keep reusing that.
Lummox JR
How exactly would I go about doing that?
Resonating_Light
ID:268110
Mar 15 2004, 5:34 am
|
|
Lummox Jr. wrote:
In more ways than one! icon_states() is by no means a fast proc. You'd do better to cache its return value and keep reusing that. How exactly would I go about doing that? Resonating_Light |
Mar 15 2004, 5:55 am
|
|
Resonating_Light wrote:
|
In response to Shadowdarke
|
|
Hmm, lets see now. We can use:
> var/list/icon_states_cache = list /* Associated list of icon_states Or: <code> turf/grass New() icon_state = "[rand[1,4]]"</code> Hmm... |
In response to Foomer
|
|
I was answering the question about how to cache the icon_states list. Personally, I'd go with the random number scheme in this case as well. That doesn't mean that caching is not a useful thing to know for other cases.
|
In response to Foomer
|
|
Foomer wrote:
turf/grass No need for seperate .dmi files now :P |
In response to Shadowdarke
|
|
Thanks, this really could come in useful! Though I'm not sure where I'll end up using it.
Resonating Light |