mirror of https://github.com/Chlumsky/msdfgen.git
Fix compile issues on GCC
This commit is contained in:
parent
010f3c92f1
commit
f85010e48e
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
#include "msdf-edge-artifact-patcher.h"
|
#include "msdf-edge-artifact-patcher.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "arithmetics.hpp"
|
#include "arithmetics.hpp"
|
||||||
|
|
@ -131,7 +132,7 @@ static void msdfPatchEdgeArtifactsInner(const BitmapRef<float, N> &sdf, const Sh
|
||||||
// Store hotspot's closest texel's current color
|
// Store hotspot's closest texel's current color
|
||||||
float *subject = sdf((int) hotspot->x, (int) hotspot->y);
|
float *subject = sdf((int) hotspot->x, (int) hotspot->y);
|
||||||
float texel[N];
|
float texel[N];
|
||||||
memcpy(texel, subject, N*sizeof(float));
|
std::memcpy(texel, subject, N*sizeof(float));
|
||||||
// Sample signed distance at hotspot
|
// Sample signed distance at hotspot
|
||||||
float msd[N];
|
float msd[N];
|
||||||
interpolate(msd, BitmapConstRef<float, N>(sdf), *hotspot);
|
interpolate(msd, BitmapConstRef<float, N>(sdf), *hotspot);
|
||||||
|
|
@ -143,7 +144,7 @@ static void msdfPatchEdgeArtifactsInner(const BitmapRef<float, N> &sdf, const Sh
|
||||||
interpolate(msd, BitmapConstRef<float, N>(sdf), *hotspot);
|
interpolate(msd, BitmapConstRef<float, N>(sdf), *hotspot);
|
||||||
float newSsd = median(msd[0], msd[1], msd[2]);
|
float newSsd = median(msd[0], msd[1], msd[2]);
|
||||||
// Revert modified texel
|
// Revert modified texel
|
||||||
memcpy(subject, texel, N*sizeof(float));
|
std::memcpy(subject, texel, N*sizeof(float));
|
||||||
|
|
||||||
// Consider hotspot an artifact if flattening improved the sample
|
// Consider hotspot an artifact if flattening improved the sample
|
||||||
if (fabsf(newSsd-sd) < fabsf(oldSsd-sd))
|
if (fabsf(newSsd-sd) < fabsf(oldSsd-sd))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue