26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
void
initEntities()
{
ents = [[OFMutableArray alloc] init];
}
static void
renderent(Entity *e, OFString *mdlname, float z, float yaw, int frame/* = 0*/,
int numf/* = 1*/, int basetime/* = 0*/, float speed/* = 10.0f*/)
{
rendermodel(mdlname, frame, numf, 0, 1.1f,
OFMakeVector3D(e.x, z + S(e.x, e.y)->floor, e.y), yaw, 0, false,
1.0f, speed, 0, basetime);
}
void
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
void
initEntities()
{
ents = [[OFMutableArray alloc] init];
}
static void
renderent(Entity *e, OFString *mdlname, float z, float yaw, int frame /* = 0*/,
int numf /* = 1*/, int basetime /* = 0*/, float speed /* = 10.0f*/)
{
rendermodel(mdlname, frame, numf, 0, 1.1f,
OFMakeVector3D(e.x, z + S(e.x, e.y)->floor, e.y), yaw, 0, false,
1.0f, speed, 0, basetime);
}
void
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
continue;
if (e.type < I_SHELLS || e.type > TELEPORT)
continue;
renderent(e, entmdlnames[e.type - I_SHELLS],
(float)(1 +
sin(lastmillis / 100.0 + e.x + e.y) /
20),
lastmillis / 10.0f, 0,1,0,10.0f);
} else {
switch (e.attr2) {
case 1:
case 3:
continue;
case 2:
case 0:
if (!e.spawned)
continue;
renderent(e, @"carrot",
(float)(1 +
sin(lastmillis / 100.0 + e.x +
e.y) /
20),
lastmillis /
(e.attr2 ? 1.0f : 10.0f),
0, 1, 0, 10.0f);
break;
case 4:
renderent(e, @"switch2", 3,
(float)e.attr3 * 90,
(!e.spawned && !triggertime) ? 1
: 0,
|
|
|
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
continue;
if (e.type < I_SHELLS || e.type > TELEPORT)
continue;
renderent(e, entmdlnames[e.type - I_SHELLS],
(float)(1 +
sin(lastmillis / 100.0 + e.x + e.y) /
20),
lastmillis / 10.0f, 0, 1, 0, 10.0f);
} else {
switch (e.attr2) {
case 1:
case 3:
continue;
case 2:
case 0:
if (!e.spawned)
continue;
renderent(e, @"carrot",
(float)(1 +
sin(lastmillis / 100.0 + e.x +
e.y) /
20),
lastmillis /
(e.attr2 ? 1.0f : 10.0f),
0, 1, 0, 10.0f);
break;
case 4:
renderent(e, @"switch2", 3,
(float)e.attr3 * 90,
(!e.spawned && !triggertime) ? 1
: 0,
|