Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayMapData::cMapPatch Class Referenceabstract

#include <cMapPatch.h>

Inheritance diagram for GrayMapData::cMapPatch:
GrayLib::cXObjDef GrayLib::cXObject GrayLib::cScriptableObj IXObject Gray::cThreadLockableRef Gray::CObject Gray::cHeapObject IScriptableObj Gray::cRefBase Gray::cThreadLockStub Gray::IHeapObject IUnknown Gray::cLockableBase

Public Types

enum  P_TYPE_ { P_QTY }
 
enum  M_TYPE_ { M_QTY }
 
- Public Types inherited from GrayLib::cXObjDef
enum  P_TYPE_ { P_QTY }
 
enum  M_TYPE_ { M_QTY }
 
typedef cXObject CSCRIPTABLE_SUPER_t
 
- Public Types inherited from GrayLib::cXObject
enum  P_TYPE_ { P_QTY }
 
enum  M_TYPE_ { M_QTY }
 base methods that all objects have. More...
 

Public Member Functions

 cMapPatch (UID_t rid, cMapPatch *pParentLOD, MAP_METERI_t x, MAP_METERI_t y, MAP_LOD_TYPE eLod)
 
virtual ~cMapPatch (void)
 
virtual HRESULT s_LoadStaticSection (cScriptSection *pScriptSection=nullptr)=0
 
virtual cMapBaseget_MapBase () const =0
 
 STDMETHOD_ (XOBJTID_t, get_XObjTypeId)() const
 
bool isChannelLoaded (MAP_CHANNEL_t wChannel) const
 
bool isChannelDirty (MAP_CHANNEL_t wChannel) const
 
void addChannelLoaded (MAP_CHANNEL_t wChannel)
 
void addChannelDirty (MAP_CHANNEL_t wChannel)
 
void clearChannelDirty (MAP_CHANNEL_t wChannel)
 
void addChannelDirtyR (MAP_CHANNEL_t wChannel)
 
bool isSkirtChild () const
 
virtual HRESULT DisposeThis ()
 utility More...
 
 STDMETHOD_ (cString, get_Name)() const
 
StrLen_t GetNameFormat (char *pszName, bool bDir) const
 
cStringF GetFilePath (const FILECHAR_t *pszPostfix) const
 
cMapPatchPtr LoadPatchNeighbor (int dnx, int dny, MAP_CHANNEL_t uLoadChannels) const
 
MAP_METERI_t get_ScaleXY () const
 
MAP_METERI_t get_SizeXY () const
 
MAP_METERI_t get_URX () const
 
MAP_METERI_t get_URY () const
 
void GetURPoint (cPoint3f &ptw) const
 
void GetCenterPoint (cPoint3f &ptw) const
 
void GetURPPoint (cPoint2i &pt) const
 
void GetURPoint (cVector3f &vPt) const
 
void GetCenterPoint (cVector3f &vPt) const
 
bool isPointInPatch (MAP_METERI_t x, MAP_METERI_t y) const
 
bool isPointInPatch (const cVector3f &vPt) const
 
void GetPatchRect (cRectI &rect) const
 
void GetPatchRect (cRectf &rect) const
 
void CvtPatchToWorld (const cVector3f &vIn, cPoint3f &ptWOut) const
 
cMapPatchPtr get_ParentPatch () const
 
cMapPatchPtr GetChildPatch (int rx8, int ry8, MAP_CHANNEL_t uLoadFlags) const
 
MAP_HEIGHT_tGetHPtr (MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y)
 
MAP_HEIGHT_t GetH (MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y) const
 
bool SetH (MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y, MAP_HEIGHT_t h)
 
MAP_METERf_t GetHX (float x, float y)
 
bool SetHX (float x, float y, MAP_METERf_t fHeight)
 
MAP_METERf_t GetHeightX (float x, float y)
 
bool SetHeightX (float x, float y, MAP_METERf_t fHeight)
 
float GetNormalP (float x, float y, cVector3f &vNorm)
 
GINTERSECT_TYPE GetHeightRayContactSegment (const cPoint3f &ptW1, const cVector3f &vDir, cVector3f &vPos1, cVector3f &vPos2, float fMaxRange)
 
bool GetHeightRayContact2 (cVector3f &vContact, const cVector3f &vPos1, const cVector3f &vPos2)
 
MAP_METERf_t get_WaterLevel () const
 
virtual void put_WaterLevel (MAP_METERf_t fWaterLevel)
 
MAP_METERf_t GetWaterLevelX (float x, float y) const
 
MAP_TERRAIN_TYPE GetTerrainType (const cPoint3f &pt, MAP_METERf_t fCharHeight, cVector3f *pvNorm, MAP_METERf_t *pfGroundLevel=nullptr, MAP_METERf_t *pfWaterLevel=nullptr)
 
HRESULT s_Invoke_Save (const cVariant &vArgs, cVariant &vValRet, cScriptContext *pContext)
 
HRESULT s_Invoke_Reload (const cVariant &vArgs, cVariant &vValRet, cScriptContext *pContext)
 
HRESULT s_Invoke_HeightUpdateSector (const cVariant &vArgs, cVariant &vValRet, cScriptContext *pContext)
 
HRESULT s_Invoke_HeightChange (const cVariant &vArgs, cVariant &vValRet, cScriptContext *pContext)
 
HRESULT s_Invoke_HeightUpdateSkirt (const cVariant &vArgs, cVariant &vValRet, cScriptContext *pContext)
 
STDMETHOD() s_PropPut (const cScriptableProp *pProp, const cVariant &vVal)
 
STDMETHOD() s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet)
 
STDMETHOD() s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, cVariant &vValRet)
 
virtual HRESULT LoadXObject ()
 
virtual void UnloadXObject ()
 
virtual HRESULT ReloadXObject ()
 
virtual HRESULT SaveXObject ()
 
virtual HRESULT LoadChannels (MAP_CHANNEL_t uLoadFlags)
 
virtual void UnloadChannels (MAP_CHANNEL_t uLoadFlags)
 
virtual HRESULT WriteChannels (MAP_CHANNEL_t uWriteFlags, bool bCheckParent=true)
 
HRESULT HeightsImageWrite (bool bCheckParent=true)
 
bool HeightsImageLoad ()
 
bool HeightsImageLock (bool bWrite)
 
void HeightsImageUnlock ()
 
void HeightsAddRandom (float fScaler)
 
void HeightsGenerateRandom ()
 
bool HeightsUpdateFromParent (bool bDoSkirt, bool bUpdate)
 
bool HeightsUpdateFromChildren (bool bDoSkirt, bool bUpdate)
 
bool HeightsUpdateChildren (bool bDoSkirt, bool bUpdate)
 
bool HeightsUpdateParent (bool bDoSkirt, bool bUpdate)
 
bool HeightsMakeSectorFromBlocks (bool bDoSkirt=true, bool bUpdate=false)
 
bool HeightsMakeBlockFromSector (bool bDoSkirt=true, bool bUpdate=false)
 
bool HeightsSkirtUpdate (bool bAllOrNothing, bool bChildren)
 
void HeightsSkirtCheck (bool bChanges)
 
void HeightsOffset (float fOffset, bool bUpdate)
 
bool NormalMap_Build (D3DCOLOR normalMap[(128+1)][(128+1)])
 
STDMETHOD() s_WriteProps (IScriptableSetter &reg)
 
bool s_LoadPatch ()
 
virtual HRESULT UpdateChanges ()
 
HRESULT SurfaceMapLoad ()
 
HRESULT SurfaceMapWrite ()
 
size_t SurfaceAllocateMap (bool bInit)
 
MAP_SURFACE_ID_t GetSurfacePtInt (MAP_METERI_t px, MAP_METERI_t py)
 
bool SurfacePtNoUpdate (int px, int py, MAP_SURFACE_ID_t eSurfaceID)
 
bool SetSurfacePtInt (int px, int py, MAP_SURFACE_ID_t eSurfaceID)
 
MAP_SURFACE_ID_t GetSurfacePt (MAP_METERI_t x, MAP_METERI_t y)
 
bool SetSurfacePt (MAP_METERI_t x, MAP_METERI_t y, MAP_SURFACE_ID_t eSurfaceID)
 
template<class _TYPE >
void WorldToPatch (_TYPE &x, _TYPE &y)
 
 CSCRIPT_CLASS_DEF1 (MapPatch, cXObjDef)
 
- Public Member Functions inherited from GrayLib::cXObjDef
virtual cScriptableInterfaceDefPtr _stdcall get_ScriptInterfaceDef () const
 
 cXObjDef (UID_t rid, cAtomRef aSymName)
 
virtual ~cXObjDef ()
 
STDMETHOD() SetObjStateLoaded ()
 extra cleanup at the end of the load. More...
 
bool hasSymName () const noexcept
 Get the SYMNAME of the resource item. (Used for saving,scripting) may be number or name. More...
 
cAtomRef get_SymNameA () const
 
 STDMETHOD_ (cStringA, get_SymName)() const override
 
STDMETHOD() put_SymName (cAtomRef aSymName, bool bOverwrite=false) override
 
HRESULT put_SymName2 (cAtomRef aSymName)
 
 STDMETHOD_ (cString, get_Name)() const override
 
virtual cString get_Description () const
 
virtual void put_Description (cString sDescription)
 
virtual cString get_DescriptionFull () const
 
virtual bool isResourceLoaded () const
 
virtual void CopyXObject (const cXObjDef *pDef)
 
virtual int get_BaseRefCount () const override
 
STDMETHOD() s_PropPut (const cScriptableProp *pProp, const cVariant &vVal) override
 
STDMETHOD() s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet) override
 
STDMETHOD() s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) override
 
STDMETHOD() s_WriteProps (IScriptableSetter &reg) override
 
virtual size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const override
 allocs for all children. does NOT include sizeof(*this) More...
 
- Public Member Functions inherited from GrayLib::cXObject
 cXObject (UID_t nUID=cUID::k_CLEAR, cXObjDef *pBaseDef=nullptr)
 
virtual ~cXObject ()
 
virtual bool isValidCheck () const noexcept override
 
 STDMETHOD_ (XOBJTID_t, get_XObjTypeId)() const
 
const ATOMCHAR_tget_XObjTypeName () const
 
bool isValidUID () const noexcept
 
UID_t get_UIDValue () const noexcept
 
UID_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept override
 
void put_UIDValuePrivate (UID_t dwIndex)
 
 STDMETHOD_ (void, put_UIDValue)(UID_t dwIndex)
 
 STDMETHOD_ (cString, get_Name)() const override
 
STDMETHOD() put_Name (cString sName)
 
 STDMETHOD_ (cString, get_NameDeco)() const
 
 STDMETHOD_ (cStringA, get_SymName)() const override
 
