6 #ifndef _INC_cMapPatch_H
7 #define _INC_cMapPatch_H
13 #include "CMapChanSurface.h"
14 #include "CMapChanHeight.h"
43 return cFourCC(
'M',
'p',
'a',
't');
48 return((m_ChannelsLoaded & wChannel) ?
true :
false);
52 return((m_ChannelsDirty & wChannel) ?
true :
false);
58 m_ChannelsDirty &= ~wChannel;
63 bool isSkirtChild()
const;
67 StrLen_t GetNameFormat(
char* pszName,
bool bDir)
const;
89 #define PATCH_OVERLAP_DIV 4
121 pt.
x = m_ptUR.x / size;
122 pt.
y = m_ptUR.y / size;
150 bool isPointInPatch(
const cVector3f& vPt)
const;
156 rect.SetRectWH(m_ptUR.x, m_ptUR.y, size, size);
161 rect.SetRectWH((
float)m_ptUR.x, (
float)m_ptUR.y, (
float)size, (
float)size);
168 return m_pParentPatch;
206 bool SetHeightX(
float x,
float y,
MAP_METERf_t fHeight);
208 float GetNormalP(
float x,
float y,
cVector3f& vNorm);
215 return m_fWaterLevel;
237 virtual void UnloadXObject();
238 virtual HRESULT ReloadXObject();
248 static MAP_METERf_t HeightRandomFunc(
const float x,
const float y);
250 HRESULT HeightsImageWrite(
bool bCheckParent =
true);
251 bool HeightsImageLoad();
252 bool HeightsImageLock(
bool bWrite);
253 void HeightsImageUnlock();
255 void HeightsAddRandom(
float fScaler);
256 void HeightsGenerateRandom();
257 bool HeightsUpdateFromParent(
bool bDoSkirt,
bool bUpdate);
258 bool HeightsUpdateFromChildren(
bool bDoSkirt,
bool bUpdate);
259 bool HeightsUpdateChildren(
bool bDoSkirt,
bool bUpdate);
260 bool HeightsUpdateParent(
bool bDoSkirt,
bool bUpdate);
262 bool HeightsMakeSectorFromBlocks(
bool bDoSkirt =
true,
bool bUpdate =
false);
263 bool HeightsMakeBlockFromSector(
bool bDoSkirt =
true,
bool bUpdate =
false);
265 bool HeightsSkirtUpdate(
bool bAllOrNothing,
bool bChildren);
266 void HeightsSkirtCheck(
bool bChanges);
267 void HeightsOffset(
float fOffset,
bool bUpdate);
284 size_t SurfaceAllocateMap(
bool bInit);
290 return m_Surface.GetSurf(px, py);
303 return GetSurfacePtInt(x, y);
313 return SetSurfacePtInt(x, y, eSurfaceID);
333 HRESULT HeightsImageWriteJpg();
334 HRESULT HeightsImageUpdateJpg();
341 #define cMapPatchProp(a,b,c,d,e) P_##a,
349 #define cMapPatchMethod(a,b,c) M_##a,
351 #undef cMapPatchMethod
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYMAPDATA_LINK
Definition: GrayMapData.h:13
#define IS_INDEX_GOOD(i, q)
cast the (likely) int to unsigned to check for negatives.
Definition: Index.h:35
#define IS_INDEX_BAD(i, q)
cast the (likely) int to unsigned to check for negatives.
Definition: Index.h:34
float D3DVALUE
Definition: MathDX.h:18
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
DWORD D3DCOLOR
Stuff normally defined in windows.h or DirectX headers.
Definition: cColorRef.h:24
#define ASSERT(exp)
Definition: cDebugAssert.h:87
#define MAP_SCALE(lod)
integer Size of a patch's MAP_PATCH_POINTS (in meters (MAP_METERI_t))
Definition: cMapBase.h:45
#define MAP_SIZE(lod)
size of a patch (in meters (MAP_METERI_t))
Definition: cMapBase.h:46
#define MAP_PATCH_SIZE1
Definition: cMapChanHeight.h:40
cVector3f m_d3dOffset
offset for convert to d3d device.
Definition: cCoordSpace.h:28
Definition: cScriptContext.h:24
Definition: cScriptSection.h:25
Definition: cScriptableInterface.h:97
Definition: cVariant.h:26
TYPE x
Definition: cVecT.h:490
TYPE y
Definition: cVecT.h:490
TYPE m_z
Definition: cVecT.h:544
TYPE y
Definition: cVecT.h:545
TYPE z
Definition: cVecT.h:545
TYPE m_x
Definition: cVecT.h:544
TYPE m_y
Definition: cVecT.h:544
TYPE x
Definition: cVecT.h:545
Definition: cXObjDef.h:17
P_TYPE_
Definition: cXObjDef.h:30
M_TYPE_
Definition: cXObjDef.h:38
Definition: cXObject.h:78
Definition: cMapChanHeight.h:25
Definition: cMapChanSurface.h:17
Definition: cMapBase.h:188
Definition: cMapPatch.h:23
MAP_SURFACE_ID_t GetSurfacePt(MAP_METERI_t x, MAP_METERI_t y)
Definition: cMapPatch.h:296
void GetCenterPoint(cVector3f &vPt) const
Definition: cMapPatch.h:131
void WorldToPatch(_TYPE &x, _TYPE &y)
Definition: cMapPatch.h:317
bool isPointInPatch(MAP_METERI_t x, MAP_METERI_t y) const
Definition: cMapPatch.h:140
MAP_METERI_t get_SizeXY() const
Definition: cMapPatch.h:80
bool SetSurfacePt(MAP_METERI_t x, MAP_METERI_t y, MAP_SURFACE_ID_t eSurfaceID)
Definition: cMapPatch.h:306
MAP_CHANNEL_t m_ChannelsLoaded
Definition: cMapPatch.h:358
MAP_CHANNEL_t m_ChannelsDerived
Definition: cMapPatch.h:361
STDMETHOD_(cString, get_Name)() const
void clearChannelDirty(MAP_CHANNEL_t wChannel)
Definition: cMapPatch.h:56
MAP_HEIGHT_t GetH(MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y) const
Definition: cMapPatch.h:181
void GetURPoint(cVector3f &vPt) const
Definition: cMapPatch.h:124
void GetURPoint(cPoint3f &ptw) const
Definition: cMapPatch.h:102
MAP_SURFACE_ID_t GetSurfacePtInt(MAP_METERI_t px, MAP_METERI_t py)
Definition: cMapPatch.h:286
MAP_METERI_t get_ScaleXY() const
Definition: cMapPatch.h:74
CHEAPOBJECT_IMPL
Definition: cMapPatch.h:337
CMapChanHeight m_Height
MAP_CHANNEL_Height.
Definition: cMapPatch.h:363
cMapPatchPtr get_ParentPatch() const
Definition: cMapPatch.h:166
void GetPatchRect(cRectf &rect) const
Definition: cMapPatch.h:158
virtual HRESULT s_LoadStaticSection(cScriptSection *pScriptSection=nullptr)=0
MAP_HEIGHT_t * GetHPtr(MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y)
Definition: cMapPatch.h:173
@ M_QTY
Definition: cMapPatch.h:352
MAP_METERI_t get_URX() const
Definition: cMapPatch.h:91
@ P_QTY
Definition: cMapPatch.h:344
CSCRIPT_CLASS_DEF1(MapPatch, cXObjDef)
int m_iChildPatchesLoaded
Definition: cMapPatch.h:356
bool isChannelDirty(MAP_CHANNEL_t wChannel) const
Definition: cMapPatch.h:50
MAP_METERf_t get_WaterLevel() const
Definition: cMapPatch.h:213
MAP_METERf_t m_fWaterLevel
Definition: cMapPatch.h:369
bool isChannelLoaded(MAP_CHANNEL_t wChannel) const
Definition: cMapPatch.h:46
MAP_CHANNEL_t m_ChannelsDirty
Definition: cMapPatch.h:359
void GetURPPoint(cPoint2i &pt) const
Definition: cMapPatch.h:116
MAP_KEY_TYPE m_dwKeyCode
Set the map crypt key code for the octant given us by the server.
Definition: cMapPatch.h:366
void GetCenterPoint(cPoint3f &ptw) const
Definition: cMapPatch.h:109
bool SetH(MAP_PATCH_POINT_t x, MAP_PATCH_POINT_t y, MAP_HEIGHT_t h)
Definition: cMapPatch.h:191
virtual HRESULT UpdateChanges()
Definition: cMapPatch.h:274
virtual cMapBase * get_MapBase() const =0
CMapChanSurface m_Surface
MAP_CHANNEL_Surface.
Definition: cMapPatch.h:364
STDMETHOD_(XOBJTID_t, get_XObjTypeId)() const
Definition: cMapPatch.h:40
MAP_METERI_t get_URY() const
Definition: cMapPatch.h:96
void GetPatchRect(cRectI &rect) const
Definition: cMapPatch.h:152
MAP_CHANNEL_t m_ChannelsToLoad
Definition: cMapPatch.h:357
Definition: IScriptableObj.h:62
FOURCC XOBJTID_t
a unique FOURCC id for a type of XObject, 0=k_XOBJTID_NULL, MAKEFOURCC(a,b,c,d). Equiv to GUID for IU...
Definition: IXObject.h:42
interface const RECTQ_t & rect
Definition: cQuadtree.h:44
HASHCODE32_t UID_t
Sort of the same as a HASHCODE_t. not the same as UIDINDEX_t.
Definition: cUID.h:18
GINTERSECT_TYPE
Definition: cVecT.h:20
Definition: GrayMapData.cpp:12
WORD MAP_CHANNEL_t
Definition: cMapBase.h:103
int MAP_PATCH_POINT_t
this gives the number of samples in the heightmap file: 128 means a 129x129 file (include skirt pixel...
Definition: cMapBase.h:42
BYTE MAP_SURFACE_ID_t
Definition: cMapBase.h:114
@ MAP_CHANNEL_Height
the height map. MAP_HEIGHT_t
Definition: cMapBase.h:82
MAP_TERRAIN_TYPE
Definition: cMapBase.h:127
__DECL_IMPORT cCoordSpaceDX g_Coords
unsigned short MAP_HEIGHT_t
Definition: cMapBase.h:108
MAP_LOD_TYPE
Definition: cMapBase.h:27
@ MAP_LOD_SECTOR
Definition: cMapBase.h:33
UINT32 MAP_KEY_TYPE
Definition: cMapKeys.h:19
int MAP_METERI_t
integer meters for the location of a patch. MAP_METER_t
Definition: cMapKeys.h:16
float MAP_METERf_t
Height meters dont need double accuracy. MAP_METER_t.
Definition: cMapKeys.h:17
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22