quakeforge/tools/qfcc/test/vecaddr.r
Bill Currie a66fb80517 [gamecode] Switch dot products to give a scalar
Making them give a vector was a mistake for Ruamoko. I've probably got a
mess to clean up in game-source, but oh well.
2023-08-31 15:32:52 +09:00

32 lines
464 B
R

void printf (string fmt, ...) = #0;
#if __RUAMOKO__ > 1
#define dot @dot
#else
#define dot *
#endif
void forcelive (float z)
{
}
float foo (vector _v, float _z)
{
vector v = _v;
float z = _z;
_v = nil;
_z = 0;
forcelive (_z);
forcelive (z);
return v dot *(vector*)(&v.y);
}
int
main (int argc, string *argv)
{
vector v = [1, 2, 3];
vector w = [2, 3, 4];
float f;
printf ("%v %g %g %g\n", v, v dot v, v dot w, f=foo (v, 4));
return f != v dot w;
}