STDMETHOD() put_SymName (cAtomRef aSymName, bool bOverwrite=false)
 
HRESULT put_SymName2 (cAtomRef aSymName)
 
cXObjDefget_BaseDef () const
 
virtual bool put_BaseDef (cXObjDef *pDef)
 
 STDMETHOD_ (cAtomRef, get_BaseSymNameA)() const
 shortcut for symbolic name for get_BaseDef() More...
 
virtual cRefPtr< cXObjectget_ContainerObject () const
 
virtual cVariant get_ContainerVar () const
 
STDMETHOD() put_ContainerVar (const cVariant &vVal)
 
bool isMyContainer (const cXObject *pObjParent) const
 
void InitObjState ()
 
XObjState_TYPE get_ObjState () const noexcept
 
bool put_ObjState (XObjState_TYPE eObjState)
 
bool isObjStateLoading () const noexcept
 
bool isObjStateLoading1 () const noexcept
 
bool isObjStateLoaded () const noexcept
 
bool isObjStateModified () const noexcept
 
bool isObjStateDisposed () const noexcept
 
bool isObjStateBad () const noexcept
 
STDMETHOD() SetObjStateLoaded ()
 extra cleanup at the end of the load. More...
 
void SetObjStateBad ()
 
void SetObjStateModified ()
 
void ClearObjStateModified ()
 
const cTimeIntget_TimeSaved () const noexcept
 
void put_TimeSaved (cTimeInt timeSaved)
 
void UpdateTimeSaved ()
 
virtual cVarTuplePtr FindTagA (cAtomRef aTagName) const
 extra Properties/Tags More...
 
cVarTuplePtr FindTag (const ATOMCHAR_t *pszTagName) const
 
void s_WritePropsTags (IScriptableSetter &Update)
 
STDMETHOD() s_PropPut (const cScriptableProp *pProp, const cVariant &vVal) override
 
STDMETHOD() s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet) override
 
STDMETHOD() s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) override
 
STDMETHOD() s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &rvValRet) override
 
STDMETHOD() s_TagPut (const ATOMCHAR_t *pszTagName, const cVariant &vValSet)
 
STDMETHOD() s_TagGet (const ATOMCHAR_t *pszTagName, OUT cVariant &vValRet)
 
STDMETHOD() s_LoadProps (IScriptableEnumerator &rProps)
 
STDMETHOD() s_EventSinkAdd (cXObjDef *pXObjDef, bool bRemove=false)
 
cStringA s_PropGetDumpStr (const cScriptableProp *pProp, XOBJ_DUMP_MASK_t uFlags=0)
 Enumerate methods and props. reflection/introspection. More...
 
HRESULT s_DumpKeys (cStreamOutput &rout, XOBJ_DUMP_MASK_t uFlags, const cScriptableProp *const *ppProps, ITERATE_t iQty)
 
HRESULT s_DumpHelp (cStreamOutput &rout, const cVariant &vArgs)
 
virtual XOBJ_WEIRD_t IsWeird () const
 
virtual XOBJ_WEIRD_t FixWeird ()
 
 IUNKNOWN_DISAMBIG_R (cThreadLockableRef)
 
STDMETHOD() QueryInterface (const IID &riid, void **ppvObject) override
 
- Public Member Functions inherited from GrayLib::cScriptableObj
virtual ~cScriptableObj ()
 
 STDMETHOD_ (cScriptableInterfaceDefPtr, get_ScriptInterfaceDef)() const
 
STDMETHOD() s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet) override
 
STDMETHOD() s_PropPut (const cScriptableProp *pProp, const cVariant &vVal) override
 
STDMETHOD() s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) override
 
const cScriptablePropFindPropStr (const ATOMCHAR_t *pszPropName) const
 
const cScriptableMethodFindMethodStr (const ATOMCHAR_t *pszPropName) const
 
HRESULT s_InvokeKey (const ATOMCHAR_t *pszMethodKey, const cVariant &vArgs, OUT cVariant &vValRet)
 
 STDMETHOD_ (cVariant, s_Exec)(const ATOMCHAR_t *pszMethodKey
 
STDMETHOD() s_GetEnum (ITERATE_t i, OUT cStringA &rsPropName, OUT cVariant &rvValRet) override
 
STDMETHOD() s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &rvValRet) override
 
STDMETHOD() s_Put (const ATOMCHAR_t *pszPropName, const cVariant &vValSet) override
 
void s_LoadPropsCommandLine (cAppArgs &args)
 
HRESULT s_LoadPropsBase (IScriptableEnumerator &rProps)
 
HRESULT s_LoadPropVar (const ATOMCHAR_t *pszPropName, const cVariant &vVal)
 
HRESULT s_WritePropNULL (IScriptableSetter &s, const cScriptableProp *pProp)
 
HRESULT s_WriteProp (IScriptableSetter &s, const cScriptableProp *pProp)
 
HRESULT s_WritePropsClass (IScriptableSetter &s, const cScriptableInterfaceDef *pClass)
 
HRESULT s_WritePropsArray (IScriptableSetter &s, const cScriptableProp *pProps, IScriptableObj *pDefaultSkip=nullptr)
 
STDMETHOD() s_WriteProps (IScriptableSetter &s)
 
 STDMETHOD_ (cVariant, s_Get)(const ATOMCHAR_t *pszPropName)
 
