142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
}
}
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);
}
string closeent;
OFString *entnames[] = {
@"none?",
@"light",
@"playerstart",
@"shells",
@"bullets",
@"rockets",
|
|
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
}
}
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);
}
static OFString *closeent;
OFString *entnames[] = {
@"none?",
@"light",
@"playerstart",
@"shells",
@"bullets",
@"rockets",
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
@"?",
@"?",
};
void
renderents() // show sparkly thingies for map entities in edit mode
{
closeent[0] = 0;
if (!editmode)
return;
loopv(ents)
{
entity &e = ents[i];
if (e.type == NOTUSED)
continue;
OFVector3D v = OFMakeVector3D(e.x, e.y, e.z);
particle_splash(2, 2, 40, v);
}
int e = closestent();
if (e >= 0) {
entity &c = ents[e];
@autoreleasepool {
sprintf_s(closeent)(
"closest entity = %s (%d, %d, %d, %d), "
"selection = (%d, %d)",
entnames[c.type].UTF8String, c.attr1, c.attr2,
c.attr3, c.attr4, getvar(@"selxs"),
getvar(@"selys"));
}
}
}
void
loadsky(OFString *basename)
{
@autoreleasepool {
|
|
<
|
|
|
|
<
|
<
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
@"?",
@"?",
};
void
renderents() // show sparkly thingies for map entities in edit mode
{
closeent = @"";
if (!editmode)
return;
loopv(ents)
{
entity &e = ents[i];
if (e.type == NOTUSED)
continue;
OFVector3D v = OFMakeVector3D(e.x, e.y, e.z);
particle_splash(2, 2, 40, v);
}
int e = closestent();
if (e >= 0) {
entity &c = ents[e];
closeent = [[OFString alloc]
initWithFormat:@"closest entity = %@ (%d, %d, %d, %d), "
@"selection = (%d, %d)",
entnames[c.type], c.attr1, c.attr2, c.attr3, c.attr4,
getvar(@"selxs"), getvar(@"selys")];
}
}
void
loadsky(OFString *basename)
{
@autoreleasepool {
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
@autoreleasepool {
OFString *command = getcurcommand();
OFString *player = playerincrosshair();
if (command)
draw_textf(@"> %@_", 20, 1570, 2, command);
else if (closeent[0])
draw_text(@(closeent), 20, 1570, 2);
else if (player != nil)
draw_text(player, 20, 1570, 2);
}
renderscores();
if (!rendermenu()) {
glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
|
|
|
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
@autoreleasepool {
OFString *command = getcurcommand();
OFString *player = playerincrosshair();
if (command)
draw_textf(@"> %@_", 20, 1570, 2, command);
else if (closeent.length > 0)
draw_text(closeent, 20, 1570, 2);
else if (player != nil)
draw_text(player, 20, 1570, 2);
}
renderscores();
if (!rendermenu()) {
glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
|