//------------------------------------------------------------------------------ // close debug log file //------------------------------------------------------------------------------ SQRESULT SQ_debugLog_close (HSQUIRRELVM v) { if (serial.IsOpen()) { //fclose(gpDebugLogFile); serial.Close(); } return SQ_OK; }
//------------------------------------------------------------------------------ // print an int to the debug log file //------------------------------------------------------------------------------ SQRESULT SQ_debugLog_printInt (HSQUIRRELVM v, SQInteger val) { if (serial.IsOpen()) { int inVal = (int)val; //fprintf(gpDebugLogFile, "%d", inVal); char dst[32]; sprintf_s(dst, 32, "%d", inVal); SerialWrite(dst); } return SQ_OK; }
//------------------------------------------------------------------------------ // print a float to the debug log file //------------------------------------------------------------------------------ SQRESULT SQ_debugLog_printFloat (HSQUIRRELVM v, SQFloat val) { if (serial.IsOpen()) { float inVal = (float)val; //fprintf(gpDebugLogFile, "%f", inVal); char dst[32]; sprintf_s(dst, 32, "%f", inVal); SerialWrite(dst); } return SQ_OK; }
//------------------------------------------------------------------------------ // print a sting to the debug log file //------------------------------------------------------------------------------ SQRESULT SQ_debugLog_print (HSQUIRRELVM v, const SQChar *pTxt) { if (serial.IsOpen()) { wchar_t *inTxt = (wchar_t *)pTxt; //fwprintf_s(gpDebugLogFile, inTxt); char dst[100]; sprintf_s(dst, 100, "%ls", inTxt); SerialWrite(dst); } return SQ_OK; }
//------------------------------------------------------------------------------ // print a float vector to the debug log file //------------------------------------------------------------------------------ SQRESULT SQ_debugLog_printVector (HSQUIRRELVM v, SQFloat valX, SQFloat valY, SQFloat valZ) { if (serial.IsOpen()) { float inValX = (float)valX; float inValY = (float)valY; float inValZ = (float)valZ; //fprintf(gpDebugLogFile, "%f, %f, %f", inValX, inValY, inValZ); char dst[100]; sprintf_s(dst, 100, "%f, %f, %f", inValX, inValY, inValZ); SerialWrite(dst); } return SQ_OK; }