17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
void
renderclient(
DynamicEntity *d, bool team, OFString *mdlname, bool hellpig, float scale)
{
int n = 3;
float speed = 100.0f;
float mz = d.o.z - d.eyeheight + 1.55f * scale;
intptr_t tmp = (intptr_t)d;
int basetime = -(tmp & 0xFFF);
if (d.state == CS_DEAD) {
int r;
if (hellpig) {
n = 2;
r = range[3];
} else {
n = (intptr_t)d % 3;
r = range[n];
}
basetime = d.lastaction;
int t = lastmillis - d.lastaction;
if (t < 0 || t > 20000)
return;
if (t > (r - 1) * 100) {
n += 4;
if (t > (r + 10) * 100) {
t -= (r + 10) * 100;
mz -= t * t / 10000000000.0f * t;
}
}
if (mz < -1000)
return;
// mdl = (((int)d>>6)&1)+1;
// mz = d.o.z-d.eyeheight+0.2f;
// scale = 1.2f;
} else if (d.state == CS_EDITING) {
n = 16;
} else if (d.state == CS_LAGGED) {
n = 17;
} else if (d.monsterstate == M_ATTACKING) {
n = 8;
} else if (d.monsterstate == M_PAIN) {
n = 10;
} else if ((!d.move && !d.strafe) || !d.moving) {
n = 12;
} else if (!d.onfloor && d.timeinair > 100) {
n = 18;
} else {
n = 14;
speed = 1200 / d.maxspeed * scale;
if (hellpig)
speed = 300 / d.maxspeed;
}
if (hellpig) {
n++;
scale *= 32;
mz -= 1.9f;
}
rendermodel(mdlname, frame[n], range[n], 0, 1.5f,
OFMakeVector3D(d.o.x, mz, d.o.y), d.yaw + 90, d.pitch / 2, team,
scale, speed, 0, basetime);
}
extern int democlientnum;
void
renderclients()
{
|
|
|
|
|
|
|
|
|
|
|
|
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
void
renderclient(
DynamicEntity *d, bool team, OFString *mdlname, bool hellpig, float scale)
{
int n = 3;
float speed = 100.0f;
float mz = d.origin.z - d.eyeHeight + 1.55f * scale;
intptr_t tmp = (intptr_t)d;
int basetime = -(tmp & 0xFFF);
if (d.state == CS_DEAD) {
int r;
if (hellpig) {
n = 2;
r = range[3];
} else {
n = (intptr_t)d % 3;
r = range[n];
}
basetime = d.lastAction;
int t = lastmillis - d.lastAction;
if (t < 0 || t > 20000)
return;
if (t > (r - 1) * 100) {
n += 4;
if (t > (r + 10) * 100) {
t -= (r + 10) * 100;
mz -= t * t / 10000000000.0f * t;
}
}
if (mz < -1000)
return;
// mdl = (((int)d>>6)&1)+1;
// mz = d.o.z-d.eyeHeight+0.2f;
// scale = 1.2f;
} else if (d.state == CS_EDITING) {
n = 16;
} else if (d.state == CS_LAGGED) {
n = 17;
} else if (d.monsterState == M_ATTACKING) {
n = 8;
} else if (d.monsterState == M_PAIN) {
n = 10;
} else if ((!d.move && !d.strafe) || !d.moving) {
n = 12;
} else if (!d.onFloor && d.timeInAir > 100) {
n = 18;
} else {
n = 14;
speed = 1200 / d.maxSpeed * scale;
if (hellpig)
speed = 300 / d.maxSpeed;
}
if (hellpig) {
n++;
scale *= 32;
mz -= 1.9f;
}
rendermodel(mdlname, frame[n], range[n], 0, 1.5f,
OFMakeVector3D(d.origin.x, mz, d.origin.y), d.yaw + 90, d.pitch / 2,
team, scale, speed, 0, basetime);
}
extern int democlientnum;
void
renderclients()
{
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
}
static OFMutableArray<OFString *> *scoreLines;
void
renderscore(DynamicEntity *d)
{
OFString *lag = [OFString stringWithFormat:@"%d", d.plag];
OFString *name = [OFString stringWithFormat:@"(%@)", d.name];
OFString *line =
[OFString stringWithFormat:@"%d\t%@\t%d\t%@\t%@", d.frags,
(d.state == CS_LAGGED ? @"LAG" : lag), d.ping, d.team,
(d.state == CS_DEAD ? name : d.name)];
if (scoreLines == nil)
|
|
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
}
static OFMutableArray<OFString *> *scoreLines;
void
renderscore(DynamicEntity *d)
{
OFString *lag = [OFString stringWithFormat:@"%d", d.lag];
OFString *name = [OFString stringWithFormat:@"(%@)", d.name];
OFString *line =
[OFString stringWithFormat:@"%d\t%@\t%d\t%@\t%@", d.frags,
(d.state == CS_LAGGED ? @"LAG" : lag), d.ping, d.team,
(d.state == CS_DEAD ? name : d.name)];
if (scoreLines == nil)
|