Advertisement
Guest User

Untitled

a guest
Jan 30th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. /***
  2. *
  3. * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
  4. *
  5. * This product contains software technology licensed from Id
  6. * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
  7. * All Rights Reserved.
  8. *
  9. * Use, distribution, and modification of this source code and/or resulting
  10. * object code is restricted to non-commercial enhancements to products from
  11. * Valve LLC. All other use, distribution, or modification is prohibited
  12. * without written permission from Valve LLC.
  13. *
  14. ****/
  15. //=============================================================================
  16. // Overheat.cpp
  17. //
  18. // 30-01-2017
  19. //
  20. //=============================================================================
  21.  
  22.  
  23. #include "STDIO.H"
  24. #include "STDLIB.H"
  25. #include "MATH.H"
  26.  
  27. #include "hud.h"
  28. #include "cl_util.h"
  29. #include "parsemsg.h"
  30. #include <string.h>
  31.  
  32. #include "vgui_TeamFortressViewport.h"
  33.  
  34. DECLARE_MESSAGE(m_Overheat,Overheat)
  35.  
  36.  
  37.  
  38. //int giDmgHeight, giDmgWidth;
  39.  
  40. int CHudOverheat::Init(void)
  41. {
  42. HOOK_MESSAGE(Overheat);
  43. m_iHeat = 0;
  44. gHUD.AddHudElem(this);
  45. return 1;
  46. }
  47.  
  48. int CHudOverheat::VidInit(void)
  49. {
  50. m_hSprite = 0;
  51. return 1;
  52. }
  53.  
  54. int CHudOverheat:: MsgFunc_Overheat(const char *pszName, int iSize, void *pbuf )
  55. {
  56.  
  57. BEGIN_READ( pbuf, iSize );
  58.  
  59. m_iHeat= READ_BYTE();
  60.  
  61. return 1;
  62. }
  63.  
  64. int CHudOverheat::Draw(float flTime)
  65. {
  66. int r, g, b;
  67. int a = 0 ;//, x, y ;//,x1, x2, y1 ,xx,yy; x3; , x4 ,y2; x5 , x6, x7;//Para los demás Sprites
  68. int HealthWidth;
  69.  
  70. int w = ScreenWidth;
  71. int h = ScreenHeight;
  72.  
  73. //=============================================================
  74. // HUD Health Bar (c) Lord Draco .
  75. // Code based upon the PERFECT DARK MOD Source Code
  76. // Dibuja un rectángulo NEGRO en el borde inferior del HUD
  77. //=============================================================
  78. FillRGBA(w/2.46 , h/1.07, 240, 22, 0, 0, 0, 0);
  79. //=============================================================
  80.  
  81. if ( (gHUD.m_iHideHUDDisplay || gEngfuncs.IsSpectateOnly() ) )
  82.  
  83. return 1;
  84.  
  85. //GetPainColor( r, g, b );
  86. //ScaleColors(r, g, b, a );
  87.  
  88. if (m_iHeat <= 0)
  89. {
  90. gViewPort->HideScope1();
  91. gViewPort->HideScope();
  92. }
  93.  
  94. // Only draw health if we have the suit.
  95. if (gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)))
  96. {
  97. FillRGBA(w/2.46 , h/1.1, (2.4 * m_iHeat), 5, 255, 0, 0, 255);//ZWC OVERHEAT
  98. }
  99.  
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement