mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Move cursor delay update logic to maplogic()
Otherwise it'll go really really fast. Incidentally this also basically de-duplicates it and results in less copy-pasted code overall.
This commit is contained in:
parent
837ccfc735
commit
4ba9954eb8
2 changed files with 15 additions and 38 deletions
|
@ -61,6 +61,19 @@ void maplogic()
|
|||
graphics.menuoffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (map.cursorstate == 0){
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 10){
|
||||
map.cursorstate = 1;
|
||||
map.cursordelay = 0;
|
||||
}
|
||||
}else if (map.cursorstate == 1){
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 30) map.cursorstate = 2;
|
||||
}else if (map.cursorstate == 2){
|
||||
map.cursordelay++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1786,19 +1786,6 @@ void maprender()
|
|||
}
|
||||
}
|
||||
|
||||
if (map.cursorstate == 0){
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 10){
|
||||
map.cursorstate = 1;
|
||||
map.cursordelay = 0;
|
||||
}
|
||||
}else if (map.cursorstate == 1){
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 30) map.cursorstate = 2;
|
||||
}else if (map.cursorstate == 2){
|
||||
map.cursordelay++;
|
||||
}
|
||||
|
||||
//normal size maps
|
||||
if(map.customzoom==4){
|
||||
if(map.cursorstate==1){
|
||||
|
@ -1857,18 +1844,8 @@ void maprender()
|
|||
if (game.roomx == 109)
|
||||
{
|
||||
//tower!instead of room y, scale map.ypos
|
||||
if (map.cursorstate == 0)
|
||||
if (map.cursorstate == 1)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 10)
|
||||
{
|
||||
map.cursorstate = 1;
|
||||
map.cursordelay = 0;
|
||||
}
|
||||
}
|
||||
else if (map.cursorstate == 1)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (int(map.cursordelay / 4) % 2 == 0)
|
||||
{
|
||||
graphics.drawrect(40 + ((game.roomx - 100) * 12) , 21 , 12, 180, 255,255,255);
|
||||
|
@ -1878,7 +1855,6 @@ void maprender()
|
|||
}
|
||||
else if (map.cursorstate == 2)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (int(map.cursordelay / 15) % 2 == 0)
|
||||
{
|
||||
graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2 , 21 + 2, 12 - 4, 180 - 4,16, 245 - (help.glow), 245 - (help.glow));
|
||||
|
@ -1887,28 +1863,16 @@ void maprender()
|
|||
}
|
||||
else
|
||||
{
|
||||
if (map.cursorstate == 0)
|
||||
if (map.cursorstate == 1)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (map.cursordelay > 10)
|
||||
{
|
||||
map.cursorstate = 1;
|
||||
map.cursordelay = 0;
|
||||
}
|
||||
}
|
||||
else if (map.cursorstate == 1)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (int(map.cursordelay / 4) % 2 == 0)
|
||||
{
|
||||
graphics.drawrect(40 + ((game.roomx - 100) * 12) , 21 + ((game.roomy - 100) * 9) , 12 , 9 , 255,255,255);
|
||||
graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + ((game.roomy - 100) * 9) + 2, 12 - 4, 9 - 4, 255,255,255);
|
||||
}
|
||||
if (map.cursordelay > 30) map.cursorstate = 2;
|
||||
}
|
||||
else if (map.cursorstate == 2)
|
||||
{
|
||||
map.cursordelay++;
|
||||
if (int(map.cursordelay / 15) % 2 == 0)
|
||||
{
|
||||
graphics.drawrect(40 + ((game.roomx - 100) * 12) + 2, 21 + ((game.roomy - 100) * 9) + 2, 12 - 4, 9 - 4, 16, 245 - (help.glow), 245 - (help.glow));
|
||||
|
|
Loading…
Reference in a new issue