mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
De-duplicate 'ed.numcrewmates() - game.crewmates()'
Any decent compiler will optimize this so that it's still only two function calls (or it gets inlined). However, it's still not very readable, so I've assigned the result to a variable and used that instead.
This commit is contained in:
parent
8a110ead34
commit
b66d303540
1 changed files with 6 additions and 4 deletions
|
@ -1970,10 +1970,12 @@ void maprender()
|
||||||
graphics.Print( -1, FLIP(110), meta.Desc2, 196, 196, 255 - help.glow, true);
|
graphics.Print( -1, FLIP(110), meta.Desc2, 196, 196, 255 - help.glow, true);
|
||||||
graphics.Print( -1, FLIP(120), meta.Desc3, 196, 196, 255 - help.glow, true);
|
graphics.Print( -1, FLIP(120), meta.Desc3, 196, 196, 255 - help.glow, true);
|
||||||
|
|
||||||
if(ed.numcrewmates()-game.crewmates()==1){
|
int remaining = ed.numcrewmates() - game.crewmates();
|
||||||
graphics.Print(1,FLIP(165), help.number(ed.numcrewmates()-game.crewmates())+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
|
||||||
}else if(ed.numcrewmates()-game.crewmates()>0){
|
if(remaining==1){
|
||||||
graphics.Print(1,FLIP(165), help.number(ed.numcrewmates()-game.crewmates())+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
graphics.Print(1,FLIP(165), help.number(remaining)+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
||||||
|
}else if(remaining>0){
|
||||||
|
graphics.Print(1,FLIP(165), help.number(remaining)+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue