| 114 | } |
| 115 | |
| 116 | bool ccGetScriptObjectAddress(const String &name, void *&obj_out, IScriptObject *&mgr_out) |
| 117 | { |
| 118 | const auto *imp = simp.GetByName(name); |
| 119 | if (!imp) |
| 120 | return false; |
| 121 | if (imp->Value.Type != kScValScriptObject && imp->Value.Type != kScValPluginObject) |
| 122 | return false; |
| 123 | |
| 124 | void *object; |
| 125 | IScriptObject *mgr; |
| 126 | if (imp->ValueHint == kScValHint_Handle) |
| 127 | { |
| 128 | const int32_t handle = *static_cast<const int32_t*>(imp->Value.Ptr); |
| 129 | if (ccGetObjectAddressAndManagerFromHandle(handle, object, mgr) == kScValUndefined) |
| 130 | return false; |
| 131 | } |
| 132 | else |
| 133 | { |
| 134 | object = imp->Value.Ptr; |
| 135 | mgr = imp->Value.ObjMgr; |
| 136 | } |
| 137 | |
| 138 | obj_out = object; |
| 139 | mgr_out = mgr; |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | void *ccGetScriptObjectAddress(const String &name, const String &type) |
| 144 | { |
no test coverage detected