From cfb4a291cbd458a98d23d8520deac88f0e6799b6 Mon Sep 17 00:00:00 2001 From: jndean Date: Sat, 26 Aug 2023 22:58:50 +0000 Subject: [PATCH] Add visualisation of IPU-rendered walls --- src/ipu/r_bsp.c | 23 +++++++++++++++++------ src/ipu/r_codelets.cpp | 4 ---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/ipu/r_bsp.c b/src/ipu/r_bsp.c index a333e18..048d5a8 100644 --- a/src/ipu/r_bsp.c +++ b/src/ipu/r_bsp.c @@ -80,8 +80,20 @@ cliprange_t solidsegs[MAXSEGS]; // JOSEF: !!!!!!!!!!!!!!!!!!!!! // JOSEF: TMP to see if BSP is working // JOSEF: !!!!!!!!!!!!!!!!!!!!! +int bspnum; void R_StoreWallRange(int start, int stop) { - // ACTUAL func in r_segs.c + // ACTUAL R_StoreWallRange func is in r_segs.c + + char colour = bspnum % 256; + int top = 90, bottom = 110; + for (int col = start; col < stop; ++col) { + for (int row = top; row < bottom; ++row) { + I_VideoBuffer[row * 320 + col] = colour; + } + } + for (int row = top; row < bottom; ++row) { + I_VideoBuffer[row * 320 + stop] = 0; + } } // @@ -516,10 +528,8 @@ void R_RenderBSPNode(int bspnum) { */ // -// RenderBSPNode -// Renders all subsectors below a given node, -// traversing subtree recursively. -// Just call with BSP root. +// R_RenderBSPNodeNonRecursive +// Non-recursive version void R_RenderBSPNodeNonRecursive() { node_t *bsp; int side; @@ -529,7 +539,8 @@ void R_RenderBSPNodeNonRecursive() { int sidestack[maxRecursion]; int depth = 0; - int bspnum = numnodes - 1; + // int bspnum = numnodes - 1; // Temporarily make this global for visualising + bspnum = numnodes - 1; while (1) { // Loop that descends tree, taking the front side of each node until it diff --git a/src/ipu/r_codelets.cpp b/src/ipu/r_codelets.cpp index a0f0d4e..32da5a4 100644 --- a/src/ipu/r_codelets.cpp +++ b/src/ipu/r_codelets.cpp @@ -24,10 +24,6 @@ struct R_RenderPlayerView_Vertex : public poplar::Vertex { void compute() { assert(&frame[0] == I_VideoBuffer); - for (int i = 0; i < 100; ++i){ - frame[i + 320 * i ] = 1; - frame[i + 320 * i + 1] = 1; - } IPU_R_RenderPlayerView_UnpackMiscValues( (R_RenderPlayerView_MiscValues_t*) &miscValues[0] );