Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Wrath::EngineStudio::StudioRenderFinal_Hardware(void)
- {
- static cvar_t* pDrawEntities = g_pStudio->GetCvar("r_drawentities");
- if (pDrawEntities->value != 2.0f && pDrawEntities->value != 3.0f)
- {
- cl_entity_t *pEnt = g_OrigStudio.GetCurrentEntity();
- // Check if its our ineye weapon
- if (strstr(pEnt->model->name, "v_"))
- {
- // Get studio header
- studiohdr_t *pStudioHdr = (studiohdr_t*)g_OrigStudio.Mod_Extradata(pEnt->model);
- for (int i = 0; i < pStudioHdr->numbodyparts; ++i)
- {
- // Get bodypart and submodel of it
- mstudiobodyparts_t *pBodyPart = (mstudiobodyparts_t*)((byte*)pStudioHdr + pStudioHdr->bodypartindex) + i;
- mstudiomodel_t *pSubModel = (mstudiomodel_t*)((byte*)pStudioHdr + pBodyPart->modelindex);
- // Knife and famas only has studio as bodypart, while rest has rhand and lhand bodyparts. So get them with models.
- bool bKnife = strstr(pEnt->model->name, "knife") != NULL;
- bool bFamas = strstr(pEnt->model->name, "famas") != NULL;
- bool bStudio = strstr(pBodyPart->name, "studio") != NULL;
- // If its our hands, dont draw.
- if (strstr(pBodyPart->name, "rhand") || strstr(pBodyPart->name, "lhand")) continue;
- // Famas and knife, doesnt have rhand & lhand bodyparts, so remove vertices (ty shad0w & b2k5)
- if (bStudio && (bKnife || bFamas))
- {
- for (int x = 0; x < pBodyPart->nummodels; x++)
- {
- byte* pVertBone = (byte*)((byte*)pStudioHdr + pSubModel[x].vertinfoindex); // Get sub model vertice info
- for (int j = 0; j < pSubModel[x].numverts; j++) // Loop through vertices and remove hands
- if ((bKnife && pVertBone[j] != 38) || (bFamas && pVertBone[j] != 45 && pVertBone[j] != 47 && pVertBone[j] != 49 && pVertBone[j] != 51))
- ((Vector*)((byte*)pStudioHdr + pSubModel[x].vertindex))[j][2] -= 100000;
- }
- }
- // Setup model and call drawing pts (draw weapon)
- g_OrigStudio.StudioSetupModel(i, (void**)&pBodyPart, (void**)&pSubModel);
- g_OrigStudio.StudioDrawPoints();
- }
- return; // Dont call original if its our ineye weapon
- }
- }
- // Call original
- g_StudioRenderModel.GetFunctionByIndex<_StudioRenderFinal_Hardware>(21)(g_StudioRenderModel.GetInstance());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement