GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


chams by gs
1
 
void ColorFunc(int r, int g, int b, int a)
{
    glDisableClientState(GL_COLOR_ARRAY);
    glColor4ub(r, g, b, a);
    glEnable(GL_COLOR_MATERIAL);
}

void Part1(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
    if(!Rec.FullEnemy){glEnable(GL_TEXTURE_2D);}                             

if(Rec.FullEnemy){glEnable(GL_TEXTURE_2D);glDisable(GL_BLEND);glEnableClientState(GL_TEXTURE_COORD_ARRAY);}

    if(Rec.FullEnemy){
    glPushMatrix();        
    glDisable(GL_TEXTURE_2D);    
    glDisable(GL_DEPTH_TEST);    
    ColorFunc(0,0,0,255);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_POLYGON_OFFSET_LINE);
        glEnable(GL_LINE_LOOP);
        glLineWidth(2.5);    
    glPolygonMode(GL_FRONT, GL_LINE);
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
    glDrawElements(mode, count, type, indices);    
        ColorFunc(255,0,0,130);    
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_DEPTH_TEST);
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glPopMatrix();        
    }

}

void Part2(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{    
    if(Rec.FullEnemy){
    glPushMatrix();    
    glDisable(GL_DEPTH_TEST);    
    glScalef(1,1,1);
    ColorFunc(220,0,0,140);
    glDrawElements(mode, count, type, indices);
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_BLEND);    
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glScalef(0.99,1.01,1.0);    
    glEnable(GL_DEPTH_TEST);        
    glDrawElements(mode, count, type, indices);    
        ColorFunc(20,20,20,120);        
    glPopMatrix();        
    }

}


In glDrawElements
if(CelEmu){
  if(Rec.Bolt_OnS){return;}//remove any bits on our models
  Part1(mode, count, type, indices);
  Part2(mode, count, type, indices);
}