Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Since my shit is getting leaked, and others are taking credit for it, it's come to this...
- //Enjoy.
- #define compass_data ((compass_shit*)(*(int*)(0xE22F18) + 0x69B78))
- #define FLOAT_1_0 1.0f
- #define compass_max_range (*(float*)(0x01cc9d78))
- #define color_white color(255, 255, 255, 255)
- #define __mask_neg_float -1.0f
- float _mm_xor_ps(float v15, float _mask__NegFloat_)
- {
- return v15 * _mask__NegFloat_;
- }
- struct rectDef_s
- {
- float x;
- float y;
- float w;
- float h;
- int horzAlign;
- int vertAlign;
- };
- void __cdecl CG_CompassCalcDimensions(int compassType, cg_s *cgaa, rectDef_s *parentRect, rectDef_s *rect, float *x, float *y, float *w, float *h)
- {
- Invoke<void>(0x2F810, compassType, cgaa, parentRect, rect, x, y, w, h);
- }
- void __cdecl R_AddCmdDrawStretchPicRotateSTInternal(float x, float y, float w, float h, float centerS, float centerT, float radiusST, float scaleFinalS, float scaleFinalT, float angle, const float * color, void * material)
- {
- Invoke<void>(0x76A55C, x, y, w, h, centerS, centerT, radiusST, scaleFinalS, scaleFinalT, angle, color, material);
- }
- void __cdecl ScrPlace_ApplyRect(float *x, float *y, float *w, float *h, int horzAlign, int vertAlign)
- {
- Invoke<void>(0x15FFE0, 0xFB9DE0, x, y, w, h, horzAlign, vertAlign);
- }
- void __cdecl CL_DrawStretchPicRotatedSTInternal(float x, float y, float w, float h, int horzAlign, int vertAlign, float centerS, float centerT, float radiusST, float scaleFinalS, float scaleFinalT, float angle, color c, pvoid Material)
- {
- ScrPlace_ApplyRect(&x, &y, &w, &h, horzAlign, vertAlign);
- R_AddCmdDrawStretchPicRotateSTInternal(x, y, w, h, centerS, centerT, radiusST, scaleFinalS, scaleFinalT, angle, (float*)&c, Material);
- }
- void CL_DrawStretchPicInternal(float x, float y, float w, float h, int horzAlign, int vertAlign, float centerS, float centerT, float radiusST, float scaleFinalS, color color, pvoid material) {
- Invoke<void>(0x10B588, 0xFB9DE0, x, y, w, h, horzAlign, vertAlign, centerS, centerT, radiusST, scaleFinalS, (float*)&color, material);
- }
- enum CompassType
- {
- COMPASS_TYPE_PARTIAL = 0x0,
- COMPASS_TYPE_FULL = 0x1,
- };
- void __cdecl CG_CompassDrawPlayerMap(CompassType compassType)
- {
- /// stack
- rectDef_s parentRect, rect;
- Vector2 east, south, mapCenter;
- float delta, delta_4, texCenter, texCenter_4, texRadius, scaleFinalS, scaleFinalT, rotation, x, y, w, h;
- /// radar_render #begin
- float width = 213, hight = 163;
- parentRect.w = width;
- parentRect.h = hight;
- rect.w = width;
- rect.h = hight;
- rect.x = -97;
- rect.y = 31;
- w = width;
- h = hight;
- mapCenter.x = cg->refdef.ViewOrigin.x;
- mapCenter.y = cg->refdef.ViewOrigin.y;
- east.x = compass_data->compassNorth.y;
- east.y = _mm_xor_ps(compass_data->compassNorth.x, __mask_neg_float);
- south.x = _mm_xor_ps(compass_data->compassNorth.x, __mask_neg_float);
- south.y = _mm_xor_ps(compass_data->compassNorth.y, __mask_neg_float);
- delta = mapCenter.x - compass_data->compassMapUpperLeft.x;
- delta_4 = mapCenter.y - compass_data->compassMapUpperLeft.y;
- texCenter = (float)((float)(delta * east.x) + (float)(delta_4 * east.y)) / compass_data->compassMapWorldSize.x;
- texCenter_4 = (float)((float)(delta * south.x) + (float)(delta_4 * south.y)) / compass_data->compassMapWorldSize.y;
- if (compass_data->compassMapWorldSize.x <= compass_data->compassMapWorldSize.y)
- {
- texRadius = (float)(0.5 * compass_max_range) / compass_data->compassMapWorldSize.y;
- scaleFinalS = compass_data->compassMapWorldSize.y / compass_data->compassMapWorldSize.x;
- scaleFinalT = FLOAT_1_0;
- }
- else
- {
- texRadius = (float)(0.5 * compass_max_range) / compass_data->compassMapWorldSize.x;
- scaleFinalS = FLOAT_1_0;
- scaleFinalT = compass_data->compassMapWorldSize.x / compass_data->compassMapWorldSize.y;
- }
- rotation = _mm_xor_ps((cg->playerstate.viewAngles.y - compass_data->compassNorthYaw), __mask_neg_float);
- CG_CompassCalcDimensions(compassType, cg, &parentRect, &rect, &x, &y, &w, &h);
- if (compassType != 1)
- {
- CL_DrawStretchPicRotatedSTInternal(x, y, w, h, rect.horzAlign, rect.vertAlign, texCenter, texCenter_4, texRadius, scaleFinalS, scaleFinalT, rotation, color_white, compass_data->compassMapMaterial);
- }
- else
- {
- CL_DrawStretchPicInternal(x, y, w, h, rect.horzAlign, rect.vertAlign, 0.0, 0.0, 1.0, 1.0, color_white, compass_data->compassMapMaterial);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement