Added getParameterIndexForName

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4077
This commit is contained in:
mike
2012-08-23 22:43:26 +00:00
parent 9077b5a890
commit 4b7163aa48
2 changed files with 13 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ typedef enum KREngineParameterType {KRENGINE_PARAMETER_INT, KRENGINE_PARAMETER_F
-(double)getParameterValueWithIndex: (int)i; -(double)getParameterValueWithIndex: (int)i;
-(void)setParameterValueWithIndex: (int)i Value: (double)v; -(void)setParameterValueWithIndex: (int)i Value: (double)v;
-(void)setParameterValueWithName: (NSString *)name Value: (double)v; -(void)setParameterValueWithName: (NSString *)name Value: (double)v;
-(int)getParameterIndexWithName: (NSString *)name;
- (void)renderScene: (KRScene *)pScene WithViewMatrix: (KRMat4)viewMatrix; - (void)renderScene: (KRScene *)pScene WithViewMatrix: (KRMat4)viewMatrix;
- (void)renderScene: (KRScene *)pScene WithPosition: (KRVector3)position Yaw: (GLfloat)yaw Pitch: (GLfloat)pitch Roll: (GLfloat)roll; - (void)renderScene: (KRScene *)pScene WithPosition: (KRVector3)position Yaw: (GLfloat)yaw Pitch: (GLfloat)pitch Roll: (GLfloat)roll;

View File

@@ -437,6 +437,18 @@ double const PI = 3.141592653589793f;
} }
} }
-(int)getParameterIndexWithName: (NSString *)name
{
int cParameters = [self getParameterCount];
for(int i=0; i < cParameters; i++) {
if([[self getParameterNameWithIndex:i] caseInsensitiveCompare:name] == NSOrderedSame)
{
return i;
}
}
return -1; // not found
}
- (void)setNearZ: (double)dNearZ - (void)setNearZ: (double)dNearZ
{ {
if(_camera->perspective_nearz != dNearZ) { if(_camera->perspective_nearz != dNearZ) {