cVariant s_Get (const cScriptableProp &rProp)
 
 STDMETHOD_ (cString, s_GetStr)(const ATOMCHAR_t *pszPropName)
 
 STDMETHOD_ (float, s_GetFloat)(const ATOMCHAR_t *pszPropName)
 
STDMETHOD() GetTypeInfoCount (UINT *pctinfo)
 
- Public Member Functions inherited from Gray::cThreadLockableRef
 cThreadLockableRef (int iStaticRefCount=0) noexcept
 
virtual ~cThreadLockableRef ()
 
virtual void onThreadLockFail (TIMESYSD_t dwWaitMS)
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 
- Public Member Functions inherited from Gray::cThreadLockStub
THREADID_t get_ThreadLockOwner () const
 
- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 
- Public Member Functions inherited from Gray::cHeapObject
 cHeapObject ()
 
virtual ~cHeapObject ()
 
bool IsValidInsideN (INT_PTR index) const
 
bool IsValidInsidePtr (void const *pTest) const
 
virtual size_t GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const
 

Static Public Member Functions

static StrLen_t GRAYCALL GetNameByCoord (char *pszName, MAP_METERI_t iCoordX, MAP_METERI_t iCoordY, MAP_METERI_t iSize, bool bDir)
 
static MAP_TERRAIN_TYPE GRAYCALL GetTerrainType (MAP_METERf_t z, MAP_METERf_t fGroundLevel, MAP_METERf_t fWaterLevel, MAP_METERf_t fCharHeight)
 
static MAP_METERf_t HeightRandomFunc (const float x, const float y)
 
- Static Public Member Functions inherited from GrayLib::cXObjDef
static cAtomRef GRAYCALL MakeSymName (const ATOMCHAR_t *pszTypeName, ITERATE_t iEnum)
 
- Static Public Member Functions inherited from GrayLib::cScriptableObj
static HRESULT GRAYCALL CopyAllProps (IScriptableSetter *pObjDest, IScriptableEnumerator &rProps, int iStart=0)
 

Public Attributes

 CHEAPOBJECT_IMPL
 
int m_iChildPatchesLoaded
 
MAP_CHANNEL_t m_ChannelsToLoad
 
MAP_CHANNEL_t m_ChannelsLoaded
 
MAP_CHANNEL_t m_ChannelsDirty
 
MAP_CHANNEL_t m_ChannelsDerived
 
CMapChanHeight m_Height
 MAP_CHANNEL_Height. More...
 
CMapChanSurface m_Surface
 MAP_CHANNEL_Surface. More...
 
MAP_KEY_TYPE m_dwKeyCode
 Set the map crypt key code for the octant given us by the server. More...
 
- Public Attributes inherited from GrayLib::cXObjDef
 CHEAPOBJECT_IMPL
 
TIMESYS_t m_timeLastUsed
 system time when last used. for caching More...
 
- Public Attributes inherited from GrayLib::cXObject
cVarMap m_TagMap
 attach extra tags here. (e.g. properties that don't apply to all instances. ASSUME NO OVERLAP with defined props.) More...
 
- Public Attributes inherited from GrayLib::cScriptableObj
const cVariantvArgs = cVariant::k_VarNULL)
 

Static Public Attributes

static cScriptableProp sm_Props [P_QTY+1]
 
static cScriptableMethod sm_Methods [M_QTY+1]
 
- Static Public Attributes inherited from GrayLib::cXObjDef
static cScriptableInterfaceDef sm_ScriptInterfaceDef
 
static cScriptableProp sm_Props [P_QTY+1]
 
static cScriptableMethod sm_Methods [M_QTY+1]
 
- Static Public Attributes inherited from GrayLib::cXObject
static cScriptableInterfaceDef sm_ScriptInterfaceDef
 
static cScriptableProp sm_Props [P_QTY+1]
 
static cScriptableMethod sm_Methods [M_QTY+1]
 
static ITERATE_t sm_iLoadingCount = 0
 are we loading ? LoadXObject() reentrant ? More...
 

Protected Attributes

MAP_METERf_t m_fWaterLevel
 
- Protected Attributes inherited from GrayLib::cXObject
 CHEAPOBJECT_IMPL
 
cRefPtr< cXObjDefm_pBaseDef
 This XObject is based on a template of other XObject/XObjDef. overloads it's props via m_TagMap. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Gray::cLockableBase
 cLockableBase () noexcept
 
 ~cLockableBase ()
 
LONG get_LockCount () const
 
bool isLocked () const
 
void IncLockCount ()
 
LONG DecLockCount ()
 
void Lock ()
 
LONG Unlock ()
 
- Protected Member Functions inherited from Gray::cHeapObject
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 

Detailed Description

A variably sized square area of the map. AKA Chunk. The base map Patch class overloaded for the server, map editor and client size based on MAP_LOD_TYPE = (Zone (64K), Oct (8192), Sector (1024), Block (128)) Just load/save the patch data. Don't worry about rendering it here. The patch is part of the LOD of the map. It has no real properties of its own so is NOT cXObject based.

Member Enumeration Documentation

◆ M_TYPE_

Enumerator
M_QTY 

◆ P_TYPE_

Enumerator
P_QTY 

Constructor & Destructor Documentation

◆ cMapPatch()

GrayMapData::cMapPatch::cMapPatch ( UID_t  rid,
cMapPatch pParentLOD,
MAP_METERI_t  x,
MAP_METERI_t  y,
MAP_LOD_TYPE  eLod 
)

◆ ~cMapPatch()

GrayMapData::cMapPatch::~cMapPatch ( void  )
virtual

Member Function Documentation

◆ addChannelDirty()

void GrayMapData::cMapPatch::addChannelDirty ( MAP_CHANNEL_t  wChannel)

The data has changed for this patch. NOT recursive! wChannels = MAP_CHANNEL_Script

◆ addChannelDirtyR()

void GrayMapData::cMapPatch::addChannelDirtyR ( MAP_CHANNEL_t  wChannel)

The data has changed for this patch. propagate/recurse dirty up parent chain. Always regen parent from children! wChannels = MAP_CHANNEL_Script NOTE: My children should already be loaded ?

◆ addChannelLoaded()

void GrayMapData::cMapPatch::addChannelLoaded ( MAP_CHANNEL_t  wChannel)

◆ clearChannelDirty()

void GrayMapData::cMapPatch::clearChannelDirty ( MAP_CHANNEL_t  wChannel)
inline

◆ CSCRIPT_CLASS_DEF1()

GrayMapData::cMapPatch::CSCRIPT_CLASS_DEF1 ( MapPatch  ,
cXObjDef   
)

◆ CvtPatchToWorld()

void GrayMapData::cMapPatch::CvtPatchToWorld ( const cVector3f vIn,
cPoint3f ptWOut 
) const

Get world relative coords. vIn = patch relative patch units. 0-128

◆ DisposeThis()

HRESULT GrayMapData::cMapPatch::DisposeThis ( void  )
virtual

utility

detach my children etc.

Pre-destructor cleanup things can be done since virtuals don't work in destructors.

Note
since this is reference counted it should be deleted in onFinalRelease()

Destroy this object even though there may be references to it. indicate to anyone who looks that this is a deleted object ? Pre-destructor cleanup things can be done since virtuals don't work in destructors.

Note
since this is reference counted it is actually deleted in onFinalRelease()
This is similar to the .NET Dispose() function DEBUG_CHECK( get_ObjState() == XObjState_Disposing );

Reimplemented from GrayLib::cXObjDef.

◆ get_MapBase()

virtual cMapBase* GrayMapData::cMapPatch::get_MapBase ( ) const
pure virtual

◆ get_ParentPatch()

cMapPatchPtr GrayMapData::cMapPatch::get_ParentPatch ( ) const
inline

◆ get_ScaleXY()

MAP_METERI_t GrayMapData::cMapPatch::get_ScaleXY ( ) const
inline

◆ get_SizeXY()

MAP_METERI_t GrayMapData::cMapPatch::get_SizeXY ( ) const
inline

The size scale of this patch in world coords. (meters across patch)

Returns
MAP_SIZE(MAP_LOD_OCTANT), MAP_SIZE(MAP_LOD_SECTOR), or MAP_SIZE(MAP_LOD_BLOCK)

◆ get_URX()

MAP_METERI_t GrayMapData::cMapPatch::get_URX ( ) const
inline

Get Upper right X in world meters.

◆ get_URY()

MAP_METERI_t GrayMapData::cMapPatch::get_URY ( ) const
inline

Get Upper right Y in world meters.

◆ get_WaterLevel()

MAP_METERf_t GrayMapData::cMapPatch::get_WaterLevel ( ) const
inline

◆ GetCenterPoint() [1/2]

void GrayMapData::cMapPatch::GetCenterPoint ( cPoint3f ptw) const
inline

◆ GetCenterPoint() [2/2]

void GrayMapData::cMapPatch::GetCenterPoint ( cVector3f vPt) const
inline

◆ GetChildPatch()

cMapPatchPtr GrayMapData::cMapPatch::GetChildPatch ( int  rx8,
int  ry8,
MAP_CHANNEL_t  uLoadFlags 
) const

If this is a sector, get my child (if loaded) ARGS: indexx,indexy = child index = 0-7

◆ GetFilePath()

cStringF GrayMapData::cMapPatch::GetFilePath ( const FILECHAR_t pszPostfix) const

Get the cMapPatch file full path. For all resource files, scripts, etc. pszPostfix = MAP_CHANNEL_TYPE_ h=ground height (blocks and sectors) o=objects (blocks and sectors) t=ground textures n=ground normals (Sectors only) s=surface types

◆ GetH()

MAP_HEIGHT_t GrayMapData::cMapPatch::GetH ( MAP_PATCH_POINT_t  x,
MAP_PATCH_POINT_t  y 
) const
inline

◆ GetHeightRayContact2()

bool GrayMapData::cMapPatch::GetHeightRayContact2 ( cVector3f vContact,
const cVector3f vPos1,
const cVector3f vPos2 
)

Return the contact point on the ground, between vPos1 and vPos2 Input and Result are in patch coord

  • vPos1,vPos2
    Returns
    vContact = patch relative patch coords.

◆ GetHeightRayContactSegment()

GINTERSECT_TYPE GrayMapData::cMapPatch::GetHeightRayContactSegment ( const cPoint3f ptW1,
const cVector3f vDir,
cVector3f vPos1,
cVector3f vPos2,
float  fMaxRange 
)

Starting from vPos1 above ground, in the direction of vDir, Input and Result are in patch coord

  • ptW1 = start (world units) vDir = vector step.
    Returns
    false = not in patch vPos1,vPos2 = retrieve the 2 adjacent points that are one above ground, one below ground relative to the patch. in patch coords.
    Note
    This is a terrible technique. ??? Some sort of binary search would be much better !? or make each meter a bbox? and use cBounds3f::TestRay
    Get patch relative coords.

