Hi Ian,
I just refreshed all my matrix1.dlls and I think I've found a compatibility issue between the most recent Matrix1Util_20.dll and Barnski's Lua Plugin 1.1.1.
Barnski's lua 'register function ptr' command causes a silent exit with the latest matrix1util_20.dll, but doesn't with an older version of matrix1util_20.dll from 2008.
I've attached the two .dll's that play nicely together.
It's not a big issue right now as I can use the older matrix1util_20.dll. Silent exits are nasty though!
`This code will silently exit at Barnski's 'lua register function ptr' command when using 'matrix1util_20.dll' dated 02.03.2010
`The code will not crash when using 'matrix1util_20.dll' dated 20.04.2008
`Something is clashing with 'Barnski'sLuaPlugin_release.dll' dated 21.10.2008
sync on : sync rate 30
C_setupLogfile("log.txt")
C_incArray()
text 10, 10, "Press a key to exit"
sync : sync
wait key
end
function C_RegFunc(ptr as dword, luaname as string, vartypes as string, returnyes as integer, plugfunc as integer)
lua register function ptr, luaname, vartypes, returnyes, plugfunc `this line causes a silent exit
c_writelog("ptr: " + str$(ptr) + " luaname: " + luaname + " vartypes: " + vartypes + " returnyes: " + str$(returnyes), -1,0)
endfunction
function C_incArray() : fncpt = get ptr to this function() : C_RegFunc(fncpt, "C_incArray", "", 0, 0) : if g_commonRegistered = 0 then exitfunction
`(this is an empty test function)
endfunction
function C_setupLogfile(logname$)
f = FIND FREE FILE()
if file exist (logname$) = 1
delete FILE logname$
endif
OPEN DATAFILE TO WRITE f, logname$
WRITE DATAFILE STRING (f), "Log Started: " + get time$() + " On: " + get date$()
WRITE DATAFILE STRING (f), "DirectX ver: " + get dx version$()
WRITE DATAFILE STRING (f), "Windows Version: " + str$(windows version ()) `400x - Windows 95,410x - Windows 98, 490x - Windows ME, 500x - Windows 2000, 501x - Windows XP,502x - Windows 2003, 600x - Windows Vista or Windows 2008
WRITE DATAFILE STRING (f), "CPU Vendor: " + get processor vendor$(0)
WRITE DATAFILE STRING (f), "CPU Brand: " + get processor brand$(1)
WRITE DATAFILE STRING (f), "CPU Name: " + get processor name$(1)
WRITE DATAFILE STRING (f), "CPU platform: " + get processor platform$(1)
WRITE DATAFILE STRING (f), "CPU Type ID: " + str$(get processor type id(1))
WRITE DATAFILE STRING (f), "CPU processor family: " + str$(get processor family id(1))
WRITE DATAFILE STRING (f), "CPU modelID: " + str$(get processor model id(1))
WRITE DATAFILE STRING (f), "CPU steppingID: " + str$(get processor stepping id(1))
WRITE DATAFILE STRING (f), "CPU mhz: " + str$(get processor frequency(1))
WRITE DATAFILE STRING (f), "CPU Processor Count: " + str$(processor count ())
WRITE DATAFILE STRING (f), "Graphics Card: " + current graphics card$()
WRITE DATAFILE STRING (f), "Maximum Pixel Shader Value: " + str$(get maximum pixel shader value())
WRITE DATAFILE STRING (f), "Maximum Pixel Shader Version: " + str$(get maximum pixel shader version())
WRITE DATAFILE STRING (f), "Function Count: " + str$(GET FUNCTION COUNT())
global g_iLogFileIndex = f
endfunction
function C_writelog(x$,y,p)
logstring$ = get time$() + " | " + x$ + " | " + str$(y)
WRITE DATAFILE STRING (g_iLogFileIndex), logstring$
if p = 1` if p = 1 then write to screen, otherwise just write to log
print logstring$
sync
endif
endfunction