|
From: Vincent H. <ya...@us...> - 2005-06-26 21:56:59
|
Update of /cvsroot/twin-e/twin-e/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1638/src Modified Files: fullRedraw.c renderer.c Log Message: various fix Index: renderer.c =================================================================== RCS file: /cvsroot/twin-e/twin-e/src/renderer.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** renderer.c 26 Jun 2005 18:51:57 -0000 1.22 --- renderer.c 26 Jun 2005 21:56:49 -0000 1.23 *************** *** 704,708 **** width = - width; ! drawLine(x-width/2,currentLine + y, x+width/2, currentLine+y, color); } } --- 704,708 ---- width = - width; ! drawLine(x-width,currentLine + y, x+width, currentLine+y, color); } } *************** *** 1138,1141 **** --- 1138,1143 ---- } + circleParam3+=3; + if(circleParam4 + circleParam3 > renderRight) renderRight = circleParam4 + circleParam3; *************** *** 1150,1153 **** --- 1152,1157 ---- renderTop = circleParam5 - circleParam3; + circleParam3-=3; + circle_fill(circleParam4, circleParam5, circleParam3, circleParam1); /*prepareCircle(circleParam3*/ *************** *** 1204,1207 **** --- 1208,1214 ---- return;*/ + if(vbottom >= 480) + return; + out = frontVideoBuffer + 640*vtop; *************** *** 1238,1241 **** --- 1245,1249 ---- for(j = start; j < hsize+start; j++) { + assert(out+j < frontVideoBuffer + 640*480); if(j>=0 && j<640) out[j] = color; *************** *** 1282,1285 **** --- 1290,1294 ---- if(j>=0 && j<640) { + assert(out+j < frontVideoBuffer + 640*480); out[j] = start&0xFF; } *************** *** 1317,1320 **** --- 1326,1330 ---- if(j>=0&&j<640) { + assert(out+j < frontVideoBuffer + 640*480); out[j] = color; } *************** *** 1359,1362 **** --- 1369,1373 ---- if(ax ^ bh) { + assert(out2 < frontVideoBuffer + 640*480); out2++; } *************** *** 1364,1367 **** --- 1375,1379 ---- for (j = 0; j < hsize; j++) { + assert(out2 < frontVideoBuffer + 640*480); *(out2) = (unsigned char)color; out2+=2; *************** *** 1405,1408 **** --- 1417,1421 ---- if (hsize == 0) { + assert(out2 < frontVideoBuffer + 640*480); if(start>=0 && start <640) *out2 = ((startColor + stopColor) / 2)>>8; // moyenne des 2 couleurs *************** *** 1412,1418 **** --- 1425,1433 ---- if (hsize == 1) { + assert(out2 + 1< frontVideoBuffer + 640*480); if(start>=-1 && start <640-1) *(out2 + 1) = stopColor>>8; + assert(out2 < frontVideoBuffer + 640*480); if(start>=0 && start <640) *(out2) = startColor>>8; *************** *** 1420,1427 **** --- 1435,1447 ---- else if (hsize == 2) { + assert(out2 + 2< frontVideoBuffer + 640*480); if(start>=-2 && start<640-2) *(out2 + 2) = stopColor>>8; + + assert(out2 + 1< frontVideoBuffer + 640*480); if(start>=-1 && start<640-1) *(out2 + 1) = ((startColor + stopColor) / 2)>>8; + + assert(out2 < frontVideoBuffer + 640*480); if(start>=0 && start<640) *(out2) = startColor>>8; *************** *** 1436,1439 **** --- 1456,1460 ---- { hsize/=2; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2)=startColor>>8; *************** *** 1449,1452 **** --- 1470,1474 ---- do { + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2)=startColor>>8; *************** *** 1455,1458 **** --- 1477,1481 ---- startColor+=colorSize; + assert(out2 + 1< frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2+1)=startColor>>8; *************** *** 1496,1499 **** --- 1519,1523 ---- if(hsize==0) { + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2)=(unsigned char)(((startColor + stopColor)/2)>>8); *************** *** 1510,1513 **** --- 1534,1538 ---- currentColor&=0xFF; currentColor+=startColor; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2) = currentColor>>8; *************** *** 1517,1520 **** --- 1542,1546 ---- currentColor +=startColor; currentXPos++; + assert(out2+1 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2+1) = currentColor>>8; *************** *** 1530,1533 **** --- 1556,1560 ---- currentColor = ((currentColor & (0xFF00)) | ((((currentColor & 0xFF) << (hsize & 0xFF))) & 0xFF)); currentColor +=startColor; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2) = currentColor>>8; *************** *** 1540,1543 **** --- 1567,1571 ---- currentColor+=startColor; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2) = currentColor>>8; *************** *** 1549,1552 **** --- 1577,1581 ---- currentXPos++; + assert(out2 +1< frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2+1) = currentColor>>8; *************** *** 1565,1568 **** --- 1594,1598 ---- currentColor = ((currentColor & (0xFF00)) | ((((currentColor & 0xFF) << (hsize & 0xFF))) & 0xFF)); currentColor +=startColor; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2) = currentColor>>8; *************** *** 1579,1582 **** --- 1609,1613 ---- currentColor&=0xFF; currentColor+=startColor; + assert(out2 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2) = currentColor>>8; *************** *** 1586,1589 **** --- 1617,1621 ---- currentColor = ((currentColor & (0xFF00)) | ((((currentColor & 0xFF) << (hsize & 0xFF))) & 0xFF)); currentColor +=startColor; + assert(out2+1 < frontVideoBuffer + 640*480); if(currentXPos>=0 && currentXPos<640) *(out2+1) = currentColor>>8; Index: fullRedraw.c =================================================================== RCS file: /cvsroot/twin-e/twin-e/src/fullRedraw.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** fullRedraw.c 26 Jun 2005 18:51:57 -0000 1.58 --- fullRedraw.c 26 Jun 2005 21:56:32 -0000 1.59 *************** *** 369,372 **** --- 369,384 ---- #endif + if(renderLeft<0) + renderLeft = 0; + + if(renderTop<0) + renderTop = 0; + + if(renderRight >= 640) + renderRight = 639; + + if(renderBottom >= 480) + renderBottom = 479; + SetClip(renderLeft, renderTop, renderRight,renderBottom); *************** *** 605,608 **** --- 617,632 ---- AffObjetIso(drawList[arg_1E].X - cameraX, drawList[arg_1E].Y - cameraZ, drawList[arg_1E].Z - cameraY, 0, 0, 0, flagModelPtr); + if(renderLeft<0) + renderLeft = 0; + + if(renderTop<0) + renderTop = 0; + + if(renderRight >= 640) + renderRight = 639; + + if(renderBottom >= 480) + renderBottom = 479; + SetClip(renderLeft, renderTop, renderRight,renderBottom); *************** *** 844,847 **** --- 868,883 ---- AffObjetIso(0,0,0,0,overlay3dObect,0,pObject); + if(renderLeft<0) + renderLeft = 0; + + if(renderTop<0) + renderTop = 0; + + if(renderRight >= 640) + renderRight = 639; + + if(renderBottom >= 480) + renderBottom = 479; + DrawCadre(10,10,69,69); AddPhysBox(10,10,69,69); |