◆ GetHeightX()

MAP_METERf_t GrayMapData::cMapPatch::GetHeightX ( float  x,
float  y 
)

Get Extrapolated height for point in the meter. Should be an average or the closest meter heights.

  • x,y = world coords. (meters)
    Note
    Blocks are more accurate than Sectors !
    Returns
    height in meters

◆ GetHPtr()

MAP_HEIGHT_t* GrayMapData::cMapPatch::GetHPtr ( MAP_PATCH_POINT_t  x,
MAP_PATCH_POINT_t  y 
)
inline

◆ GetHX()

MAP_METERf_t GrayMapData::cMapPatch::GetHX ( float  x,
float  y 
)

Get Extrapolated height for point in the meter. Should be an average or the closest meter heights.

  • x,y = world coords relative to patch. (meters)
    Note
    Blocks are more accurate than Sectors !
    Returns
    The extrapolated height at the point. in MAP_HEIGHT_t = 0 to 0xFFFF

◆ GetNameByCoord()

StrLen_t GrayMapData::cMapPatch::GetNameByCoord ( char *  pszName,
MAP_METERI_t  iCoordX,
MAP_METERI_t  iCoordY,
MAP_METERI_t  iSize,
bool  bDir 
)
static

Get the path and file name of some arbitrary patch. Name=ZOSB-ZOSB*.EXT , XXXX-YYYY*.EXT

  • pszName = output string. MAX SIZE = 64 iCoordX, int iCoordY = coords in world meters. need not be properly aligned iScale = 1,8,64,8*64 = patch scale. (height points per meter)
    Returns
    length of the string.

◆ GetNameFormat()

StrLen_t GrayMapData::cMapPatch::GetNameFormat ( char *  pszName,
bool  bDir 
) const

Get the name for the relative path and file name for the patch files.

Returns
length of the string. StrT::k_LEN_MAX_KEY

◆ GetNormalP()

float GrayMapData::cMapPatch::GetNormalP ( float  x,
float  y,
cVector3f vNorm 
)

MAP_CHANNEL_Normal

  • x,y = patch coords (0-MAP_PATCH_POINTS) (128)
    Returns
    height at point. * MAP_HEIGHT_SCALE vNormRet = the normal at this point. (-1 to +1, normalized)

◆ GetPatchRect() [1/2]

void GrayMapData::cMapPatch::GetPatchRect ( cRectf rect) const
inline

◆ GetPatchRect() [2/2]

void GrayMapData::cMapPatch::GetPatchRect ( cRectI rect) const
inline

◆ GetSurfacePt()

MAP_SURFACE_ID_t GrayMapData::cMapPatch::GetSurfacePt ( MAP_METERI_t  x,
MAP_METERI_t  y 
)
inline

◆ GetSurfacePtInt()

MAP_SURFACE_ID_t GrayMapData::cMapPatch::GetSurfacePtInt ( MAP_METERI_t  px,
MAP_METERI_t  py 
)
inline

◆ GetTerrainType() [1/2]

MAP_TERRAIN_TYPE GrayMapData::cMapPatch::GetTerrainType ( const cPoint3f pt,
MAP_METERf_t  fCharHeight,
cVector3f pvNorm,
MAP_METERf_t pfGroundLevel = nullptr,
MAP_METERf_t pfWaterLevel = nullptr 
)
  • fCharHeight = my head height so i can tell if I'm underwater or not. pt = world coords. (meters) pt.m_z = MAP_MIN_Z; // trick to get the current ground height. pvNorm = only set if I'm near the ground.
    Note
    this cannot tell the difference between MAP_TERRAIN_UnderGround and MAP_TERRAIN_BURIED. need objects for that.

◆ GetTerrainType() [2/2]

MAP_TERRAIN_TYPE GrayMapData::cMapPatch::GetTerrainType ( MAP_METERf_t  z,
MAP_METERf_t  fGroundLevel,
MAP_METERf_t  fWaterLevel,
MAP_METERf_t  fCharHeight 
)
static

◆ GetURPoint() [1/2]

void GrayMapData::cMapPatch::GetURPoint ( cPoint3f ptw) const
inline

◆ GetURPoint() [2/2]

void GrayMapData::cMapPatch::GetURPoint ( cVector3f vPt) const
inline

◆ GetURPPoint()

void GrayMapData::cMapPatch::GetURPPoint ( cPoint2i pt) const
inline

◆ GetWaterLevelX()

MAP_METERf_t GrayMapData::cMapPatch::GetWaterLevelX ( float  x,
float  y 
) const

get the default water level at any given point. extrapolated. ARGS: x,y, in world meters

◆ HeightRandomFunc()

MAP_METERf_t GrayMapData::cMapPatch::HeightRandomFunc ( const float  x,
const float  y 
)
static

◆ HeightsAddRandom()

void GrayMapData::cMapPatch::HeightsAddRandom ( float  fScaler)

◆ HeightsGenerateRandom()

void GrayMapData::cMapPatch::HeightsGenerateRandom ( )

◆ HeightsImageLoad()

bool GrayMapData::cMapPatch::HeightsImageLoad ( )

◆ HeightsImageLock()

bool GrayMapData::cMapPatch::HeightsImageLock ( bool  bWrite)

Get data from the JPG.

Returns
false = can't get data pointer.

◆ HeightsImageUnlock()

void GrayMapData::cMapPatch::HeightsImageUnlock ( )

◆ HeightsImageWrite()

