|
@@ -206,6 +206,12 @@ void JSBModule::EmitSource(const String& filepath)
|
|
|
file.Open(filepath, FILE_WRITE);
|
|
file.Open(filepath, FILE_WRITE);
|
|
|
|
|
|
|
|
source_ = "// This file was autogenerated by JSBind, changes will be lost\n";
|
|
source_ = "// This file was autogenerated by JSBind, changes will be lost\n";
|
|
|
|
|
+
|
|
|
|
|
+ if (Requires("3D"))
|
|
|
|
|
+ {
|
|
|
|
|
+ source_ += "#ifdef ATOMIC_3D\n";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
source_ += "#include <Duktape/duktape.h>\n";
|
|
source_ += "#include <Duktape/duktape.h>\n";
|
|
|
source_ += "#include <AtomicJS/Javascript/JSVM.h>\n";
|
|
source_ += "#include <AtomicJS/Javascript/JSVM.h>\n";
|
|
|
source_ += "#include <AtomicJS/Javascript/JSAPI.h>\n";
|
|
source_ += "#include <AtomicJS/Javascript/JSAPI.h>\n";
|
|
@@ -244,6 +250,12 @@ void JSBModule::EmitSource(const String& filepath)
|
|
|
// end Atomic namespace
|
|
// end Atomic namespace
|
|
|
source_ += "\n}\n";
|
|
source_ += "\n}\n";
|
|
|
|
|
|
|
|
|
|
+ if (Requires("3D"))
|
|
|
|
|
+ {
|
|
|
|
|
+ source_ += "#endif //ATOMIC_3D\n";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
file.Write(source_.CString(), source_.Length());
|
|
file.Write(source_.CString(), source_.Length());
|
|
|
|
|
|
|
|
file.Close();
|
|
file.Close();
|
|
@@ -268,9 +280,19 @@ void JSBModule::Load(const String &moduleJSONFilename)
|
|
|
JSONValue includes = moduleJSON.GetChild("includes");
|
|
JSONValue includes = moduleJSON.GetChild("includes");
|
|
|
JSONValue classes_rename = moduleJSON.GetChild("classes_rename");
|
|
JSONValue classes_rename = moduleJSON.GetChild("classes_rename");
|
|
|
JSONValue overloads = moduleJSON.GetChild("overloads");
|
|
JSONValue overloads = moduleJSON.GetChild("overloads");
|
|
|
|
|
+ JSONValue requires = moduleJSON.GetChild("requires");
|
|
|
|
|
|
|
|
HashMap<String, String> rename;
|
|
HashMap<String, String> rename;
|
|
|
|
|
|
|
|
|
|
+ if (requires.IsArray())
|
|
|
|
|
+ {
|
|
|
|
|
+ for (unsigned j = 0; j < requires.GetSize(); j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ requirements_.Push(requires.GetString(j));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (classes_rename.IsObject())
|
|
if (classes_rename.IsObject())
|
|
|
{
|
|
{
|
|
|
Vector<String> childNames = classes_rename.GetValueNames();
|
|
Vector<String> childNames = classes_rename.GetValueNames();
|