/[hegemonie]/hegemonie/Model/MdlModel.m
ViewVC logotype

Diff of /hegemonie/Model/MdlModel.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by c-leo, Mon Jun 30 14:19:55 2003 UTC revision 1.2 by ano, Wed Jul 2 16:58:32 2003 UTC
# Line 405  Line 405 
405    NSParameterAssert (camera);    NSParameterAssert (camera);
406    NSParameterAssert (name);    NSParameterAssert (name);
407    NSParameterAssert ([name length] != 0);    NSParameterAssert ([name length] != 0);
408      
409    MdlAnimation *animation = [self animation: name];    MdlAnimation *animation = [self animation: name];
410    
411    NSParameterAssert ( frame >= [animation startFrame]);    NSParameterAssert ( frame >= [animation startFrame]);
412    NSParameterAssert ( frame < [animation startFrame] + [animation nbFrames]);    NSParameterAssert ( frame < [animation startFrame] + [animation nbFrames]);
413    
414        
415    GLfloat vertice[_nbVertices * 3* 2 + _nbVertices * 2 ];      GLfloat vertice[_nbVertices * 3* 2 + _nbVertices * 2 ];  
416    
# Line 419  Line 420 
420    int noVertex;    int noVertex;
421    for (noVertex = 0; noVertex < _nbVertices; noVertex++)    for (noVertex = 0; noVertex < _nbVertices; noVertex++)
422      {      {
423    
424        coord_t currentNormal = _normales [noVertex + frame * _nbVertices];        coord_t currentNormal = _normales [noVertex + frame * _nbVertices];
425        coord_t nextNormal = _normales [noVertex + nextFrame * _nbVertices];        coord_t nextNormal = _normales [noVertex + nextFrame * _nbVertices];
426    
# Line 454  Line 456 
456        glEnable(GL_NORMALIZE);        glEnable(GL_NORMALIZE);
457        int nbElements = [_data meshNbTriangles: noMesh]*3;        int nbElements = [_data meshNbTriangles: noMesh]*3;
458        glBindTexture(GL_TEXTURE_2D, [self _texture: noMesh]);        glBindTexture(GL_TEXTURE_2D, [self _texture: noMesh]);
459          
460        glDrawElements (GL_TRIANGLES, nbElements,        glDrawElements (GL_TRIANGLES, nbElements,
461                        GL_UNSIGNED_INT, _verticeIndices + ind);                        GL_UNSIGNED_INT, _verticeIndices + ind);
462        glDisable(GL_NORMALIZE);        glDisable(GL_NORMALIZE);
# Line 560  currentAnimation: (NSString *) animName Line 563  currentAnimation: (NSString *) animName
563  {  {
564    NSParameterAssert (noMesh >= 0);    NSParameterAssert (noMesh >= 0);
565    NSParameterAssert (noMesh < [_data nbMeshes]);    NSParameterAssert (noMesh < [_data nbMeshes]);
566      
567    return (GLuint) [[_textures objectAtIndex: noMesh] intValue];    return (GLuint) [[_textures objectAtIndex: noMesh] intValue];
568  }  }
569    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26