SMaterial in version 1.6

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
tft67
Posts: 19
Joined: Sat Nov 08, 2008 2:56 am

SMaterial in version 1.6

Post by tft67 »

I founded in SMaterial.h :


bool Wireframe:1;
bool PointCloud:1;
...

a bit bit field of one boolean value !
Why this change ?


u8 ColorMask:4;
another bit field ?
I don't understand. Is it a bug ?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

well a bool can only be 1 or zero so its not bad to change the size to just 1 bit. dunno really if that really make the switching of materials faster or anything but it makes the Smaterial struct smaler in size. but again dunno if that actually helps.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

It doesn't help with switching materials, it will be slower because your processor prefers to work in 32 or 64 bits, however it does keep the size of SMaterial small:
1.5.x = 184 bytes
1.6.x = 168 bytes
(on 64-bit systems)

As you can see, the size is actually smaller despite the extra SMaterial members.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply