From f7424ea5bd6913d6fd93ae4134e3880f984ea042 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Wed, 21 Apr 2021 17:21:03 +0100 Subject: [PATCH] Implement TransformVertex for PC --- GL/platforms/software.c | 15 +++++++++++++++ GL/platforms/software.h | 1 + 2 files changed, 16 insertions(+) diff --git a/GL/platforms/software.c b/GL/platforms/software.c index 7e904a0..40ccf8f 100644 --- a/GL/platforms/software.c +++ b/GL/platforms/software.c @@ -328,3 +328,18 @@ void TransformVertices(Vertex* vertices, const int count) { vertices->w = ret[3]; } } + +void TransformVertex(const float* xyz, const float* w, float* oxyz, float* ow) { + float ret[4]; + ret[0] = xyz[0]; + ret[1] = xyz[1]; + ret[2] = xyz[2]; + ret[3] = *w; + + TransformVec4(ret); + + oxyz[0] = ret[0]; + oxyz[1] = ret[1]; + oxyz[2] = ret[2]; + *ow = ret[3]; +} diff --git a/GL/platforms/software.h b/GL/platforms/software.h index 47fa9a6..e3a3a03 100644 --- a/GL/platforms/software.h +++ b/GL/platforms/software.h @@ -50,6 +50,7 @@ static inline void TransformNormalNoMod(const float* xIn, float* xOut) { } void TransformVertices(Vertex* vertices, const int count); +void TransformVertex(const float* xyz, const float* w, float* oxyz, float* ow); void InitGPU(_Bool autosort, _Bool fsaa);