POV-Ray : Newsgroups : povray.programming : Some remarks on media.cpp Server Time
23 Dec 2024 02:57:51 EST (-0500)
  Some remarks on media.cpp (Message 1 to 1 of 1)  
From: Thomas Willhalm
Subject: Some remarks on media.cpp
Date: 17 Feb 2003 05:39:02
Message: <3e50bbc5@news.povray.org>
Hello,

during the weekend, I had a closer look at "media.cpp". These
are the comments I have collected so far:

In the function "sample_media" the variable "expanded" is 
only set, but its value is actually never used. The same is true
for the static variable sampCount_s; I assume that both variables
can be removed from the code.

In the function "update_light_list_entry" the only test whether the
variable "insert" is true is commented out. From what I understand
of the code, it should be commented in again.

In the function "Simulate_Media" (approx. line 654), the variable
"sampleCount" is set to 2 if it is smaller than 2. Immediately
afterwards, it is tested if "sampleCount" is smaller than 2.
For obvious reasons, this should never happen to be true.

There are a lot of extern declarations in the section "Local typedefs".
I believe that the section "Global variables" in media.h or lighting.h 
would be more suited for these.
extern long MaxMediaPoolDepth;
extern LIT_INTERVAL **MediaLitIntervalPool;
extern LIGHT_LIST **MediaLightListPool;
extern MEDIA_INTERVAL **MediaIntervalPool;
extern long *MediaIntervalPoolSize;
extern DBL *s0, *s1;
extern long MediaPoolIndex;
#ifdef AccumulatePoolStatistics
extern long MaxSimMediatRecCntr;
#endif
However, s1 has to be renamed then to avoid name clashes.

BTW, in mesh.cpp in function MeshUV, VScale and VAddScaledEq are applied to 
2D vectors (UV_VECT), which results in accessing a subscript out of 
range. Since this function is not used anyway, I suggest to remove it
completely from the source (sorry Alexander).

Best regards
Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.