From 96f8b4a6ee5d87eb31f86b8e6581a21322db864d Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Thu, 15 Aug 2019 23:13:01 +0300 Subject: [PATCH] Add missing #ifdef CELX --- src/celestia/cmdparser.cpp | 8 ++++++++ src/celestia/command.cpp | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/celestia/cmdparser.cpp b/src/celestia/cmdparser.cpp index 996b47b7..089f378f 100644 --- a/src/celestia/cmdparser.cpp +++ b/src/celestia/cmdparser.cpp @@ -19,8 +19,10 @@ #include #include #include +#ifdef CELX #include "celx.h" #include "celx_internal.h" +#endif #include #include #include @@ -851,6 +853,7 @@ uint64_t parseRenderFlags(string s) Tokenizer tokenizer(&in); uint64_t flags = 0; +#ifdef CELX Tokenizer::TokenType ttype = tokenizer.nextToken(); while (ttype != Tokenizer::TokenEnd) { @@ -868,6 +871,7 @@ uint64_t parseRenderFlags(string s) ttype = tokenizer.nextToken(); } } +#endif return flags; } @@ -880,6 +884,7 @@ int parseLabelFlags(string s) Tokenizer tokenizer(&in); int flags = 0; +#ifdef CELX Tokenizer::TokenType ttype = tokenizer.nextToken(); while (ttype != Tokenizer::TokenEnd) { @@ -897,6 +902,7 @@ int parseLabelFlags(string s) ttype = tokenizer.nextToken(); } } +#endif return flags; } @@ -909,6 +915,7 @@ int parseOrbitFlags(string s) Tokenizer tokenizer(&in); int flags = 0; +#ifdef CELX Tokenizer::TokenType ttype = tokenizer.nextToken(); while (ttype != Tokenizer::TokenEnd) { @@ -927,6 +934,7 @@ int parseOrbitFlags(string s) ttype = tokenizer.nextToken(); } } +#endif return flags; } diff --git a/src/celestia/command.cpp b/src/celestia/command.cpp index 9b23cc9f..3c09b6c7 100644 --- a/src/celestia/command.cpp +++ b/src/celestia/command.cpp @@ -16,7 +16,9 @@ #endif #include "celestiacore.h" #include "imagecapture.h" +#ifdef CELX #include "celx_internal.h" +#endif #include #include #include @@ -721,6 +723,7 @@ CommandSplitView::CommandSplitView(unsigned int _view, string _splitType, double void CommandSplitView::process(ExecutionEnvironment& env) { +#ifdef CELX // because of getObservers vector observer_list; getObservers(env.getCelestiaCore(), observer_list); @@ -731,6 +734,7 @@ void CommandSplitView::process(ExecutionEnvironment& env) View::Type type = (compareIgnoringCase(splitType, "h") == 0) ? View::HorizontalSplit : View::VerticalSplit; env.getCelestiaCore()->splitView(type, view, (float)splitPos); } +#endif } @@ -744,6 +748,7 @@ CommandDeleteView::CommandDeleteView(unsigned int _view) : void CommandDeleteView::process(ExecutionEnvironment& env) { +#ifdef CELX vector observer_list; getObservers(env.getCelestiaCore(), observer_list); @@ -753,6 +758,7 @@ void CommandDeleteView::process(ExecutionEnvironment& env) View* view = getViewByObserver(env.getCelestiaCore(), obs); env.getCelestiaCore()->deleteView(view); } +#endif } @@ -761,8 +767,10 @@ void CommandDeleteView::process(ExecutionEnvironment& env) void CommandSingleView::process(ExecutionEnvironment& env) { +#ifdef CELX View* view = getViewByObserver(env.getCelestiaCore(), env.getSimulation()->getActiveObserver()); env.getCelestiaCore()->singleView(view); +#endif } @@ -776,6 +784,7 @@ CommandSetActiveView::CommandSetActiveView(unsigned int _view) : void CommandSetActiveView::process(ExecutionEnvironment& env) { +#ifdef CELX vector observer_list; getObservers(env.getCelestiaCore(), observer_list); @@ -785,6 +794,7 @@ void CommandSetActiveView::process(ExecutionEnvironment& env) View* view = getViewByObserver(env.getCelestiaCore(), obs); env.getCelestiaCore()->setActiveView(view); } +#endif } @@ -834,6 +844,7 @@ CommandSetLineColor::CommandSetLineColor(string _item, Color _color) : void CommandSetLineColor::process(ExecutionEnvironment& /* env */) { +#ifdef CELX if (CelxLua::LineColorMap.count(item) == 0) { cerr << "Unknown line style: " << item << "\n"; @@ -842,6 +853,7 @@ void CommandSetLineColor::process(ExecutionEnvironment& /* env */) { *CelxLua::LineColorMap[item] = color; } +#endif } @@ -856,6 +868,7 @@ CommandSetLabelColor::CommandSetLabelColor(string _item, Color _color) : void CommandSetLabelColor::process(ExecutionEnvironment& /* env */) { +#ifdef CELX if (CelxLua::LabelColorMap.count(item) == 0) { cerr << "Unknown label style: " << item << "\n"; @@ -864,6 +877,7 @@ void CommandSetLabelColor::process(ExecutionEnvironment& /* env */) { *CelxLua::LabelColorMap[item] = color; } +#endif }