HRESULT GrayMapData::cMapPatch::HeightsImageWrite ( bool  bCheckParent = true)

◆ HeightsMakeBlockFromSector()

bool GrayMapData::cMapPatch::HeightsMakeBlockFromSector ( bool  bDoSkirt = true,
bool  bUpdate = false 
)

◆ HeightsMakeSectorFromBlocks()

bool GrayMapData::cMapPatch::HeightsMakeSectorFromBlocks ( bool  bDoSkirt = true,
bool  bUpdate = false 
)

◆ HeightsOffset()

void GrayMapData::cMapPatch::HeightsOffset ( float  fOffset,
bool  bUpdate 
)

◆ HeightsSkirtCheck()

void GrayMapData::cMapPatch::HeightsSkirtCheck ( bool  bChanges)

◆ HeightsSkirtUpdate()

bool GrayMapData::cMapPatch::HeightsSkirtUpdate ( bool  bAllOrNothing,
bool  bChildren 
)

Update the 129x129 rows of the skirt border overlap from my peers

  • bChildren = update my children as well ?
    Note
    some of the borders will not update. if the border patch is out of bounds! we need a mechanism to come back later and fix that.
    Returns
    true = changes.

◆ HeightsUpdateChildren()

bool GrayMapData::cMapPatch::HeightsUpdateChildren ( bool  bDoSkirt,
bool  bUpdate 
)

◆ HeightsUpdateFromChildren()

bool GrayMapData::cMapPatch::HeightsUpdateFromChildren ( bool  bDoSkirt,
bool  bUpdate 
)

◆ HeightsUpdateFromParent()

bool GrayMapData::cMapPatch::HeightsUpdateFromParent ( bool  bDoSkirt,
bool  bUpdate 
)

◆ HeightsUpdateParent()

bool GrayMapData::cMapPatch::HeightsUpdateParent ( bool  bDoSkirt,
bool  bUpdate 
)

◆ isChannelDirty()

bool GrayMapData::cMapPatch::isChannelDirty ( MAP_CHANNEL_t  wChannel) const
inline

◆ isChannelLoaded()

bool GrayMapData::cMapPatch::isChannelLoaded ( MAP_CHANNEL_t  wChannel) const
inline

◆ isPointInPatch() [1/2]

bool GrayMapData::cMapPatch::isPointInPatch ( const cVector3f vPt) const

vPt = World D3D coords.

◆ isPointInPatch() [2/2]

bool GrayMapData::cMapPatch::isPointInPatch ( MAP_METERI_t  x,
MAP_METERI_t  y 
) const
inline

x,y = in world meters.

◆ isSkirtChild()

bool GrayMapData::cMapPatch::isSkirtChild ( ) const

is this patch the bottom/right border/skirt of its parent? i.e. last sector in the octant ?

◆ LoadChannels()

HRESULT GrayMapData::cMapPatch::LoadChannels ( MAP_CHANNEL_t  uLoadFlags)
virtual

◆ LoadPatchNeighbor()

cMapPatchPtr GrayMapData::cMapPatch::LoadPatchNeighbor ( int  dnx,
int  dny,
MAP_CHANNEL_t  uLoadChannels 
) const

Load my neighbor for updating height skirts.

◆ LoadXObject()

HRESULT GrayMapData::cMapPatch::LoadXObject ( )
virtual

Reimplemented from GrayLib::cXObjDef.

◆ NormalMap_Build()

bool GrayMapData::cMapPatch::NormalMap_Build ( D3DCOLOR  normalMap[(128+1)][(128+1)])

◆ put_WaterLevel()

void GrayMapData::cMapPatch::put_WaterLevel ( MAP_METERf_t  fWaterLevel)
virtual

Set this for all my children as well? NOTE: this is saved in the script! MAP_CHANNEL_Script

◆ ReloadXObject()

HRESULT GrayMapData::cMapPatch::ReloadXObject ( )
virtual

Reimplemented from GrayLib::cXObjDef.

◆ s_Invoke()

HRESULT GrayMapData::cMapPatch::s_Invoke ( const cScriptableMethod pMethod,
const cVariant vArgs,
cVariant vValRet 
)

◆ s_Invoke_HeightChange()

HRESULT GrayMapData::cMapPatch::s_Invoke_HeightChange ( const cVariant vArgs,
cVariant vValRet,
cScriptContext pContext 
)

◆ s_Invoke_HeightUpdateSector()

HRESULT GrayMapData::cMapPatch::s_Invoke_HeightUpdateSector ( const cVariant vArgs,
cVariant vValRet,
cScriptContext pContext 
)

◆ s_Invoke_HeightUpdateSkirt()

HRESULT GrayMapData::cMapPatch::s_Invoke_HeightUpdateSkirt ( const cVariant vArgs,
cVariant vValRet,
cScriptContext pContext 
)

◆ s_Invoke_Reload()

HRESULT GrayMapData::cMapPatch::s_Invoke_Reload ( const cVariant vArgs,
cVariant vValRet,
cScriptContext pContext 
)

◆ s_Invoke_Save()

HRESULT GrayMapData::cMapPatch::s_Invoke_Save ( const cVariant vArgs,
cVariant vValRet,
cScriptContext pContext 
)

◆ s_LoadPatch()

bool GrayMapData::cMapPatch::s_LoadPatch ( )

MAP_CHANNEL_Script

Note
similar to LoadXObjPack()

◆ s_LoadStaticSection()

