Implemented KRContext class to reduce the parameter count of method calls

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4041
This commit is contained in:
kearwood
2012-04-12 19:43:08 +00:00
parent 1c3ffa4d67
commit f847b89f5a
22 changed files with 295 additions and 186 deletions

View File

@@ -102,40 +102,46 @@
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSFileManager* fileManager = [NSFileManager defaultManager];
for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
if([fileName hasSuffix: @".scene"]) {
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
}
for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
if([fileName hasSuffix: @".pvr"]) {
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
}
for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
if([fileName hasSuffix: @".mtl"]) {
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
}
for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
if([fileName hasSuffix: @".krobject"]) {
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
}
for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
if([fileName hasSuffix: @".krscene"]) {
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
[renderEngine loadResource: path];
}
//
// for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
// if([fileName hasSuffix: @".scene"]) {
// NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
// [renderEngine loadResource: path];
// }
// }
//
// for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
// if([fileName hasSuffix: @".pvr"]) {
// NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
// [renderEngine loadResource: path];
// }
// }
//
// for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
// if([fileName hasSuffix: @".mtl"]) {
// NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
// [renderEngine loadResource: path];
// }
// }
//
// for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
// if([fileName hasSuffix: @".krobject"]) {
// NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
// [renderEngine loadResource: path];
// }
// }
//
// for (NSString* fileName in [fileManager contentsOfDirectoryAtPath: documentsDirectory error:nil]) {
// if([fileName hasSuffix: @".krscene"]) {
// NSString* path = [NSString stringWithFormat:@"%@/%@", documentsDirectory, fileName];
// [renderEngine loadResource: path];
// }
// }
[renderEngine setNearZ: 25.0];
[renderEngine setFarZ: 5000.0];
@@ -236,7 +242,7 @@
- (KRScene *)getScene;
{
return renderEngine.getSceneManager->getFirstScene();
return renderEngine.context->getSceneManager()->getFirstScene();
}
#pragma mark -