[Bf-committers] Stucci Patch
Ton Roosendaal
ton at blender.org
Fri Feb 25 11:46:11 CET 2005
Hi,
The defines are already there, since beginning of Blender! In
DNA_texture_types.h:
/* return value */
#define TEX_INT 0
#define TEX_RGB 1
#define TEX_NOR 2
It's binary flags... so if both RGB and normal are returned it's '3'. :)
Code readability would be very much improved with it yes, but you can
see the defines being used in functions I recently worked on. Matter of
time. :)
-Ton-
On 25 Feb, 2005, at 4:30, Stephen Swaney wrote:
> On Thu, Feb 24, 2005 at 08:36:40PM -0500, Chris Burt wrote:
>>
>> One other detail I wanted to ask about.. Do you think it would be wise
>> to create a #define for the return values of textures? Right now you
>> have them numerically hard coded as 0 for int, 1 for col, 2 for nor,
>> and
>> 3 for everything. Would it be wise to create in texture.h:
>>
>> #define RV_INT 0
>> #define RV_COL 1
>> #define RV_NOR 2
>> #define RV_ALL 3
>
> Magic Numbers ( numeric constants embedded in code ) are Evil! People
> using them should be tagged with dry erase markers and hunted for
> sport.
>
> All hail the #define!
>
> --
> Stephen Swaney
> sswaney at centurytel.net
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list