mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-20 12:36:05 +08:00
Port GetCPUInformation and mathlib from sdk2013
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
//
|
||||
//=============================================================================//
|
||||
#include <quantize.h>
|
||||
#include <tier0/basetypes.h>
|
||||
#include <minmax.h>
|
||||
|
||||
#define N_EXTRAVALUES 1
|
||||
#define N_DIMENSIONS (3+N_EXTRAVALUES)
|
||||
@ -46,7 +46,7 @@ void ColorQuantize(uint8 const *Image,
|
||||
val1+=PIXEL(x,y,c)*ExtraValueXForms[i*3+c];
|
||||
val1>>=8;
|
||||
NthSample(s,y*Width+x,N_DIMENSIONS)->Value[c]=(uint8)
|
||||
(MIN(255,MAX(0,val1)));
|
||||
(V_min(255,V_max(0,val1)));
|
||||
}
|
||||
}
|
||||
struct QuantizedValue *q=Quantize(s,Width*Height,N_DIMENSIONS,
|
||||
@ -76,7 +76,7 @@ void ColorQuantize(uint8 const *Image,
|
||||
tryc+=Error[x][c][ErrorUse];
|
||||
Error[x][c][ErrorUse]=0;
|
||||
}
|
||||
samp[c]=(uint8) MIN(255,MAX(0,tryc));
|
||||
samp[c]=(uint8) V_min(255,V_max(0,tryc));
|
||||
}
|
||||
struct QuantizedValue *f=FindMatch(samp,3,Weights,q);
|
||||
out_pixels[Width*y+x]=(uint8) (f->value);
|
||||
|
Reference in New Issue
Block a user