Use standard library min/max

This commit is contained in:
Pavel Krajcevski 2013-03-06 19:01:19 -05:00
parent 53fe825e49
commit c475ee1dec

View file

@ -43,10 +43,11 @@
#include "TexComp.h"
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include "BC7Compressor.h"
#include "Thread.h"
@ -57,19 +58,9 @@
#include "Image.h"
template <typename T>
static T min(const T &a, const T &b) {
return (a < b)? a : b;
}
template <typename T>
static T max(const T &a, const T &b) {
return (a > b)? a : b;
}
template <typename T>
static void clamp(T &x, const T &minX, const T &maxX) {
x = max(min(maxX, x), minX);
x = std::max(std::min(maxX, x), minX);
}
template <typename T>
@ -111,7 +102,7 @@ static CompressionFunc ChooseFuncFromSettings(const SCompressionSettings &s) {
BC7C::SetQualityLevel(s.iQuality);
#ifdef HAS_SSE_41
if(s.bUseSIMD) {
return BC7C::CompressImageBC7SIMD;
return BC7C::CompressImageBC7SIMD;
}
else {
#endif