mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
initial commit jolt
This commit is contained in:
parent
0c2aa5328c
commit
8acf7da95b
1086 changed files with 214612 additions and 4 deletions
57
Engine/lib/JoltPhysics/TestFramework/Utils/Log.mm
Normal file
57
Engine/lib/JoltPhysics/TestFramework/Utils/Log.mm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
||||
// SPDX-FileCopyrightText: 2025 Jorrit Rouwe
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <TestFramework.h>
|
||||
#include <Utils/Log.h>
|
||||
#include <cstdarg>
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
// Trace to TTY
|
||||
void TraceImpl(const char *inFMT, ...)
|
||||
{
|
||||
// Format the message
|
||||
va_list list;
|
||||
va_start(list, inFMT);
|
||||
char buffer[1024];
|
||||
vsnprintf(buffer, sizeof(buffer), inFMT, list);
|
||||
va_end(list);
|
||||
|
||||
// Log to the console
|
||||
printf("%s\n", buffer);
|
||||
}
|
||||
|
||||
void Alert(const char *inFMT, ...)
|
||||
{
|
||||
// Format the message
|
||||
va_list list;
|
||||
va_start(list, inFMT);
|
||||
char buffer[1024];
|
||||
vsnprintf(buffer, sizeof(buffer), inFMT, list);
|
||||
va_end(list);
|
||||
|
||||
Trace("Alert: %s", buffer);
|
||||
|
||||
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
|
||||
alert.messageText = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding];
|
||||
[alert runModal];
|
||||
}
|
||||
|
||||
void FatalError [[noreturn]] (const char *inFMT, ...)
|
||||
{
|
||||
// Format the message
|
||||
va_list list;
|
||||
va_start(list, inFMT);
|
||||
char buffer[1024];
|
||||
vsnprintf(buffer, sizeof(buffer), inFMT, list);
|
||||
va_end(list);
|
||||
|
||||
Trace("Fatal Error: %s", buffer);
|
||||
|
||||
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
|
||||
alert.messageText = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding];
|
||||
[alert runModal];
|
||||
|
||||
exit(1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue