Added boolean occludable parameter to mark command in CEL scripting

ver1_6_1
Vincent Giangiulio 2009-07-19 18:07:41 +00:00
parent e0ac0bfc3b
commit d15f114892
3 changed files with 27 additions and 21 deletions

View File

@ -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 <celutil/util.h>
#include <celutil/debug.h>
#include <celmath/mathlib.h>
#include <celengine/astro.h>
#include <celestia/celx.h>
#include <celestia/celx_internal.h>
#include <algorithm>
#include <cstdio>
#include "celestia.h"
// Older gcc versions used <strstream> instead of <sstream>.
// This has been corrected in GCC 3.2, but name clashing must
// be avoided
@ -23,16 +32,6 @@
#endif
#include <sstream>
#include <celutil/util.h>
#include <celutil/debug.h>
#include <celmath/mathlib.h>
#include <celengine/astro.h>
#include <celestia/celx.h>
#include <celestia/celx_internal.h>
#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")
{

View File

@ -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 <iostream>
#include <celutil/util.h>
#include <celestia/celestiacore.h>
#include <celestia/imagecapture.h>
#include <celestia/celx_internal.h>
#include "astro.h"
#include "asterism.h"
#include "command.h"
#include "execution.h"
#include "glcontext.h"
#include <celestia/celestiacore.h>
#include <celestia/imagecapture.h>
#include <celestia/celx_internal.h>
#include <iostream>
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);
}
}

View File

@ -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;
};