Advertisement
TehMerkMods

Pregame Draw BO2

Sep 18th, 2016
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.37 KB | None | 0 0
  1. Functions for PreGame Draw Text
  2.  
  3. opd_s Dvar_GetBool_t = { 0x3DA948, TOC };
  4. opd_s Dvar_FindMalleableVar_t = { 0x3DA628, TOC };
  5. opd_s Material_RegisterHandle_t = { 0x763220, TOC };
  6. opd_s R_RegisterFont_t = { 0x75A2C0, TOC };
  7. opd_s R_AddCmdDrawTextInternal_t = { 0x76A910, TOC };
  8. opd_s R_AddCmdDrawStretchPicInternal_t = { 0x076A3E8, TOC };
  9. dvar_t*(*Dvar_FindMalleableVar)(const char* LocalClient) = (dvar_t*(*)(const char*))&Dvar_FindMalleableVar_t;
  10. void(*R_AddCmdDrawTextInternal)(const char* text, int maxChars, void* font, float x, float y, float yScale, float xScale, float rotation, float* colors, int Style) = (void(*)(const char*, int, void*, float, float, float, float, float, float*, int))&R_AddCmdDrawTextInternal_t;
  11. void(*R_AddCmdDrawStretchPicInternal)(float x, float y, float w, float h, float s0, float t0, float s1, float t1, float* color, void *material) = (void(*)(float, float, float, float, float, float, float, float, float*, void*))&R_AddCmdDrawStretchPicInternal_t;
  12. bool(*Dvar_GetBool_f)(dvar_t* LocalClient) = (bool(*)(dvar_t*))&Dvar_GetBool_t;
  13. void*(*Material_RegisterHandle)(const char *name, int imageTrack, bool errorIfMissing, int waitTime) = (void*(*)(const char*, int, bool, int))&Material_RegisterHandle_t;
  14. void*(*R_RegisterFont)(const char * name, int imageTrack) = (void*(*)(const char*, int))&R_RegisterFont_t;
  15. opd_s DefCallback_t = { 0x462E34, TOC };
  16. void(*DefCallback)(uint64_t status, uint64_t param, void *userdata) = (void(*)(uint64_t, uint64_t, void *))&DefCallback_t;
  17. opd_s printfContentsPtr = { 0x3E4970 , TOC };
  18. int(*com_sprintf)(char* dest, int size, const char* fmt, ...) = (int(*)(char*, int, char const*, ...)) &printfContentsPtr;
  19.  
  20.  
  21. void DrawText(const char *Text, const char *FontName, float x, float y, float Scale, Color color)
  22. {
  23.     R_AddCmdDrawTextInternal(Text, 0x7FFFFFFF, R_RegisterFont(FontName, 0), x, y, Scale, Scale, 0, (float*)&color, 0);
  24. }
  25. void DrawShader(float X, float Y, float Width, float Height, Color color, const char *Material)
  26. {
  27.     R_AddCmdDrawStretchPicInternal(X, Y, Width, Height, 0, 0, 1, 1, (float*)&color, Material_RegisterHandle(Material, 0, 0, 0));
  28. }
  29.  
  30. void Menu_PaintAllStub(...)
  31. {
  32.     __asm("li %r3, 0x1;");
  33. }
  34.  
  35. bool Dvar_GetBool(const char *dvarName)
  36. {
  37.     if (Dvar_GetBool_f(Dvar_FindMalleableVar(dvarName))) return true;
  38. }
  39.  
  40. bool InGame()
  41. {
  42.     if (Dvar_GetBool("cl_ingame")) return true;
  43. }
  44.  
  45. ####CREDITS####SABOTAGE####
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement