POV-Ray : Newsgroups : povray.programming : Lighting.cpp - Assign_Vector used to copy a COLOUR into an RGB : Re: Lighting.cpp - Assign_Vector used to copy a COLOUR into an RGB Server Time
18 Apr 2024 17:25:44 EDT (-0400)
  Re: Lighting.cpp - Assign_Vector used to copy a COLOUR into an RGB  
From: Massimo Valentini
Date: 16 Sep 2002 14:53:09
Message: <3d862895@news.povray.org>
"Thorsten Froehlich" ha scritto

... I would suggest to replace the
: Assign_xxx macros in frame.h with something like the inline statements
below
: to find the remaining cases of the same problem.  It will generate a few
: errors when assigning tokens, but those errors are correct and can be
fixed
: by a simple cast.
:
:     Thorsten
:
:
: inline DBL *Assign_Vector(DBL *d, DBL *s)
:  { return (DBL *)memcpy(d, s, sizeof(VECTOR)); }
: inline VECTOR *Assign_Vector(VECTOR *d, VECTOR *s)
:  { return (VECTOR *)memcpy(d, s, sizeof(VECTOR)); }
:

Not counting the lack of cast in the parsing code, I found only 
another place doing practically the same. It's in radiosit.cpp 
at line 876:

     Assign_Vector(block->Illuminance, Illuminance);

block->Illuminance is an RGB (float [3])
Illuminance is a COLOUR (float [5])

Massimo


Post a reply to this message

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