Advertisement
tonti666

Untitled

Oct 23rd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. void HandChams(void* thisptr, void* edx, DrawModelResults_t *pResults, const DrawModelInfo_t& info, matrix3x4_t *pBoneToWorld, float *pFlexWeights, float *pFlexDelayedWeights, const Vector &modelOrigin, int flags)
  2. {
  3. if (!g_pSettings->VisualsArmChams->SelectedIndex)
  4. return;
  5.  
  6. Color col = Color(g_pSettings->ColorHands->color);
  7. Color col_wireframe = Color(col.r() * 0.8, col.g() * 0.8, col.b() * 0.8);
  8.  
  9. switch (g_pSettings->VisualsArmChams->SelectedIndex) /* there must be a better more optimized way to do this? */
  10. {
  11. case 0: //wtf
  12. return; break;
  13. case 1: // textured
  14. {
  15. Interfaces->StudioRender->SetColorModulation(col.Base());
  16. Interfaces->StudioRender->SetAlphaModulation(1.0f);
  17. Interfaces->StudioRender->ForcedMaterialOverride(g_pMaterialHelper->OpenLit);
  18. }break;
  19.  
  20. case 2: // material
  21. {
  22. /*IMaterial* skins[MAXSTUDIOSKINS];
  23. CBaseEntity* model_entity = reinterpret_cast<CBaseEntity*>(info.m_pClientEntity);
  24.  
  25. if (!model_entity)
  26. return;
  27.  
  28. studiohdr_t* hdr = Interfaces->ModelInfo->GetStudioModel(model_entity->GetModel());
  29. Interfaces->ModelInfo->GetModelMaterials(model_entity->GetModel(), hdr->numtextures, skins);
  30.  
  31. for (auto i = 0; i < hdr->numtextures; ++i)
  32. {
  33. if (!skins[i])
  34. {
  35. continue;
  36. }
  37.  
  38. skins[i]->ColorModulate(col.rBase(), col.gBase(), col.bBase());
  39. skins[i]->AlphaModulate(col.aBase());
  40. }
  41.  
  42. oDrawHuso(thisptr, pResults, info, pBoneToWorld, pFlexWeights, pFlexDelayedWeights, modelOrigin, flags);
  43.  
  44. for (auto i = 0; i < hdr->numtextures; ++i)
  45. {
  46. if (!skins[i])
  47. {
  48. continue;
  49. }
  50.  
  51. skins[i]->ColorModulate(1.0f, 1.0f, 1.0f);
  52. skins[i]->AlphaModulate(1.0f);
  53. }*/
  54. }break;
  55.  
  56. case 3: // flat
  57. {
  58. Interfaces->StudioRender->SetColorModulation(col.Base());
  59. Interfaces->StudioRender->SetAlphaModulation(1.0f);
  60. Interfaces->StudioRender->ForcedMaterialOverride(g_pMaterialHelper->OpenFlat);
  61. }break;
  62.  
  63. case 4: // golden
  64. {
  65. static IMaterial* gold = Interfaces->MaterialSystem->FindMaterial("models/inventory_items/trophy_majors/gold", TEXTURE_GROUP_OTHER);
  66. Interfaces->StudioRender->ForcedMaterialOverride(gold);
  67.  
  68. oDrawHuso(thisptr, pResults, info, pBoneToWorld, pFlexWeights, pFlexDelayedWeights, modelOrigin, flags);
  69.  
  70. }break;
  71.  
  72. case 5: // glass
  73. {
  74. static IMaterial* glass = Interfaces->MaterialSystem->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_OTHER);
  75. Interfaces->StudioRender->SetAlphaModulation(1.0f);
  76. Interfaces->StudioRender->ForcedMaterialOverride(glass);
  77.  
  78. oDrawHuso(thisptr, pResults, info, pBoneToWorld, pFlexWeights, pFlexDelayedWeights, modelOrigin, flags);
  79. }break;
  80. }
  81.  
  82. if (g_pSettings->VisualsArmWireframe->Checked)
  83. {
  84. oDrawHuso(thisptr, pResults, info, pBoneToWorld, pFlexWeights, pFlexDelayedWeights, modelOrigin, flags);
  85. Interfaces->StudioRender->SetColorModulation(col_wireframe.Base());
  86. Interfaces->StudioRender->SetAlphaModulation(1.0f);
  87. Interfaces->StudioRender->ForcedMaterialOverride(g_pMaterialHelper->AddWire);
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement