libpacket & floats
Posted: Wed Mar 15, 2006 12:08 pm
I was playing around with making some vif packets using the library provided in ps2sdk. For some reason when I try to append a float, it gets all messed up. My guess is the compiler is trying to convert it to an unsigned int. So I a list of vertices:
float *vertices = {...};
and when I try to do:
packet_append_32(&packet, vertices);
It puts something strange in where the float should be.
Now I was able to get around it by doing this:
u32 *vertices2 = vertices;
packet_append_32(&packet, vertices2);
And the results were as expected.
Now my question is: What is the proper way to do this?
float *vertices = {...};
and when I try to do:
packet_append_32(&packet, vertices);
It puts something strange in where the float should be.
Now I was able to get around it by doing this:
u32 *vertices2 = vertices;
packet_append_32(&packet, vertices2);
And the results were as expected.
Now my question is: What is the proper way to do this?