| 1 | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ |
| 2 | /* If you are missing that file, acquire a complete release at teeworlds.com. */ |
| 3 | #ifndef GAME_CLIENT_COMPONENTS_ITEMS_H |
| 4 | #define GAME_CLIENT_COMPONENTS_ITEMS_H |
| 5 | |
| 6 | #include <base/color.h> |
| 7 | |
| 8 | #include <generated/protocol.h> |
| 9 | |
| 10 | #include <game/client/component.h> |
| 11 | |
| 12 | class CProjectileData; |
| 13 | class CLaserData; |
| 14 | |
| 15 | class CItems : public CComponent |
| 16 | { |
| 17 | void RenderProjectile(const CProjectileData *pCurrent, int ItemId); |
| 18 | void RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCurrent, bool IsPredicted, int Flags); |
| 19 | void RenderFlags(); |
| 20 | void RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent, const CNetObj_GameData *pPrevGameData, const CNetObj_GameData *pCurGameData); |
| 21 | void RenderLaser(const CLaserData *pCurrent, bool IsPredicted = false); |
| 22 | |
| 23 | int m_ItemsQuadContainerIndex; |
| 24 | |
| 25 | public: |
| 26 | int Sizeof() const override { return sizeof(*this); } |
| 27 | void OnRender() override; |
| 28 | void OnInit() override; |
| 29 | |
| 30 | void ReconstructSmokeTrail(const CProjectileData *pCurrent, int DestroyTick); |
| 31 | void RenderLaser(vec2 From, vec2 Pos, ColorRGBA OuterColor, ColorRGBA InnerColor, float TicksBody, float TicksHead, int Type) const; |
| 32 | |
| 33 | private: |
| 34 | int m_BlueFlagOffset; |
| 35 | int m_RedFlagOffset; |
| 36 | int m_PickupHealthOffset; |
| 37 | int m_PickupArmorOffset; |
| 38 | int m_aPickupWeaponOffset[NUM_WEAPONS]; |
| 39 | int m_PickupNinjaOffset; |
| 40 | int m_aPickupWeaponArmorOffset[4]; |
| 41 | int m_aProjectileOffset[NUM_WEAPONS]; |
| 42 | int m_aParticleSplatOffset[3]; |
| 43 | int m_DoorHeadOffset; |
| 44 | int m_PulleyHeadOffset; |
| 45 | int m_FreezeHeadOffset; |
| 46 | }; |
| 47 | |
| 48 | #endif |
| 49 | |