1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Add bounds-check to entcolours in editor rendering

I have no idea why neither conveyors and moving and disappearing
platforms rendered in the editor or in-game use
Graphics::drawentcolours(), but this needs to be bounds-checked just as
I did for the in-game rendering function.
This commit is contained in:
Misa 2020-09-15 15:21:34 -07:00 committed by Ethan Lee
parent c325085ddb
commit 3ffe1b2e3b

View file

@ -2676,6 +2676,10 @@ void editorrender()
fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getBGR(255,164,255)); fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getBGR(255,164,255));
break; break;
case 2: //Threadmills & platforms case 2: //Threadmills & platforms
if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours))
{
continue;
}
tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); tpoint.x = (edentity[i].x*8)- (ed.levx*40*8);
tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); tpoint.y = (edentity[i].y*8)- (ed.levy*30*8);
drawRect = graphics.tiles_rect; drawRect = graphics.tiles_rect;
@ -2733,6 +2737,10 @@ void editorrender()
} }
break; break;
case 3: //Disappearing Platform case 3: //Disappearing Platform
if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours))
{
continue;
}
tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); tpoint.x = (edentity[i].x*8)- (ed.levx*40*8);
tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); tpoint.y = (edentity[i].y*8)- (ed.levy*30*8);
drawRect = graphics.tiles_rect; drawRect = graphics.tiles_rect;