From 66ac035576a2b293e17311d4b3051dff5aceb5ae Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 29 Apr 2020 15:37:39 -0700 Subject: [PATCH] Move all-sides warp background update code to logic functions Otherwise it'll go by really fast and rapidly pulsate. To the point where it seems like it would be an epilepsy trigger, although I wouldn't know anything about epilepsy other than that it's bad. --- desktop_version/src/Graphics.cpp | 17 ++++++++++------- desktop_version/src/editor.cpp | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 811b64af..9f86b8a7 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -2005,13 +2005,6 @@ void Graphics::drawbackground( int t ) warpfcol = RGBflip(0xFF, 0xFF, 0xFF); } - backoffset += 1; - if (backoffset >= 16) - { - backoffset -= 16; - warpskip = (warpskip + 1) % 2; - } - for (int i = 10 ; i >= 0; i--) { temp = (i << 4) + backoffset; @@ -2212,6 +2205,16 @@ void Graphics::updatebackground(int t) backgrounddrawn = true; } break; + case 5: + //Warp zone, central + + backoffset += 1; + if (backoffset >= 16) + { + backoffset -= 16; + warpskip = (warpskip + 1) % 2; + } + break; case 6: //Final Starfield for (int i = 0; i < 50; i++) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index c079a032..539b9fe6 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -3618,6 +3618,10 @@ void editorlogic() graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); graphics.updatebackground(4); break; + case 3: + graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy); + graphics.updatebackground(5); + break; default: break; }