From c6e800db6f877152d7263d442b7ded76312a1f77 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 19 Jun 2020 15:23:28 -0700 Subject: [PATCH] Add '#if !defined(NO_EDITOR)' guards around editorinput/render/logic These functions aren't needed in a NO_EDITOR build, so it's useful to reduce the binary size this way. --- desktop_version/src/editor.cpp | 2 ++ desktop_version/src/editor.h | 2 ++ desktop_version/src/main.cpp | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 5397dfe2..7af667a0 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2299,6 +2299,7 @@ void editorclass::generatecustomminimap() } } +#if !defined(NO_EDITOR) void editormenurender(int tr, int tg, int tb) { switch (game.currentmenuname) @@ -5594,6 +5595,7 @@ void editorinput() } } } +#endif /* NO_EDITOR */ int editorclass::numtrinkets() { diff --git a/desktop_version/src/editor.h b/desktop_version/src/editor.h index 44a1ebea..e1436c06 100644 --- a/desktop_version/src/editor.h +++ b/desktop_version/src/editor.h @@ -259,11 +259,13 @@ void fillbox(int x, int y, int x2, int y2, int c); void fillboxabs(int x, int y, int x2, int y2, int c); +#if !defined(NO_EDITOR) void editorrender(); void editorlogic(); void editorinput(); +#endif extern editorclass ed; diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 91962ce6..90324fb5 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -400,7 +400,7 @@ void inline deltaloop() case PRELOADER: preloaderrender(); break; -#if !defined(NO_CUSTOM_LEVELS) +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) case EDITORMODE: graphics.flipmode = false; editorrender(); @@ -499,7 +499,7 @@ void inline fixedloop() case PRELOADER: preloaderlogic(); break; -#if !defined(NO_CUSTOM_LEVELS) +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) case EDITORMODE: //Input editorinput(); @@ -598,7 +598,7 @@ void inline fixedloop() } //Mute button -#if !defined(NO_CUSTOM_LEVELS) +#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) bool inEditor = ed.textentry || ed.scripthelppage == 1; #else bool inEditor = false;