Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright (C) 2014-2016 fastman92 <fastman92@gmail.com>, website: http://fastman92.ml
- * Licensed under the MIT License, see LICENSE at top level directory.
- *
- */
- #pragma once
- #include "Assertions.h"
- #include "CompressedVector.h"
- #include "CVector.h"
- #include <stdint.h>
- #ifdef IS_ARCHITECTURE_32_BIT
- namespace Game_GTASA
- {
- // path structures
- const int PATH_COORD_MULTIPLIER = 8;
- struct tStandardPathFileHeader
- {
- union
- {
- uint32_t numberOfPathNodes;
- uint32_t magicID; // magicID = 0xFFFFFFFF when different path format.
- };
- uint32_t numberOfPathVehicleNodes;
- uint32_t numberOfPathPedNodes;
- uint32_t numberOfNaviNodes;
- uint32_t numberOfLinks;
- };
- VALIDATE_SIZE(tStandardPathFileHeader, 20);
- // fastman92 path header
- struct tFastman92PathFileHeaderFirstPart
- {
- uint32_t magicID; // magicID = 0xFFFFFFFF
- uint32_t format; // should have a value "FM92"
- };
- VALIDATE_SIZE(tFastman92PathFileHeaderFirstPart, 8);
- #pragma warning ( push )
- #pragma warning ( disable: 4200 )
- struct tFastman92PathFileSecondPart
- {
- uint8_t sizeofNextValue;
- char value[]; // number of bytes depends on sizeofNextValue
- };
- #pragma warning ( pop )
- VALIDATE_SIZE(tFastman92PathFileSecondPart, 1);
- struct tFastman92PathFileHeaderThirdPart
- {
- uint32_t formatVersion; // should have a value "VER2"
- uint32_t numberOfPathNodes;
- uint32_t numberOfPathVehicleNodes;
- uint32_t numberOfPathPedNodes;
- uint32_t numberOfNaviNodes;
- uint32_t numberOfLinks;
- };
- VALIDATE_SIZE(tFastman92PathFileHeaderThirdPart, 24);
- //////////////////////
- #pragma pack(push, 1)
- struct CNodeAddress
- {
- uint16_t areaId;
- uint16_t nodeId;
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CNodeAddress, 4);
- #pragma pack(push, 1)
- struct CPathNode // standard GTA SA
- {
- CPathNode *m_pPrev;
- CPathNode **m_ppNext;
- CompressedVector m_posn;
- int16_t m_wSearchList;
- int16_t m_wConnectedNodesStartId; // ID into link array
- CNodeAddress m_nodeInfo;
- char m_nPathWidth;
- uint8_t m_nFloodID; // unused when fastman92 path format VER3 is used
- uint32_t m_dwFlags;
- // Returns number of links
- int GetNumberOfLinks() { return this -> m_dwFlags & 0xF; }
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CPathNode, 0x1C);
- // fastman92 path format VER2
- struct CPathNode_extended : public CPathNode
- {
- CompressedVector_extended m_extended_posn;
- // Sets the position in vector
- void GetExPosition(CVector& out)
- {
- out.x = (float)this->m_extended_posn.x / PATH_COORD_MULTIPLIER;
- out.y = (float)this->m_extended_posn.y / PATH_COORD_MULTIPLIER;
- out.z = (float)this -> m_extended_posn.z / PATH_COORD_MULTIPLIER;
- }
- };
- VALIDATE_SIZE(CPathNode_extended, 0x28);
- // fastman92 path format VER3
- #pragma pack(push, 1)
- struct CPathNode_extended2 : public CPathNode_extended
- {
- int16_t m_nExFloodID;
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CPathNode_extended2, 0x2A);
- #pragma pack(push, 1)
- struct CCarPathLink
- {
- int16_t posX; // unused when path limit hacked
- int16_t posY; // unused when path limit hacked
- CNodeAddress attachedPathNode;
- int8_t dirX;
- int8_t dirY;
- uint32_t m_dwFlags;
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CCarPathLink, 0xE);
- #pragma pack(push, 1)
- struct CCarPathLink_extended : public CCarPathLink
- {
- int32_t extended_posX;
- int32_t extended_posY;
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CCarPathLink_extended, 0x16);
- // other
- #pragma pack(push, 1)
- struct CForbiddenArea
- {
- float x1;
- float x2;
- float y1;
- float y2;
- float z1;
- float z2;
- char bEnable;
- char type;
- char _padding[2];
- };
- #pragma pack(pop)
- VALIDATE_SIZE(CForbiddenArea, 0x1C);
- // path type
- enum ePathType
- {
- PATH_TYPE_UNDEFINED,
- PATH_TYPE_VEHICLE,
- PATH_TYPE_PED
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement