199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
-
-
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
|
getvar(@"selxs"), getvar(@"selys")];
}
}
void
loadsky(OFString *basename)
{
@autoreleasepool {
static OFString *lastsky = @"";
static OFString *lastsky = @"";
basename = [basename stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"];
basename = [basename stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"];
if ([lastsky isEqual:basename])
return;
if ([lastsky isEqual:basename])
return;
static const OFString *side[] = { @"ft", @"bk", @"lf", @"rt",
@"dn", @"up" };
int texnum = 14;
loopi(6)
{
OFString *path =
[OFString stringWithFormat:@"packages/%@_%@.jpg",
static const OFString *side[] = { @"ft", @"bk", @"lf", @"rt", @"dn",
@"up" };
int texnum = 14;
loopi(6)
{
OFString *path = [OFString
stringWithFormat:@"packages/%@_%@.jpg", basename, side[i]];
basename, side[i]];
int xs, ys;
if (!installtex(texnum + i,
[Cube.sharedInstance.gameDataIRI
IRIByAppendingPathComponent:path],
&xs, &ys, true))
conoutf(@"could not load sky textures");
}
int xs, ys;
if (!installtex(texnum + i,
[Cube.sharedInstance.gameDataIRI
IRIByAppendingPathComponent:path],
&xs, &ys, true))
conoutf(@"could not load sky textures");
}
lastsky = basename;
lastsky = basename;
}
}
COMMAND(loadsky, ARG_1STR)
float cursordepth = 0.9f;
GLint viewport[4];
GLdouble mm[16], pm[16];
OFVector3D worldpos;
|
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
|
dblend -= curtime / 3;
if (dblend < 0)
dblend = 0;
}
glEnable(GL_TEXTURE_2D);
@autoreleasepool {
OFString *command = getcurcommand();
OFString *player = playerincrosshair();
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);
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);
glBindTexture(GL_TEXTURE_2D, 1);
glBegin(GL_QUADS);
glColor3ub(255, 255, 255);
|