From 731fb89c901891b021c899c5fbbc123e267c3516 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 22 Aug 2021 20:56:47 -0700 Subject: [PATCH] Add being able to use Lab rainbow background in editor If you use Lab tilecol 6, you get the rainbow background. However, this is unintended, because the associated autotiling is... not very good. To combat that, Ved disallows using the Lab rainbow background outside of Direct Mode. We will follow Ved here and only allow switching to the rainbow background if you're in Direct Mode. Also make sure if someone is disabling Direct Mode with the rainbow background that it gets reset properly. --- desktop_version/src/editor.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 03b587f8..d39ea506 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -1704,6 +1704,12 @@ void editorclass::clamp_tilecol(const int rx, const int ry, const bool wrap) case 1: maxcol = 7; break; + case 2: + if (room->directmode) + { + maxcol = 6; + } + break; case 3: maxcol = 6; break; @@ -4803,6 +4809,12 @@ void editorinput(void) { ed.setroomdirectmode(ed.levx, ed.levy, 0); ed.note="Direct Mode Disabled"; + /* Kludge fix for rainbow BG here... */ + if (ed.getroomprop(ed.levx, ed.levy)->tileset == 2 + && ed.getroomprop(ed.levx, ed.levy)->tilecol == 6) + { + ed.setroomtilecol(ed.levx, ed.levy, 0); + } } else {