mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fix assertion when the height is identical between vert0 and vert1
This commit is contained in:
parent
ac4b4266b4
commit
ff3c27ab20
2 changed files with 2 additions and 2 deletions
|
@ -144,7 +144,7 @@ static void R_InterpolateVert(terraTri_t *pTri, terrainVert_t *pVert)
|
|||
pMinHeight = (byte *)Q_min((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
|
||||
pMaxHeight = (byte *)Q_max((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
|
||||
pVert->pHgt = (byte *)(pMinHeight + ((pMaxHeight - pMinHeight) >> 1));
|
||||
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight);
|
||||
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight || pMinHeight == pMaxHeight);
|
||||
|
||||
// Calculate the average Z
|
||||
pVert->fHgtAvg = (float)(*pVert0->pHgt + *pVert1->pHgt);
|
||||
|
|
|
@ -141,7 +141,7 @@ static void R_InterpolateVert(terraTri_t *pTri, terrainVert_t *pVert)
|
|||
pMinHeight = (byte *)Q_min((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
|
||||
pMaxHeight = (byte *)Q_max((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
|
||||
pVert->pHgt = (byte *)(pMinHeight + ((pMaxHeight - pMinHeight) >> 1));
|
||||
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight);
|
||||
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight || pMinHeight == pMaxHeight);
|
||||
|
||||
// Calculate the average Z
|
||||
pVert->fHgtAvg = (float)(*pVert0->pHgt + *pVert1->pHgt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue