diff --git a/LuaScript/Engine/NativeProtocol.cs b/LuaScript/Engine/NativeProtocol.cs index c86af9e..a4cb2ac 100644 --- a/LuaScript/Engine/NativeProtocol.cs +++ b/LuaScript/Engine/NativeProtocol.cs @@ -26,6 +26,7 @@ namespace LuaScript.Engine public const int OffCallbackKind = 44; public const int OffLoadResultWidth = 48; public const int OffLoadResultHeight = 52; + public const int OffStringParamsLen = 56; public const int HeaderSize = 64; @@ -43,6 +44,9 @@ namespace LuaScript.Engine public const int CallbackResultOffset = CallbackTagOffset + CallbackTagMax; public const int CallbackResultCount = 8; + public const int StringParamsOffset = CallbackResultOffset + CallbackResultCount * 8; + public const int StringParamsMax = 64 * 1024; + public const int CbKindGetObject = 0; public const int CbKindLoadFigure = 1; public const int CbKindEffect = 2; @@ -61,7 +65,7 @@ namespace LuaScript.Engine public const int CbAlpha = 6; public const int CbLayer = 7; - public const int PixelOffset = CallbackResultOffset + CallbackResultCount * 8; + public const int PixelOffset = StringParamsOffset + StringParamsMax; public const int W = 0; public const int H = 1; diff --git a/native/worker.lua b/native/worker.lua index 09a89b7..36d48c2 100644 --- a/native/worker.lua +++ b/native/worker.lua @@ -49,12 +49,15 @@ local OFF_CB_FOUND = 10 local OFF_CB_KIND = 11 local OFF_LOAD_RESULT_W = 12 local OFF_LOAD_RESULT_H = 13 +local OFF_STRING_PARAMS_LEN = 14 local SCRIPT_OFFSET = 64 + 64 * 8 local ERROR_OFFSET = SCRIPT_OFFSET + 128 * 1024 local CB_TAG_OFFSET = ERROR_OFFSET + 4 * 1024 local CB_TAG_MAX = 4096 local CB_RESULT_OFFSET = CB_TAG_OFFSET + CB_TAG_MAX -local PIXEL_OFFSET = CB_RESULT_OFFSET + 8 * 8 +local STRING_PARAMS_OFFSET = CB_RESULT_OFFSET + 8 * 8 +local STRING_PARAMS_MAX = 64 * 1024 +local PIXEL_OFFSET = STRING_PARAMS_OFFSET + STRING_PARAMS_MAX local FIRST_WRITABLE = 8 local LAST_WRITABLE = 25 local STATUS_CALLBACK = 3