Adds little hack for GetOwner.
This commit is contained in:
parent
f9c8efb9b1
commit
31414d6521
|
@ -18,10 +18,9 @@ static void PrintObjectTypeDef(asITypeInfo* type, const std::filesystem::path& d
|
||||||
std::fstream fs;
|
std::fstream fs;
|
||||||
fs.open((dir / name).concat(".astypedef"), std::fstream::out);
|
fs.open((dir / name).concat(".astypedef"), std::fstream::out);
|
||||||
|
|
||||||
if ((type->GetFlags() & asOBJ_VALUE) != 0 && (type->GetFlags() & asOBJ_ASHANDLE) == 0){
|
if ((type->GetFlags() & asOBJ_VALUE) != 0 && (type->GetFlags() & asOBJ_ASHANDLE) == 0) {
|
||||||
fs << "valuetype";
|
fs << "valuetype";
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
fs << "type";
|
fs << "type";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,24 +116,27 @@ static void PrintScriptObject(asITypeInfo* type, const std::filesystem::path& di
|
||||||
auto name = std::string(method->GetName());
|
auto name = std::string(method->GetName());
|
||||||
if (name == "opAssign")
|
if (name == "opAssign")
|
||||||
continue;
|
continue;
|
||||||
|
if (name == "GetOwner") {
|
||||||
|
fs << "\tref@ __owner;" << std::endl << std::endl;
|
||||||
|
}
|
||||||
auto decl = std::string(method->GetDeclaration(false, true, true));
|
auto decl = std::string(method->GetDeclaration(false, true, true));
|
||||||
replace(decl, "&in", " &in");
|
replace(decl, "&in", " &in");
|
||||||
replace(decl, "&out", " &out");
|
replace(decl, "&out", " &out");
|
||||||
|
replace(decl, "ref", "ref@");
|
||||||
fs << "\t" << decl;
|
fs << "\t" << decl;
|
||||||
if (isAbstract){
|
if (isAbstract) {
|
||||||
if (method->GetReturnTypeId() == 0){
|
if (method->GetReturnTypeId() == 0) {
|
||||||
fs << "{};" << std::endl;
|
fs << "{};" << std::endl;
|
||||||
}
|
} else {
|
||||||
else{
|
if (name == "GetOwner") {
|
||||||
if (method->GetReturnTypeId() == asTYPEID_BOOL){
|
fs << "{ return __owner; };" << std::endl;
|
||||||
|
} else if (method->GetReturnTypeId() == asTYPEID_BOOL) {
|
||||||
fs << "{ return false; };" << std::endl;
|
fs << "{ return false; };" << std::endl;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
fs << "{ return 0; };" << std::endl;
|
fs << "{ return 0; };" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
fs << ";" << std::endl;
|
fs << ";" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +189,7 @@ void ScriptHeadersExporter::Export(const std::string& outPath) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto globalFuncs = engine->GetGlobalFunctionCount();
|
auto globalFuncs = engine->GetGlobalFunctionCount();
|
||||||
if (globalFuncs > 0){
|
if (globalFuncs > 0) {
|
||||||
std::fstream fs;
|
std::fstream fs;
|
||||||
fs.open((dir / "globals").concat(".astypedef"), std::fstream::out);
|
fs.open((dir / "globals").concat(".astypedef"), std::fstream::out);
|
||||||
|
|
||||||
|
@ -196,5 +198,4 @@ void ScriptHeadersExporter::Export(const std::string& outPath) {
|
||||||
fs << "func " << func->GetDeclaration(false, false, true) << ";" << std::endl;
|
fs << "func " << func->GetDeclaration(false, false, true) << ";" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue