would you inline this function? Ive allways read that inlines should be no more than a couple lines. Dose being a template change that guideline?
Code:
void cRenderEngine::DrawWheel(cSelectionWheel<sTerrainType*>* selectionWheel) {
list<sTerrainType*>::iterator sel;
float w = 3.0f, h = 3.0f;
glLoadIdentity();
//translate to center
glTranslatef(selectionWheel->center.x,selectionWheel->center.y,selectionWheel->center.z);
//rotate by offset
glRotatef(selectionWheel->offset,1,0,0);
for(sel = selectionWheel->objectList->begin(); sel != selectionWheel->objectList->end(); sel++) {
glPushMatrix();
//translate out by radius
glTranslatef(0,0,selectionWheel->radius);
//bind preview pic
glBindTexture(GL_TEXTURE_2D, (*sel)->previewTexture);
//draw preview
glColor3f(1.0f,1.0f,1.0f);
glEnable(GL_DEPTH_TEST);
glBegin(GL_QUADS);
glVertex2f(-w,-h); glTexCoord2f(1,0);
glVertex2f(w,-h); glTexCoord2f(1,1);
glVertex2f(w,h); glTexCoord2f(0,1);
glVertex2f(-w,h); glTexCoord2f(0,0);
glEnd();
glDisable(GL_DEPTH_TEST);
glPopMatrix();
//rotate by step
glRotatef(-selectionWheel->step,1,0,0);
}
}