2023-07-24 11:03:22 -04:00
|
|
|
|
|
|
|
#include "features.h"
|
|
|
|
#include "../include/globals.h"
|
|
|
|
#include "../include/cvars.h"
|
|
|
|
#include "../include/util.h"
|
|
|
|
|
|
|
|
#include <GL/gl.h>
|
|
|
|
|
2023-07-25 08:46:25 -04:00
|
|
|
visible_flags visible_mode;
|
2023-07-24 11:03:22 -04:00
|
|
|
|
|
|
|
bool chams(void* this_ptr) {
|
|
|
|
if (!CVAR_ON(chams))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
cl_entity_t* ent = i_enginestudio->GetCurrentEntity();
|
|
|
|
|
|
|
|
if (ent->index == localplayer->index) {
|
|
|
|
/* TODO: Hand chams (set var, check in gl hook, return true) */
|
|
|
|
return false;
|
2023-07-24 11:06:06 -04:00
|
|
|
} else if (!valid_player(ent) || !is_alive(ent)) {
|
2023-07-24 11:03:22 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we got here it means we are rendering a valid player */
|
|
|
|
glDisable(GL_TEXTURE_2D);
|
|
|
|
|
|
|
|
glDisable(GL_DEPTH_TEST); /* Ignore depth (walls between target) */
|
|
|
|
visible_mode = NOT_VISIBLE;
|
|
|
|
i_studiomodelrenderer->StudioRenderFinal(this_ptr);
|
|
|
|
|
|
|
|
glEnable(GL_DEPTH_TEST); /* Don't ignore depth, different color chams */
|
|
|
|
visible_mode = VISIBLE;
|
|
|
|
i_studiomodelrenderer->StudioRenderFinal(this_ptr);
|
|
|
|
|
|
|
|
/* Reset for future calls to glColor4f (from here or somewhere else) */
|
|
|
|
visible_mode = NONE;
|
|
|
|
glEnable(GL_TEXTURE_2D);
|
|
|
|
|
|
|
|
/* StudioRenderModel hook doesn't need to call original */
|
|
|
|
return true;
|
|
|
|
}
|