mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-05 15:31:16 +00:00
More tests and fix vector/quaternion global dumps.
This commit is contained in:
parent
5d52810b9c
commit
e42c5a4272
8 changed files with 73 additions and 2 deletions
|
@ -89,7 +89,7 @@ dump_def (progs_t *pr, ddef_t *def, int indent)
|
||||||
comment = va (" %g", G_FLOAT (pr, offset));
|
comment = va (" %g", G_FLOAT (pr, offset));
|
||||||
break;
|
break;
|
||||||
case ev_vector:
|
case ev_vector:
|
||||||
comment = va (" '%g %g %g",
|
comment = va (" '%g %g %g'",
|
||||||
G_VECTOR (pr, offset)[0],
|
G_VECTOR (pr, offset)[0],
|
||||||
G_VECTOR (pr, offset)[1],
|
G_VECTOR (pr, offset)[1],
|
||||||
G_VECTOR (pr, offset)[2]);
|
G_VECTOR (pr, offset)[2]);
|
||||||
|
@ -118,7 +118,7 @@ dump_def (progs_t *pr, ddef_t *def, int indent)
|
||||||
comment = va (" %x", G_INT (pr, offset));
|
comment = va (" %x", G_INT (pr, offset));
|
||||||
break;
|
break;
|
||||||
case ev_quat:
|
case ev_quat:
|
||||||
comment = va (" '%g %g %g %g",
|
comment = va (" '%g %g %g %g'",
|
||||||
G_QUAT (pr, offset)[0],
|
G_QUAT (pr, offset)[0],
|
||||||
G_QUAT (pr, offset)[1],
|
G_QUAT (pr, offset)[1],
|
||||||
G_QUAT (pr, offset)[2],
|
G_QUAT (pr, offset)[2],
|
||||||
|
|
9
tools/qfcc/test/cast2.r
Normal file
9
tools/qfcc/test/cast2.r
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
void foo (vector x)
|
||||||
|
{
|
||||||
|
entity *ep;
|
||||||
|
int d;
|
||||||
|
|
||||||
|
//d = (int) x.y;
|
||||||
|
//ep = (entity *) d;
|
||||||
|
ep = (entity *) (int) x.y;
|
||||||
|
}
|
23
tools/qfcc/test/class-end.r
Normal file
23
tools/qfcc/test/class-end.r
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
@interface foo
|
||||||
|
-init;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation foo
|
||||||
|
-init
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
@protocol baz
|
||||||
|
-blah;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface bar
|
||||||
|
-init;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation bar
|
||||||
|
-init
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
2
tools/qfcc/test/const.r
Normal file
2
tools/qfcc/test/const.r
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
int x = 3;
|
||||||
|
float y = 4;
|
11
tools/qfcc/test/field-alias.r
Normal file
11
tools/qfcc/test/field-alias.r
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
.int blah;
|
||||||
|
.void () think;
|
||||||
|
.SEL thinkMethod = think;
|
||||||
|
|
||||||
|
void foo (entity e)
|
||||||
|
{
|
||||||
|
*(SEL *)&e.think = @selector(foo:);
|
||||||
|
e.thinkMethod = @selector(foo:);
|
||||||
|
}
|
||||||
|
void __obj_exec_class (obj_module_t *msg) = #0;
|
||||||
|
|
6
tools/qfcc/test/self-this.r
Normal file
6
tools/qfcc/test/self-this.r
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.int a;
|
||||||
|
|
||||||
|
void f(void)
|
||||||
|
{
|
||||||
|
@self.@this = nil;
|
||||||
|
}
|
|
@ -1,9 +1,16 @@
|
||||||
float VAL1 = 4;
|
float VAL1 = 4;
|
||||||
float VAL2 = 6;
|
float VAL2 = 6;
|
||||||
|
vector VMIN = '-16 -16 -24';
|
||||||
|
vector VMAX = '16 16 32';
|
||||||
|
vector v;
|
||||||
|
|
||||||
void send (float to, ...) = #0;
|
void send (float to, ...) = #0;
|
||||||
|
|
||||||
void do_something ()
|
void do_something ()
|
||||||
{
|
{
|
||||||
|
vector a;
|
||||||
|
|
||||||
|
a = VMIN;
|
||||||
|
a = VMAX;
|
||||||
send (VAL1, VAL2);
|
send (VAL1, VAL2);
|
||||||
}
|
}
|
||||||
|
|
13
tools/qfcc/test/vector2.r
Normal file
13
tools/qfcc/test/vector2.r
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
vector a;
|
||||||
|
entity e;
|
||||||
|
.vector v;
|
||||||
|
|
||||||
|
float foo (void)
|
||||||
|
{
|
||||||
|
a.z += 3;
|
||||||
|
a_z += 3;
|
||||||
|
e.v = a;
|
||||||
|
e.v.y = 2;
|
||||||
|
e.v_y = 2;
|
||||||
|
return e.v.z;
|
||||||
|
}
|
Loading…
Reference in a new issue