mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09: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){
|
||||
graphics.backgrounddrawn = false;
|
||||
}
|
||||
if(room.warpdir>0){
|
||||
if(room.warpdir==1){
|
||||
switch (room.warpdir)
|
||||
{
|
||||
case 1:
|
||||
warpx=true;
|
||||
background=3;
|
||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||
}else if(room.warpdir==2){
|
||||
break;
|
||||
case 2:
|
||||
warpy=true;
|
||||
background=4;
|
||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||
}else if(room.warpdir==3){
|
||||
break;
|
||||
case 3:
|
||||
warpx=true; warpy=true;
|
||||
background = 5;
|
||||
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
roomname = room.roomname;
|
||||
|
|
Loading…
Reference in a new issue