47class ScolLogEventsListener :
public SLogListener
56 ScolLogEventsListener()
60 virtual void messageLogged(
const Ogre::String& message)
62 char* cmess = (
char*)malloc(
sizeof(
char*) * (message.length() + 1));
63 std::strcpy(cmess, message.c_str());
65 OBJpostEvent(
SO3_LOGS_MSG, SCOL_PTR SRoot::getSingletonPtr(), SCOL_PTR cmess);
93 SRoot::getSingleton().SetLogEnable(
false);
94 MMsetPointer<SRoot*>(m, MTOP(obj), 0);
119 if (SRoot::getSingletonPtr() == 0)
124 obj = OBJfindTH(m,
SO3LOGS,
id);
128 if (MMfetch(m, obj, OFFOBJREF0 + SO3_LOGS_CB * 2) == NIL)
133 MMsetglobal(m, OFFSCCUR, MMfetch(m, obj, OFFOBJCHN));
134 if (MMpush(m, MMgetglobal(m, OFFSCCUR)))
return MERRMEM;
137 if (MMpush(m, MMfetch(m, obj, OFFOBJREF0 + SO3_LOGS_CB * 2)))
return MERRMEM;
140 if (Mpushstrbloc(m, (
char*)
param))
return MERRMEM;
143 if (MMpush(m, MMfetch(m, obj, OFFOBJREF0 + SO3_LOGS_CB * 2 + 1)))
return MERRMEM;
146 return OBJcallreflex(m, 0);
168 int flag = MMpull(m);
170 int reflex = MMpull(m);
171 int chan = MMget(m, 0);
179 if (SRoot::getSingletonPtr() == 0)
185 int n = OBJfindTH(m,
SO3LOGS, SCOL_PTR SRoot::getSingletonPtr());
188 n = MMfetch(m, n, OFFOBJMAG);
193 if ((MMpushPointer(m, SRoot::getSingletonPtr()) != 0))
199 OBJcreate(m,
SO3LOGS, SCOL_PTR SRoot::getSingletonPtr(), NIL, 0);
203 Ogre::LogMessageLevel logFlag = Ogre::LML_NORMAL;
205 logFlag = (Ogre::LogMessageLevel)MTOI(flag);
207 SRoot::getSingleton().SetLogMask(logFlag);
208 SRoot::getSingleton().SetLogEnable(reflex == NIL ?
false :
true);
213 OBJaddreflex(m,
SO3LOGS, SO3_LOGS_CB);
215 MMset(m, 0, ITOM(1));
222 {
"SO3Logs", TYPTYPE, NULL, NULL },
223 {
"SO3CbLogs", 4,
"fun [Chn fun [S u0] u1 u0 I] I",
SO3CbLogs }
ScolLogEventsListener * scolLogEventsListener
int getLogCallback(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the Scene Log event callback.
int destroyLogs(mmachine m, SCOL_PTR_TYPE handle, int obj)
function to destroy an SO3_LOGS in scol
int SCOLloadLogs(mmachine m, cbmachine w)
Load the SO3Engine Logs function.
NativeDefinition natSO3Log[]
int SCOLfreeLogs()
free the SO3Engine Logs function
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
SCOL_EXPORT void SCOL_PTR_TYPE param
int SO3CbLogs(mmachine m)
SO3CbLogs : Define the callback scol had to be called when there is a log event.