virtual HRESULT GrayMapData::cMapPatch::s_LoadStaticSection ( cScriptSection pScriptSection = nullptr)
pure virtual

◆ s_PropGet()

HRESULT GrayMapData::cMapPatch::s_PropGet ( const cScriptableProp pProp,
OUT cVariant vValRet 
)

◆ s_PropPut()

HRESULT GrayMapData::cMapPatch::s_PropPut ( const cScriptableProp pProp,
const cVariant vVal 
)

◆ s_WriteProps()

HRESULT GrayMapData::cMapPatch::s_WriteProps ( IScriptableSetter reg)

◆ SaveXObject()

HRESULT GrayMapData::cMapPatch::SaveXObject ( )
virtual

Assume dirty Save the RAW height map for this patch if it has changed.

Reimplemented from GrayLib::cXObjDef.

◆ SetH()

bool GrayMapData::cMapPatch::SetH ( MAP_PATCH_POINT_t  x,
MAP_PATCH_POINT_t  y,
MAP_HEIGHT_t  h 
)
inline

◆ SetHeightX()

bool GrayMapData::cMapPatch::SetHeightX ( float  x,
float  y,
MAP_METERf_t  fHeight 
)

◆ SetHX()

bool GrayMapData::cMapPatch::SetHX ( float  x,
float  y,
MAP_METERf_t  fHeight 
)

◆ SetSurfacePt()

bool GrayMapData::cMapPatch::SetSurfacePt ( MAP_METERI_t  x,
MAP_METERI_t  y,
MAP_SURFACE_ID_t  eSurfaceID 
)
inline

◆ SetSurfacePtInt()

bool GrayMapData::cMapPatch::SetSurfacePtInt ( int  px,
int  py,
MAP_SURFACE_ID_t  eSurfaceID 
)

◆ STDMETHOD_() [1/2]

GrayMapData::cMapPatch::STDMETHOD_ ( cString  ,
get_Name   
) const

◆ STDMETHOD_() [2/2]

GrayMapData::cMapPatch::STDMETHOD_ ( XOBJTID_t  ,
get_XObjTypeId   
) const
inline

◆ SurfaceAllocateMap()

size_t GrayMapData::cMapPatch::SurfaceAllocateMap ( bool  bInit)
Returns
Qty/Size of MAP_SURFACE_ID_t

◆ SurfaceMapLoad()

HRESULT GrayMapData::cMapPatch::SurfaceMapLoad ( )

◆ SurfaceMapWrite()

HRESULT GrayMapData::cMapPatch::SurfaceMapWrite ( )

◆ SurfacePtNoUpdate()

bool GrayMapData::cMapPatch::SurfacePtNoUpdate ( int  px,
int  py,
MAP_SURFACE_ID_t  eSurfaceID 
)

◆ UnloadChannels()

void GrayMapData::cMapPatch::UnloadChannels ( MAP_CHANNEL_t  uLoadFlags)
virtual

◆ UnloadXObject()

void GrayMapData::cMapPatch::UnloadXObject ( )
virtual

Reimplemented from GrayLib::cXObjDef.

◆ UpdateChanges()

virtual HRESULT GrayMapData::cMapPatch::UpdateChanges ( )
inlinevirtual

◆ WorldToPatch()

template<class _TYPE >
void GrayMapData::cMapPatch::WorldToPatch ( _TYPE &  x,
_TYPE &  y 
)
inline

convert world coords to patch local coords. _TYPE for int or float precision.

◆ WriteChannels()

HRESULT GrayMapData::cMapPatch::WriteChannels ( MAP_CHANNEL_t  uWriteFlags,
bool  bCheckParent = true 
)
virtual

Member Data Documentation

◆ CHEAPOBJECT_IMPL

GrayMapData::cMapPatch::CHEAPOBJECT_IMPL

◆ m_ChannelsDerived

MAP_CHANNEL_t GrayMapData::cMapPatch::m_ChannelsDerived

◆ m_ChannelsDirty

MAP_CHANNEL_t GrayMapData::cMapPatch::m_ChannelsDirty

◆ m_ChannelsLoaded

MAP_CHANNEL_t GrayMapData::cMapPatch::m_ChannelsLoaded

◆ m_ChannelsToLoad

MAP_CHANNEL_t GrayMapData::cMapPatch::m_ChannelsToLoad

◆ m_dwKeyCode

MAP_KEY_TYPE GrayMapData::cMapPatch::m_dwKeyCode

Set the map crypt key code for the octant given us by the server.

◆ m_fWaterLevel

MAP_METERf_t GrayMapData::cMapPatch::m_fWaterLevel
protected

◆ m_Height

CMapChanHeight GrayMapData::cMapPatch::m_Height

MAP_CHANNEL_Height.

◆ m_iChildPatchesLoaded

int GrayMapData::cMapPatch::m_iChildPatchesLoaded

◆ m_Surface

CMapChanSurface GrayMapData::cMapPatch::m_Surface

MAP_CHANNEL_Surface.

◆ sm_Methods

cScriptableMethod GrayMapData::cMapPatch::sm_Methods
static
Initial value:
=
{
#define cMapPatchMethod(a,b,c)
}
#define CSCRIPT_PROP_END
Definition: cScriptableInterface.h:264

◆ sm_Props

cScriptableProp GrayMapData::cMapPatch::sm_Props
static
Initial value:
=
{
#define cMapPatchProp(a,b,c,d,e)
}

The documentation for this class was generated from the following files: