From d9926f9023bf5c2a464079c31c18e19d39132397 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Mon, 28 Mar 2016 16:27:14 +0300 Subject: [PATCH] fixed test light movement --- render.d | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/render.d b/render.d index fe0b02b..64b8a1c 100644 --- a/render.d +++ b/render.d @@ -473,6 +473,7 @@ void renderLight() (int lightX, int lightY, in auto ref SVec4F lcol, int lightRa // ////////////////////////////////////////////////////////////////////////// // __gshared int testLightX = vlWidth/2, testLightY = vlHeight/2; +__gshared bool testLightMoved = true; //__gshared int mapOfsX, mapOfsY; //__gshared bool movement = false; __gshared float iLiquidTime = 0.0; @@ -738,10 +739,13 @@ void renderScene (MonoTime curtime) { } { - int tlx = testLightX/scale+mofsx/scale; - int tly = testLightY/scale+mofsx/scale; + if (testLightMoved) { + testLightX = testLightX/scale+mofsx/scale; + testLightY = testLightY/scale+mofsy/scale; + testLightMoved = false; + } foreach (immutable _; 0..1) { - renderLight(tlx, tly, SVec4F(0.3f, 0.3f, 0.0f, 1.0f), 96); + renderLight(testLightX, testLightY, SVec4F(0.3f, 0.3f, 0.0f, 1.0f), 96); } } @@ -922,6 +926,11 @@ public void renderThread (Tid starterTid) { addMessage(mbuf[0..msgpos]); } }, + (TMsgTestLightMove msg) { + testLightX = msg.x; + testLightY = msg.y; + testLightMoved = true; + }, (Variant v) { conwriteln("WARNING: unknown thread message received and ignored"); }, -- 2.11.4.GIT