From 56e4a84b1bd78245bee270558ddc047a6d7b1946 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 16 Jun 2024 16:22:19 +0200 Subject: [PATCH] fixup to use new canvas --- rogueviz/rogueviz.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rogueviz/rogueviz.h b/rogueviz/rogueviz.h index ae24282d..b34a96bb 100644 --- a/rogueviz/rogueviz.h +++ b/rogueviz/rogueviz.h @@ -176,11 +176,19 @@ namespace rogueviz { extern map textures; +inline void setCanvasChar(presmode mode, char c) { + if(c == '0') { + setCanvasColor(mode, 0x101010, [] {}); + } + if(c == 'd') { + setCanvas(mode, &ccolor::landscape_dark); + } + } + template function roguevizslide(char c, const T& t, const U& f) { return [c,t,f] (presmode mode) { f(mode); - ccolor::plain.ctab = {0x101010}; - setCanvas(mode, c); + setCanvasChar(mode, c); if(mode == 1 || mode == pmGeometryStart) t(); if(mode == 3 || mode == pmGeometry || mode == pmGeometryReset) { @@ -201,8 +209,7 @@ template function roguevizslide(char c, const T& t) { r template function roguevizslide_action(char c, const T& t, const U& act) { return [c,t,act] (presmode mode) { - ccolor::plain.ctab = {0x101010}; - setCanvas(mode, c); + setCanvasChar(mode, c); if(mode == pmStart || mode == pmGeometryStart) t(); act(mode);