|
@@ -5,13 +5,12 @@
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
/** @file newgrf_spritegroup.cpp Handling of primarily NewGRF action 2. */
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
#include <algorithm>
|
|
|
#include "debug.h"
|
|
|
#include "newgrf_spritegroup.h"
|
|
|
#include "newgrf_profiling.h"
|
|
|
#include "core/pool_func.hpp"
|
|
|
|
|
|
#include "safeguards.h"
|
|
@@ -170,16 +169,16 @@ static U EvalAdjustT(const Deterministic
|
|
|
case DSGA_TYPE_NONE: break;
|
|
|
}
|
|
|
|
|
|
switch (adjust->operation) {
|
|
|
case DSGA_OP_ADD: return last_value + value;
|
|
|
case DSGA_OP_SUB: return last_value - value;
|
|
|
case DSGA_OP_SMIN: return min((S)last_value, (S)value);
|
|
|
case DSGA_OP_SMAX: return max((S)last_value, (S)value);
|
|
|
case DSGA_OP_UMIN: return min((U)last_value, (U)value);
|
|
|
case DSGA_OP_UMAX: return max((U)last_value, (U)value);
|
|
|
case DSGA_OP_SMIN: return std::min<S>(last_value, value);
|
|
|
case DSGA_OP_SMAX: return std::max<S>(last_value, value);
|
|
|
case DSGA_OP_UMIN: return std::min<U>(last_value, value);
|
|
|
case DSGA_OP_UMAX: return std::max<U>(last_value, value);
|
|
|
case DSGA_OP_SDIV: return value == 0 ? (S)last_value : (S)last_value / (S)value;
|
|
|
case DSGA_OP_SMOD: return value == 0 ? (S)last_value : (S)last_value % (S)value;
|
|
|
case DSGA_OP_UDIV: return value == 0 ? (U)last_value : (U)last_value / (U)value;
|
|
|
case DSGA_OP_UMOD: return value == 0 ? (U)last_value : (U)last_value % (U)value;
|
|
|
case DSGA_OP_MUL: return last_value * value;
|
|
|
case DSGA_OP_AND: return last_value & value;
|