From 49878ba83dc69c4ca4b59a10638743cf9f71d101 Mon Sep 17 00:00:00 2001 From: Ricky C Date: Sun, 1 Aug 2021 18:23:44 -0700 Subject: [PATCH] Demonstrate Issue #10 --- source/texturetest/Form1.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/texturetest/Form1.cs b/source/texturetest/Form1.cs index 7939850..9581729 100644 --- a/source/texturetest/Form1.cs +++ b/source/texturetest/Form1.cs @@ -248,6 +248,14 @@ unsafe void CubeFS(byte* BGR, float* Attributes, int Index) int U = (int)(Clamp01(Attributes[0]) * textureWidthMinusOne); int V = (int)(Clamp01(Attributes[1]) * textureHeightMinusOne); + if (float.IsNaN(Attributes[0]) || float.IsNaN(Attributes[1])) + { + BGR[0] = 255; + BGR[1] = 0; + BGR[2] = 0; + return; // Set a breakpoint here to catch issue #10 in the act. + } + *((int*)BGR) = TEXTURE_ADDR[U + V * textureHeight]; }