diff --git a/TileEngine/overhead map.cpp b/TileEngine/overhead map.cpp index c0bc55654..a5f797a21 100644 --- a/TileEngine/overhead map.cpp +++ b/TileEngine/overhead map.cpp @@ -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;