50 :(NSString *)plistName
51 options:(uint32_t)options
52 anisotropy:(GLfloat)anisotropy
53 lodBias:(GLfloat)lodBias
55{
56 BOOL OK = YES;
57 NSArray *config =
nil;
58 NSUInteger i,
count, j;
61 float probability;
63 int galID = -1;
65
66 self = [super init];
67 if (
self ==
nil) OK = NO;
68
69 if (OK)
70 {
72 if (config ==
nil) OK = NO;
73 }
74
75 if (OK)
76 {
77 count = [config count];
78
83
85 }
86
87 if (OK)
88 {
90
91
92 for (i = 0; i !=
count; ++i)
93 {
94 entry = [config objectAtIndex:i];
95 galID = -1;
96 if ([entry isKindOfClass:[NSDictionary class]])
97 {
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]])
102 {
103 galID = [object intValue];
104 }
105 else if (
object !=
nil)
106 {
107 OOLog(
@"textures.load",
@"***** ERROR: %@ for texture %@ is not a string.",
@"galaxy", name);
108 }
109 }
110 else if ([entry isKindOfClass:[NSString class]])
111 {
112 name = entry;
113 probability = 1.0f;
114 }
115 else
116 {
118 }
119
120 if (name !=
nil && 0.0f < probability)
121 {
128 {
131 _galaxy[_count] = (galID >= 0 ? galID : -1);
132 if (galID >= 0) {
134 }
135 else
136 {
139 }
141 }
142 }
143 }
144
146 }
147
149
150 if (!OK)
151 {
152 [self release];
154 }
155
156 return self;
157}
#define OOLog(class, format,...)
id textureWithName:inFolder:options:anisotropy:lodBias:(NSString *name,[inFolder] NSString *directory,[options] OOTextureFlags options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias)
NSArray * arrayFromFilesNamed:inFolder:andMerge:(NSString *fileName,[inFolder] NSString *folderName,[andMerge] BOOL mergeFiles)