Skip to content

Commit

Permalink
fix(rxtrace): Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed May 2, 2024
1 parent 5b586e6 commit 84e819d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/rt/RtraceSimulManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.7 2024/05/01 20:28:53 greg Exp $";
static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.8 2024/05/02 22:10:43 greg Exp $";
#endif
/*
* RtraceSimulManager.cpp
Expand Down Expand Up @@ -217,7 +217,7 @@ RtraceSimulManager::EnqueueBundle(const FVECT orig_direc[], int n, RNUMBER rID0)
return -1;

if (castonly && !cookedCall)
error(CONSISTENCY, "EnqueueBundle() called in castonly mode without cookedCall");
error(INTERNAL, "EnqueueBundle() called in castonly mode without cookedCall");

if (!UpdateMode()) // update rendering mode if requested
return -1;
Expand All @@ -227,8 +227,12 @@ RtraceSimulManager::EnqueueBundle(const FVECT orig_direc[], int n, RNUMBER rID0)
VCOPY(res.rdir, orig_direc[1]);
orig_direc += 2;
rayorigin(&res, PRIMARY, NULL, NULL);
if (rID0) res.rno = rID0++;
else res.rno = ++lastRayID;
if (!rID0)
res.rno = ++lastRayID;
else if (curFlags & RTdoFIFO)
error(INTERNAL, "Ray number assignment unsupported with FIFO");
else
res.rno = lastRayID = rID0++;
if (curFlags & RTimmIrrad)
res.revf = rayirrad;
else if (castonly)
Expand Down
3 changes: 1 addition & 2 deletions src/rt/RtraceSimulManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* RCSid $Id: RtraceSimulManager.h,v 2.7 2024/05/01 22:06:09 greg Exp $ */
/* RCSid $Id: RtraceSimulManager.h,v 2.8 2024/05/02 22:10:43 greg Exp $ */
/*
* RtraceSimulManager.h
*
Expand Down Expand Up @@ -127,7 +127,6 @@ class RtraceSimulManager : public RadSimulManager {
int FlushQueue();
/// Close octree, free data, return status
int Cleanup(bool everything = false) {
FlushQueue();
SetCookedCall(NULL);
SetTraceCall(NULL);
rtFlags = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/rt/rxtrace.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rxtrace.cpp,v 2.4 2024/05/01 22:06:09 greg Exp $";
static const char RCSid[] = "$Id: rxtrace.cpp,v 2.5 2024/05/02 22:10:43 greg Exp $";
#endif
/*
* C++ module for individual ray tracing.
Expand Down Expand Up @@ -236,7 +236,7 @@ rtrace( /* trace rays from stdin or file */
pending |= (n > 1); // time to flush output?
bool atZero = IsZeroVec(ivbuf[2*n-1]);
if (pending & (atZero | (n == flushIntvl))) {
if (!myRTmanager.FlushQueue())
if (myRTmanager.FlushQueue() <= 0)
error(USER, "ray flush error");
fflush(stdout);
pending = false;
Expand Down

0 comments on commit 84e819d

Please sign in to comment.