initial nativestring and nativearray marshalling
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled

This commit is contained in:
2026-01-03 16:00:55 +02:00
parent c7326ea483
commit 7088ce8742
25 changed files with 1958 additions and 341 deletions

View File

@@ -35,6 +35,11 @@ DEFINE_INTERNAL_CALL(MObject*) UtilsInternal_ExtractArrayFromList(MObject* obj)
}
#endif
//#if USE_NETCORE
//APgI_TYPEDEF() typedef MString* ManagedString;
API_TYPEDEF() typedef String* ManagedString;
//#endif
DEFINE_INTERNAL_CALL(void) PlatformInternal_MemoryCopy(void* dst, const void* src, uint64 size)
{
Platform::MemoryCopy(dst, src, size);
@@ -50,24 +55,33 @@ DEFINE_INTERNAL_CALL(int32) PlatformInternal_MemoryCompare(const void* buf1, con
return Platform::MemoryCompare(buf1, buf2, size);
}
DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_LogWrite(LogType level, MString* msgObj)
{
#if LOG_ENABLE
StringView msg;
MUtils::ToString(msgObj, msg);
Log::Logger::Write(level, msg);
#endif
}
DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_Log(LogType level, MString* msgObj, ScriptingObject* obj, MString* stackTrace)
DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_LogWrite(LogType level, ManagedString msgObj)
{
#if LOG_ENABLE
if (msgObj == nullptr)
return;
#if USE_NETCORE
StringView msg(*msgObj);
#else
StringView msg;
MUtils::ToString(msgObj, msg);
#endif
Log::Logger::Write(level, msg);
#endif
}
DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_Log(LogType level, ManagedString msgObj, ScriptingObject* obj, ManagedString stackTrace)
{
#if LOG_ENABLE
if (msgObj == nullptr)
return;
#if USE_NETCORE
StringView msg(*msgObj);
#else
// Get info
StringView msg;
MUtils::ToString(msgObj, msg);
#endif
//const String objName = obj ? obj->ToString() : String::Empty;
// Send event
@@ -79,6 +93,7 @@ DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_Log(LogType level, MString* m
DEFINE_INTERNAL_CALL(void) DebugLogHandlerInternal_LogException(MObject* exception, ScriptingObject* obj)
{
PLATFORM_DEBUG_BREAK;
#if USE_CSHARP
if (exception == nullptr)
return;
@@ -117,11 +132,17 @@ namespace
#endif
}
DEFINE_INTERNAL_CALL(void) ProfilerInternal_BeginEvent(MString* nameObj)
DEFINE_INTERNAL_CALL(void) ProfilerInternal_BeginEvent(ManagedString nameObj)
{
#if COMPILE_WITH_PROFILER
if (nameObj == nullptr)
return;
#if USE_NETCORE
StringView name(*nameObj);
#else
StringView name;
MUtils::ToString(nameObj, name);
#endif
ProfilerCPU::BeginEvent(*name);
#if TRACY_ENABLE
#if PROFILE_CPU_USE_TRANSIENT_DATA
@@ -173,10 +194,16 @@ DEFINE_INTERNAL_CALL(void) ProfilerInternal_EndEvent()
#endif
}
DEFINE_INTERNAL_CALL(void) ProfilerInternal_BeginEventGPU(MString* nameObj)
DEFINE_INTERNAL_CALL(void) ProfilerInternal_BeginEventGPU(ManagedString nameObj)
{
#if COMPILE_WITH_PROFILER
#if USE_NETCORE
if (nameObj == nullptr)
return;
const StringView nameChars(*nameObj);
#else
const StringView nameChars = MCore::String::GetChars(nameObj);
#endif
const auto index = ProfilerGPU::BeginEvent(nameChars.Get());
ManagedEventsGPU.Push(index);
#endif
@@ -197,6 +224,7 @@ DEFINE_INTERNAL_CALL(bool) ScriptingInternal_HasGameModulesLoaded()
DEFINE_INTERNAL_CALL(bool) ScriptingInternal_IsTypeFromGameScripts(MTypeObject* type)
{
PLATFORM_DEBUG_BREAK;
return Scripting::IsTypeFromGameScripts(MUtils::GetClass(INTERNAL_TYPE_OBJECT_GET(type)));
}

View File

@@ -43,6 +43,7 @@ void ManagedSerialization::Serialize(ISerializable::SerializeStream& stream, MOb
// Write result data
stream.RawValue(MCore::String::GetChars(invokeResultStr));
MCore::String::Free(invokeResultStr);
}
void ManagedSerialization::SerializeDiff(ISerializable::SerializeStream& stream, MObject* object, MObject* other)
@@ -79,6 +80,7 @@ void ManagedSerialization::SerializeDiff(ISerializable::SerializeStream& stream,
// Write result data
stream.RawValue(MCore::String::GetChars(invokeResultStr));
MCore::String::Free(invokeResultStr);
}
void ManagedSerialization::Deserialize(ISerializable::DeserializeStream& stream, MObject* object)