Browse Source

Use Data:getFFIPointer instead of Data:getPointer for internal ImageData and SoundData FFI code.

Alex Szpakowski 5 years ago
parent
commit
fe2c204a2c

+ 1 - 1
src/common/runtime.cpp

@@ -941,7 +941,7 @@ void luax_runwrapper(lua_State *L, const char *filedata, size_t datalen, const c
 {
 	luax_gettypemetatable(L, type);
 
-	// Load and execute ImageData.lua, sending the metatable and the ffi
+	// Load and execute the given Lua file, sending the metatable and the ffi
 	// functions struct pointer as arguments.
 	if (lua_istable(L, -1))
 	{

+ 1 - 1
src/modules/image/wrap_ImageData.lua

@@ -368,7 +368,7 @@ local objectcache = setmetatable({}, {
 			width = width,
 			height = height,
 			format = format,
-			pointer = ffi.cast(conv.pointer, imagedata:getPointer()),
+			pointer = ffi.cast(conv.pointer, imagedata:getFFIPointer()),
 			tolua = conv.tolua,
 			fromlua = conv.fromlua,
 		}

+ 1 - 1
src/modules/sound/wrap_SoundData.lua

@@ -55,7 +55,7 @@ local objectcache = setmetatable({}, {
 	__mode = "k",
 	__index = function(self, sounddata)
 		local bytedepth = _getBitDepth(sounddata) / 8
-		local pointer = ffi.cast(datatypes[bytedepth], sounddata:getPointer())
+		local pointer = ffi.cast(datatypes[bytedepth], sounddata:getFFIPointer())
 
 		local p = {
 			bytedepth = bytedepth,