1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-31 22:19:44 +01:00

Merge pull request #467 from InfoTeddy/general-improvements

Remove checks to prevent having both warp lines/BGs in editor
This commit is contained in:
Terry Cavanagh 2020-09-06 14:46:56 +10:30 committed by GitHub
commit f014ed6fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4572,51 +4572,30 @@ void editorinput()
if(key.keymap[SDLK_w])
{
int j=0, tx=0, ty=0;
for(size_t i=0; i<edentity.size(); i++)
ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir=(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir+1)%4;
if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==0)
{
if(edentity[i].t==50)
{
tx=(edentity[i].p1-(edentity[i].p1%40))/40;
ty=(edentity[i].p2-(edentity[i].p2%30))/30;
if(tx==ed.levx && ty==ed.levy)
{
j++;
}
}
}
if(j>0)
{
ed.note="ERROR: Cannot have both warp types";
ed.note="Room warping disabled";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==1)
{
ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir=(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir+1)%4;
if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==0)
{
ed.note="Room warping disabled";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==1)
{
ed.note="Room warps horizontally";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==2)
{
ed.note="Room warps vertically";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==3)
{
ed.note="Room warps in all directions";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
ed.note="Room warps horizontally";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==2)
{
ed.note="Room warps vertically";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
else if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir==3)
{
ed.note="Room warps in all directions";
ed.notedelay=45;
graphics.backgrounddrawn=false;
}
ed.keydelay=6;
}
@ -5198,33 +5177,25 @@ void editorinput()
else if(ed.drawmode==14)
{
//Warp lines
if(ed.level[ed.levx+(ed.maxwidth*ed.levy)].warpdir==0)
if(ed.tilex==0)
{
if(ed.tilex==0)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,0);
}
else if(ed.tilex==39)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,1);
}
else if(ed.tiley==0)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,2);
}
else if(ed.tiley==29)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,3);
}
else
{
ed.note="ERROR: Warp lines must be on edges";
ed.notedelay=45;
}
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,0);
}
else if(ed.tilex==39)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,1);
}
else if(ed.tiley==0)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,2);
}
else if(ed.tiley==29)
{
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),50,3);
}
else
{
ed.note="ERROR: Cannot have both warp types";
ed.note="ERROR: Warp lines must be on edges";
ed.notedelay=45;
}
ed.lclickdelay=1;