From d15f114892f23118dc47b052cca57b37ab4af274 Mon Sep 17 00:00:00 2001 From: Vincent Giangiulio Date: Sun, 19 Jul 2009 18:07:41 +0000 Subject: [PATCH] Added boolean occludable parameter to mark command in CEL scripting --- src/celengine/cmdparser.cpp | 28 +++++++++++++++------------- src/celengine/command.cpp | 17 ++++++++++------- src/celengine/command.h | 3 ++- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/celengine/cmdparser.cpp b/src/celengine/cmdparser.cpp index f8c9e733a..40a214dd3 100644 --- a/src/celengine/cmdparser.cpp +++ b/src/celengine/cmdparser.cpp @@ -9,11 +9,20 @@ // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. +#include "celestia.h" + +#include "astro.h" +#include "cmdparser.h" +#include "glcontext.h" +#include +#include +#include +#include +#include +#include #include #include -#include "celestia.h" - // Older gcc versions used instead of . // This has been corrected in GCC 3.2, but name clashing must // be avoided @@ -23,16 +32,6 @@ #endif #include -#include -#include -#include -#include -#include -#include -#include "astro.h" -#include "cmdparser.h" -#include "glcontext.h" - using namespace std; @@ -670,7 +669,10 @@ Command* CommandParser::parseCommand() rep.setColor(color); rep.setLabel(label); - cmd = new CommandMark(object, rep); + bool occludable = true; + paramList->getBoolean("occludable", occludable); + + cmd = new CommandMark(object, rep, occludable); } else if (commandName == "unmark") { diff --git a/src/celengine/command.cpp b/src/celengine/command.cpp index 74ceafb73..7b00e3050 100644 --- a/src/celengine/command.cpp +++ b/src/celengine/command.cpp @@ -7,15 +7,16 @@ // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -#include #include -#include -#include -#include #include "astro.h" +#include "asterism.h" #include "command.h" #include "execution.h" #include "glcontext.h" +#include +#include +#include +#include using namespace std; @@ -613,9 +614,11 @@ void CommandSet::process(ExecutionEnvironment& env) // Mark object command CommandMark::CommandMark(const string& _target, - MarkerRepresentation _rep) : + MarkerRepresentation _rep, + bool _occludable) : target(_target), - rep(_rep) + rep(_rep), + occludable(_occludable) { } @@ -628,7 +631,7 @@ void CommandMark::process(ExecutionEnvironment& env) if (env.getSimulation()->getUniverse() != NULL) { - env.getSimulation()->getUniverse()->markObject(sel, rep, 1); + env.getSimulation()->getUniverse()->markObject(sel, rep, 1, occludable); } } diff --git a/src/celengine/command.h b/src/celengine/command.h index d53d953e7..55bda1cf8 100644 --- a/src/celengine/command.h +++ b/src/celengine/command.h @@ -513,12 +513,13 @@ class CommandPreloadTextures : public InstantaneousCommand class CommandMark : public InstantaneousCommand { public: - CommandMark(const std::string&, MarkerRepresentation); + CommandMark(const std::string&, MarkerRepresentation, bool); void process(ExecutionEnvironment&); private: std::string target; MarkerRepresentation rep; + bool occludable; };