Fix: Opening up sector map could cause crashes.

Note: I am not really sure at what causes the error here, this is probably due to some recent changes in overheadmap. For the time, this fixes that, though someone with better knowledge should fix the real problem eventually.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6775 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-01-19 14:12:04 +00:00
parent e1b1712205
commit 4541487c3b
+57 -44
View File
@@ -1063,24 +1063,28 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
{
pTile = &( gSmTileDB[ pNode->usIndex ] );
sX = sTempPosX_S;
sY = sTempPosY_S;
if( gTileDatabase[ pNode->usIndex ].uiFlags & IGNORE_WORLD_HEIGHT )
// Flugente: uninformed hack
if ( pTile && pTile->vo )
{
sY -= sModifiedHeight;
sX = sTempPosX_S;
sY = sTempPosY_S;
if( gTileDatabase[ pNode->usIndex ].uiFlags & IGNORE_WORLD_HEIGHT )
{
sY -= sModifiedHeight;
}
else
{
sY -= sHeight;
}
sY += ( gsRenderHeight / 5 );
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
// RENDER!
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
}
else
{
sY -= sHeight;
}
sY += ( gsRenderHeight / 5 );
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
// RENDER!
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
}
}
pNode = pNode->pNext;
@@ -1092,21 +1096,26 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
if(usTileIndex >= 0 && usTileIndex < GRIDSIZE)//dnl ch82 081213
{
pTile = &( gSmTileDB[ pNode->usIndex ] );
sX = sTempPosX_S;
sY = sTempPosY_S - sHeight;
//dnl ch82 081213
sY = sTempPosY_S;
if(gTileDatabase[pNode->usIndex].uiFlags & IGNORE_WORLD_HEIGHT)
sY -= sModifiedHeight;
else
sY -= sHeight;
sY += ( gsRenderHeight / 5 );
// Flugente: uninformed hack
if ( pTile && pTile->vo )
{
sX = sTempPosX_S;
sY = sTempPosY_S - sHeight;
//dnl ch82 081213
sY = sTempPosY_S;
if(gTileDatabase[pNode->usIndex].uiFlags & IGNORE_WORLD_HEIGHT)
sY -= sModifiedHeight;
else
sY -= sHeight;
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
sY += ( gsRenderHeight / 5 );
// RENDER!
Blt8BPPDataTo16BPPBufferShadow((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
// RENDER!
Blt8BPPDataTo16BPPBufferShadow((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
}
}
pNode = pNode->pNext;
}
@@ -1121,24 +1130,28 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
{
pTile = &( gSmTileDB[ pNode->usIndex ] );
sX = sTempPosX_S;
sY = sTempPosY_S - (gTileDatabase[ pNode->usIndex ].sOffsetHeight/5);
if( gTileDatabase[ pNode->usIndex ].uiFlags & IGNORE_WORLD_HEIGHT )
// Flugente: uninformed hack
if ( pTile && pTile->vo )
{
sY -= sModifiedHeight;
sX = sTempPosX_S;
sY = sTempPosY_S - (gTileDatabase[ pNode->usIndex ].sOffsetHeight/5);
if( gTileDatabase[ pNode->usIndex ].uiFlags & IGNORE_WORLD_HEIGHT )
{
sY -= sModifiedHeight;
}
else
{
sY -= sHeight;
}
sY += ( gsRenderHeight / 5 );
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
// RENDER!
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
}
else
{
sY -= sHeight;
}
sY += ( gsRenderHeight / 5 );
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
// RENDER!
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
}
}
pNode = pNode->pNext;