Skip to content

Commit

Permalink
it now grabs that variable from the json for use later.
Browse files Browse the repository at this point in the history
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Jan 12, 2019
1 parent 16e1a48 commit e7b8a33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/microbe_stage/compounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Compound::Compound(Json::Value value)
volume = value["volume"].asDouble();
isCloud = value["isCloud"].asBool();
isUseful = value["isUseful"].asBool();

isEnvironmental = value["isEnvironmental"].asBool();
// Setting the cloud colour.
float r = value["colour"]["r"].asFloat();
float g = value["colour"]["g"].asFloat();
Expand Down
1 change: 1 addition & 0 deletions src/microbe_stage/compounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Compound : public RegistryType {
double volume = 1.0;
bool isCloud = false;
bool isUseful = false;
bool isEnvironmental = false;
Ogre::ColourValue colour;

Compound();
Expand Down
5 changes: 5 additions & 0 deletions src/scripting/script_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ bool
ANGELSCRIPT_REGISTERFAIL;
}

if(engine->RegisterObjectProperty(
"Compound", "bool isEnvironmental", asOFFSET(Compound, isEnvironmental)) < 0) {
ANGELSCRIPT_REGISTERFAIL;
}

if(engine->RegisterObjectProperty("Compound", "Ogre::ColourValue colour",
asOFFSET(Compound, colour)) < 0) {
ANGELSCRIPT_REGISTERFAIL;
Expand Down

0 comments on commit e7b8a33

Please sign in to comment.