Added some Failsafe. Fixed a crash in the new game intro cinematic (when Boss of TFE die and Sam goes to the UFO) on the Pandora

This commit is contained in:
ptitSeb 2016-04-23 10:49:31 +02:00
parent 6bb2f81134
commit 16d6cb99fa

5
Sources/Engine/Rendering/RendASER.cpp Normal file → Executable file
View File

@ -34,7 +34,6 @@ void CRenderer::AddAddListToActiveList(INDEX iScanLine)
// allocate space in destination for sum of source and add // allocate space in destination for sum of source and add
INDEX ctActiveEdges = re_aaceActiveEdges.Count(); INDEX ctActiveEdges = re_aaceActiveEdges.Count();
re_aaceActiveEdgesTmp.Push(ctAddEdges+ctActiveEdges); re_aaceActiveEdgesTmp.Push(ctAddEdges+ctActiveEdges);
// check that the add list is sorted right // check that the add list is sorted right
#if ASER_EXTREME_CHECKING #if ASER_EXTREME_CHECKING
{ {
@ -66,18 +65,18 @@ void CRenderer::AddAddListToActiveList(INDEX iScanLine)
// start at begining of add list, source active list and destination active list // start at begining of add list, source active list and destination active list
LISTITER(CAddEdge, ade_lnInAdd) itadeAdd(lhAdd); LISTITER(CAddEdge, ade_lnInAdd) itadeAdd(lhAdd);
CActiveEdge *paceSrc = &re_aaceActiveEdges[0]; CActiveEdge *paceSrc = &re_aaceActiveEdges[0];
CActiveEdge *paceEnd = &re_aaceActiveEdges[re_aaceActiveEdges.Count()-1];
CActiveEdge *paceDst = &re_aaceActiveEdgesTmp[0]; CActiveEdge *paceDst = &re_aaceActiveEdgesTmp[0];
IFDEBUG(INDEX ctNewActive=0); IFDEBUG(INDEX ctNewActive=0);
IFDEBUG(INDEX ctOldActive1=0); IFDEBUG(INDEX ctOldActive1=0);
IFDEBUG(INDEX ctOldActive2=0); IFDEBUG(INDEX ctOldActive2=0);
// for each edge in add list // for each edge in add list
while(!itadeAdd.IsPastEnd()) { while(!itadeAdd.IsPastEnd()) {
CAddEdge &ade = *itadeAdd; CAddEdge &ade = *itadeAdd;
// while the edge in active list is left of the edge in add list // while the edge in active list is left of the edge in add list
while (paceSrc->ace_xI.slHolder < itadeAdd->ade_xI.slHolder) { while ((paceSrc->ace_xI.slHolder < ade.ade_xI.slHolder) && (paceSrc!=paceEnd)) {
// copy the active edge // copy the active edge
ASSERT(paceSrc<=&re_aaceActiveEdges[ctActiveEdges-1]); ASSERT(paceSrc<=&re_aaceActiveEdges[ctActiveEdges-1]);
*paceDst++=*paceSrc++; *paceDst++=*paceSrc++;