Clean up file handling
FossilOrigin-Name: 3d55e077f74fc1c036e856cc4fdf0ae3c308c58f7d37eb9392f1a15f10cc237d
This commit is contained in:
parent
c6eebefd77
commit
ab582d3745
14 changed files with 278 additions and 231 deletions
|
@ -206,18 +206,27 @@ loadsky(OFString *basename)
|
|||
{
|
||||
@autoreleasepool {
|
||||
static OFString *lastsky = @"";
|
||||
|
||||
if ([lastsky isEqual:basename])
|
||||
return;
|
||||
char *side[] = {"ft", "bk", "lf", "rt", "dn", "up"};
|
||||
|
||||
static const OFString *side[] = {
|
||||
@"ft", @"bk", @"lf", @"rt", @"dn", @"up"};
|
||||
int texnum = 14;
|
||||
loopi(6)
|
||||
{
|
||||
sprintf_sd(name)(
|
||||
"packages/%s_%s.jpg", basename.UTF8String, side[i]);
|
||||
OFString *path =
|
||||
[OFString stringWithFormat:@"packages/%@_%@.jpg",
|
||||
basename, side[i]];
|
||||
|
||||
int xs, ys;
|
||||
if (!installtex(texnum + i, path(name), xs, ys, true))
|
||||
if (!installtex(texnum + i,
|
||||
[Cube.sharedInstance.gameDataIRI
|
||||
IRIByAppendingPathComponent:path],
|
||||
&xs, &ys, true))
|
||||
conoutf(@"could not load sky textures");
|
||||
}
|
||||
|
||||
lastsky = basename;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue