37- (id)initWithPListName:(NSString *)plistName
38 options:(uint32_t)options
39 anisotropy:(GLfloat)anisotropy
40 lodBias:(GLfloat)lodBias
46 seed:RANROTGetFullSeed()];
50- (id)initWithPListName:(NSString *)plistName
51 options:(uint32_t)options
52 anisotropy:(GLfloat)anisotropy
53 lodBias:(GLfloat)lodBias
57 NSArray *config =
nil;
58 NSUInteger i,
count, j;
67 if (
self ==
nil) OK = NO;
72 if (config ==
nil) OK = NO;
77 count = [config count];
92 for (i = 0; i !=
count; ++i)
94 entry = [config objectAtIndex:i];
96 if ([entry isKindOfClass:[NSDictionary
class]])
98 name = [(NSDictionary *)entry oo_stringForKey:@"texture"];
99 probability = [entry oo_floatForKey:@"probability" defaultValue:1.0f];
100 object = [entry objectForKey:@"galaxy"];
101 if ([
object isKindOfClass:[NSString
class]])
103 galID = [object intValue];
105 else if (
object !=
nil)
107 OOLog(
@"textures.load",
@"***** ERROR: %@ for texture %@ is not a string.",
@"galaxy", name);
110 else if ([entry isKindOfClass:[NSString
class]])
120 if (name !=
nil && 0.0f < probability)
131 _galaxy[_count] = (galID >= 0 ? galID : -1);
166 for (i = 0; i !=
_count; ++i)
168 [_textures[i] release];
183 return [NSString stringWithFormat:@"<%@ %p>{%u textures, cumulative probability=%g}", [
self class], self, _count, _probMax];
OOTexture * selectTexture()
id initWithPListName:options:anisotropy:lodBias:seed:(NSString *plistName,[options] uint32_t options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias,[seed] RANROTSeed seed)
id textureWithName:inFolder:options:anisotropy:lodBias:(NSString *name,[inFolder] NSString *directory,[options] OOTextureFlags options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias)