Changeset - r16860:0bad3b9958de
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2010-12-22 22:03:57
frosch@openttd.org
(svn r21604) -Add: Variable 7B for accessing 60+x variables while taking the parameter from the accumulator.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -146,24 +146,26 @@ const SpriteGroup *DeterministicSpriteGr
 
		bool available = true;
 
		if (adjust->variable == 0x7E) {
 
			const SpriteGroup *subgroup = SpriteGroup::Resolve(adjust->subroutine, object);
 
			if (subgroup == NULL) {
 
				value = CALLBACK_FAILED;
 
			} else {
 
				value = subgroup->GetCallbackResult();
 
			}
 

	
 
			/* Reset values to current scope.
 
			 * Note: 'last_value' and 'reseed' are shared between the main chain and the procedure */
 
			object->scope = this->var_scope;
 
		} else if (adjust->variable == 0x7B) {
 
			value = GetVariable(object, adjust->parameter, last_value, &available);
 
		} else {
 
			value = GetVariable(object, adjust->variable, adjust->parameter, &available);
 
		}
 

	
 
		if (!available) {
 
			/* Unsupported variable: skip further processing and return either
 
			 * the group from the first range or the default group. */
 
			return SpriteGroup::Resolve(this->num_ranges > 0 ? this->ranges[0].group : this->default_group, object);
 
		}
 

	
 
		switch (this->size) {
 
			case DSG_SIZE_BYTE:  value = EvalAdjustT<uint8,  int8> (adjust, object, last_value, value); break;
0 comments (0 inline, 0 general)