mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
Use case-switch for warpdir checking
Also, there's no need to put the entire warpdir checking in an 'if(room.warpdir>0)' statement. If any of the cases is jumped to, then you already know that's true.
This commit is contained in:
parent
2938db057b
commit
ccb3d6e974
1 changed files with 8 additions and 5 deletions
|
@ -1661,20 +1661,23 @@ void mapclass::loadlevel(int rx, int ry)
|
||||||
if(redrawbg){
|
if(redrawbg){
|
||||||
graphics.backgrounddrawn = false;
|
graphics.backgrounddrawn = false;
|
||||||
}
|
}
|
||||||
if(room.warpdir>0){
|
switch (room.warpdir)
|
||||||
if(room.warpdir==1){
|
{
|
||||||
|
case 1:
|
||||||
warpx=true;
|
warpx=true;
|
||||||
background=3;
|
background=3;
|
||||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||||
}else if(room.warpdir==2){
|
break;
|
||||||
|
case 2:
|
||||||
warpy=true;
|
warpy=true;
|
||||||
background=4;
|
background=4;
|
||||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||||
}else if(room.warpdir==3){
|
break;
|
||||||
|
case 3:
|
||||||
warpx=true; warpy=true;
|
warpx=true; warpy=true;
|
||||||
background = 5;
|
background = 5;
|
||||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
roomname = room.roomname;
|
roomname = room.roomname;
|
||||||
|
|
Loading…
Reference in a new issue