Caesar/StudioModelRenderer.cpp
//=========================
// StudioRenderModel
// Send bones and verts to renderer
//=========================
StudioRenderModel
Send bones and verts to renderer
StudioRenderModel Send bones and verts to renderer
void StudioRenderModel(void)
{
	cl_entity_s* ent = g_Studio.GetCurrentEntity();
	if (!config.hide_from_obs && config.esp && !g_pGlobals.bSnapshot && !g_pGlobals.bScreenshot)
	{
		if (g_Utils.IsPlayer(ent) && ent->index != g_Local.iIndex)
		{
			if (config.disable_render_teammates && g_Player[ent->index].iTeam == g_Local.iTeam) 
				return;
			if (!config.esp_teammates && g_Player[ent->index].iTeam == g_Local.iTeam)
			{
				oStudioRenderModel();
				g_pGlobals.chams = false;
				return;
			}
			if (config.glow_players)
			{
				glDepthFunc(GL_GREATER);
				glDisable(GL_DEPTH_TEST);
				g_pStudio->SetForceFaceFlags(STUDIO_NF_CHROME);
				ent->curstate.renderfx = kRenderFxGlowShell;
				ent->curstate.renderamt = 12;
				ent->curstate.rendermode = 0;
				if (g_Player[ent->index].iTeam == TERRORIST)
				{
					ent->curstate.rendercolor.r = config.glow_players_t_r;
					ent->curstate.rendercolor.g = config.glow_players_t_g;
					ent->curstate.rendercolor.b = config.glow_players_t_b;
				}
				else if (g_Player[ent->index].iTeam == CT)
				{
					ent->curstate.rendercolor.r = config.glow_players_ct_r;
					ent->curstate.rendercolor.g = config.glow_players_ct_g;
					ent->curstate.rendercolor.b = config.glow_players_ct_b;
				}
				oStudioRenderFinal();
				glEnable(GL_DEPTH_TEST);
				if (!config.chams)
				{
					glDisable(GL_DEPTH_TEST);
					g_pStudio->SetForceFaceFlags(0);
					ent->curstate.renderfx = 0;
					oStudioRenderFinal();
					glEnable(GL_DEPTH_TEST);
					glDepthFunc(GL_LESS);
					oStudioRenderFinal();
				}
			}
			if (config.chams) 
			{
				g_pGlobals.chams = true;
				ent->curstate.rendermode = 0;
				ent->curstate.renderfx = 0;
				ent->curstate.renderamt = 0;
				g_pStudio->SetForceFaceFlags(0);
				if (config.chams_type != 3)
					glDisable(GL_TEXTURE_2D);
				glBindTexture(GL_TEXTURE_2D, 0);
				ent->curstate.rendermode = 0;
				ent->curstate.renderfx = 0;
				ent->curstate.renderamt = 0;
				g_pStudio->SetForceFaceFlags(0);
				if (config.chams_behind_wall) {
					glDepthFunc(GL_GREATER);
					glDisable(GL_DEPTH_TEST);
					if (g_Player[ent->index].iTeam == TERRORIST) {
						g_pGlobals.chams_render_r = config.chams_t_invis_r;
						g_pGlobals.chams_render_g = config.chams_t_invis_g;
						g_pGlobals.chams_render_b = config.chams_t_invis_b;
					}
					else if (g_Player[ent->index].iTeam == CT) {
						g_pGlobals.chams_render_r = config.chams_ct_invis_r;
						g_pGlobals.chams_render_g = config.chams_ct_invis_g;
						g_pGlobals.chams_render_b = config.chams_ct_invis_b;
					}
					else {
						g_pGlobals.chams_render_r = 255;
						g_pGlobals.chams_render_g = 255;
						g_pGlobals.chams_render_b = 255;
					}
					oStudioRenderFinal();
				}
				glEnable(GL_DEPTH_TEST);
				glDepthFunc(GL_LESS);
				if (g_Player[ent->index].iTeam == TERRORIST) {
					g_pGlobals.chams_render_r = config.chams_t_vis_r;
					g_pGlobals.chams_render_g = config.chams_t_vis_g;
					g_pGlobals.chams_render_b = config.chams_t_vis_b;
				}
				else if (g_Player[ent->index].iTeam == CT) {
					g_pGlobals.chams_render_r = config.chams_ct_vis_r;
					g_pGlobals.chams_render_g = config.chams_ct_vis_g;
					g_pGlobals.chams_render_b = config.chams_ct_vis_b;
				}
				else {
					g_pGlobals.chams_render_r = 255;
					g_pGlobals.chams_render_g = 255;
					g_pGlobals.chams_render_b = 255;
				}
				oStudioRenderFinal();
				if (config.chams != 3)
					glEnable(GL_TEXTURE_2D);
			}
			else oStudioRenderModel();
		}
		else oStudioRenderModel();
	}
	else oStudioRenderModel();
	g_pGlobals.chams = false;
}
void StudioRenderModel ( void ) { cl_entity_s * ent = g_Studio . GetCurrentEntity ( ) ; if ( ! config . hide_from_obs && config . esp && ! g_pGlobals . bSnapshot && ! g_pGlobals . bScreenshot ) { if ( g_Utils . IsPlayer ( ent ) && ent -> index != g_Local . iIndex ) { if ( config . disable_render_teammates && g_Player [ ent -> index ] . iTeam == g_Local . iTeam ) return ; if ( ! config . esp_teammates && g_Player [ ent -> index ] . iTeam == g_Local . iTeam ) { oStudioRenderModel ( ) ; g_pGlobals . chams = false ; return ; } if ( config . glow_players ) { glDepthFunc ( GL_GREATER ) ; glDisable ( GL_DEPTH_TEST ) ; g_pStudio -> SetForceFaceFlags ( STUDIO_NF_CHROME ) ; ent -> curstate . renderfx = kRenderFxGlowShell ; ent -> curstate . renderamt = 12 ; ent -> curstate . rendermode = 0 ; if ( g_Player [ ent -> index ] . iTeam == TERRORIST ) { ent -> curstate . rendercolor . r = config . glow_players_t_r ; ent -> curstate . rendercolor . g = config . glow_players_t_g ; ent -> curstate . rendercolor . b = config . glow_players_t_b ; } else if ( g_Player [ ent -> index ] . iTeam == CT ) { ent -> curstate . rendercolor . r = config . glow_players_ct_r ; ent -> curstate . rendercolor . g = config . glow_players_ct_g ; ent -> curstate . rendercolor . b = config . glow_players_ct_b ; } oStudioRenderFinal ( ) ; glEnable ( GL_DEPTH_TEST ) ; if ( ! config . chams ) { glDisable ( GL_DEPTH_TEST ) ; g_pStudio -> SetForceFaceFlags ( 0 ) ; ent -> curstate . renderfx = 0 ; oStudioRenderFinal ( ) ; glEnable ( GL_DEPTH_TEST ) ; glDepthFunc ( GL_LESS ) ; oStudioRenderFinal ( ) ; } } if ( config . chams ) { g_pGlobals . chams = true ; ent -> curstate . rendermode = 0 ; ent -> curstate . renderfx = 0 ; ent -> curstate . renderamt = 0 ; g_pStudio -> SetForceFaceFlags ( 0 ) ; if ( config . chams_type != 3 ) glDisable ( GL_TEXTURE_2D ) ; glBindTexture ( GL_TEXTURE_2D , 0 ) ; ent -> curstate . rendermode = 0 ; ent -> curstate . renderfx = 0 ; ent -> curstate . renderamt = 0 ; g_pStudio -> SetForceFaceFlags ( 0 ) ; if ( config . chams_behind_wall ) { glDepthFunc ( GL_GREATER ) ; glDisable ( GL_DEPTH_TEST ) ; if ( g_Player [ ent -> index ] . iTeam == TERRORIST ) { g_pGlobals . chams_render_r = config . chams_t_invis_r ; g_pGlobals . chams_render_g = config . chams_t_invis_g ; g_pGlobals . chams_render_b = config . chams_t_invis_b ; } else if ( g_Player [ ent -> index ] . iTeam == CT ) { g_pGlobals . chams_render_r = config . chams_ct_invis_r ; g_pGlobals . chams_render_g = config . chams_ct_invis_g ; g_pGlobals . chams_render_b = config . chams_ct_invis_b ; } else { g_pGlobals . chams_render_r = 255 ; g_pGlobals . chams_render_g = 255 ; g_pGlobals . chams_render_b = 255 ; } oStudioRenderFinal ( ) ; } glEnable ( GL_DEPTH_TEST ) ; glDepthFunc ( GL_LESS ) ; if ( g_Player [ ent -> index ] . iTeam == TERRORIST ) { g_pGlobals . chams_render_r = config . chams_t_vis_r ; g_pGlobals . chams_render_g = config . chams_t_vis_g ; g_pGlobals . chams_render_b = config . chams_t_vis_b ; } else if ( g_Player [ ent -> index ] . iTeam == CT ) { g_pGlobals . chams_render_r = config . chams_ct_vis_r ; g_pGlobals . chams_render_g = config . chams_ct_vis_g ; g_pGlobals . chams_render_b = config . chams_ct_vis_b ; } else { g_pGlobals . chams_render_r = 255 ; g_pGlobals . chams_render_g = 255 ; g_pGlobals . chams_render_b = 255 ; } oStudioRenderFinal ( ) ; if ( config . chams != 3 ) glEnable ( GL_TEXTURE_2D ) ; } else oStudioRenderModel ( ) ; } else oStudioRenderModel ( ) ; } else oStudioRenderModel ( ) ; g_pGlobals . chams = false ; }
StudioRenderModel
Send bones and verts to renderer
StudioRenderModel Send bones and verts to renderer
//g_Engine.Con_Printf("1: %i %i %i\n", g_pGlobals.chams_color.r, g_pGlobals.chams_color.g); //g_Engine.Con_Printf("2: %i %i %i\n", g_pGlobals.chams_color.r, g_pGlobals.chams_color.g);