I've also tested dbScaleVector4(..)
for (int i=0;i<1000000;i++){
// dbScaleVector4(&gVect4_01,&gVect4_01,1.0f);
ScaleVector4(&gVect4_01,1.0f);
}
Here is my version:
Vector4 ScaleVector4(Vector4 *v,float Scale){
v->w*=Scale;
v->x*=Scale;
v->y*=Scale;
v->z*=Scale;
return *v;
}
Not only is it faster, it conforms to the same style as DirectX in that it also returns a value so it can be used as a parameter in a function.
Yea, I know 1M times! It took that many to get any significantly noticable difference on my machine. I wonder why GDK2 isn't using DirectX math variables in its functions. We could do the math and send the results to GDK functions much faster than sending them a special struct that is then converted to DX math.....
The fastest code is the code never written.