mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
Merge branch 'Preview4_0_DevHead' into tsneo
# Conflicts: # Engine/source/console/consoleInternal.cpp
This commit is contained in:
commit
acde0c3f0b
17 changed files with 96 additions and 20 deletions
|
|
@ -135,6 +135,8 @@ void tc_spinloop()
|
|||
// Pause would do nothing on the Xbox. Threads are not scheduled.
|
||||
#elif defined( _WIN64 )
|
||||
YieldProcessor( );
|
||||
#elif (defined( __arm64__ ) && defined( __APPLE__ )) || defined( __arch64__ )
|
||||
pthread_yield_np();
|
||||
#else
|
||||
__asm { pause };
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
|
|||
{
|
||||
U32 ip;
|
||||
st.read(&ip);
|
||||
#ifdef TORQUE_CPU_X64
|
||||
#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64)
|
||||
*(U64*)(code + ip) = (U64)ste;
|
||||
#else
|
||||
code[ip] = *((U32 *)&ste);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace Compiler
|
|||
|
||||
void evalSTEtoCode(StringTableEntry ste, U32 ip, U32 *ptr)
|
||||
{
|
||||
#ifdef TORQUE_CPU_X64
|
||||
#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64)
|
||||
*(U64*)(ptr) = (U64)ste;
|
||||
#else
|
||||
*ptr = (U32)ste;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ namespace Compiler
|
|||
|
||||
inline StringTableEntry CodeToSTE(U32 *code, U32 ip)
|
||||
{
|
||||
#ifdef TORQUE_CPU_X64
|
||||
#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64)
|
||||
return (StringTableEntry)(*((U64*)(code + ip)));
|
||||
#else
|
||||
return (StringTableEntry)(*(code + ip));
|
||||
|
|
|
|||
|
|
@ -1401,7 +1401,7 @@ ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, ExprEvalSta
|
|||
result.setInt(cb.mIntCallbackFunc(state->thisObject, argc, argv));
|
||||
break;
|
||||
case FloatCallbackType:
|
||||
result.setFloat(cb.mBoolCallbackFunc(state->thisObject, argc, argv));
|
||||
result.setFloat(cb.mFloatCallbackFunc(state->thisObject, argc, argv));
|
||||
break;
|
||||
case VoidCallbackType:
|
||||
cb.mVoidCallbackFunc(state->thisObject, argc, argv);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
#include "core/util/md5.h"
|
||||
#include "console/enginePrimitives.h"
|
||||
|
||||
#if defined (TORQUE_OS_MAC) && defined(TORQUE_CPU_X64)
|
||||
#if defined (TORQUE_OS_MAC) && (defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64))
|
||||
typedef unsigned int unsigned32;
|
||||
#else
|
||||
typedef unsigned long unsigned32;
|
||||
|
|
|
|||
|
|
@ -1760,7 +1760,11 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */)
|
|||
const char *pref = Con::getVariable( "$pref::Video::mode" );
|
||||
mode.parseFromString( pref );
|
||||
mode.antialiasLevel = 0;
|
||||
Point2I winPos = mPlatformWindow->getPosition(); // Save position so we can put window back.
|
||||
mPlatformWindow->setVideoMode(mode);
|
||||
// setVideoMode (above) will center the window on the display device. If the window had been positioned
|
||||
// by the user or from script, put it back where it was before the light manager change.
|
||||
mPlatformWindow->setPosition(winPos);
|
||||
|
||||
Con::printf( "AntiAliasing has been disabled; it is not compatible with AdvancedLighting." );
|
||||
}
|
||||
|
|
@ -1772,7 +1776,11 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */)
|
|||
if ( prefAA != mode.antialiasLevel )
|
||||
{
|
||||
mode.parseFromString( pref );
|
||||
Point2I winPos = mPlatformWindow->getPosition(); // Save position so we can put window back.
|
||||
mPlatformWindow->setVideoMode(mode);
|
||||
// setVideoMode (above) will center the window on the display device. If the window had been positioned
|
||||
// by the user or from script, put it back where it was before the light manager change.
|
||||
mPlatformWindow->setPosition(winPos);
|
||||
|
||||
Con::printf( "AntiAliasing has been enabled while running BasicLighting." );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,11 @@ typedef unsigned long U64;
|
|||
# define TORQUE_CPU_X64
|
||||
# define TORQUE_LITTLE_ENDIAN
|
||||
|
||||
#elif (defined( __arm64__ ) && defined( __APPLE__ )) || defined( __arch64__ )
|
||||
# define TORQUE_CPU_STRING "Arm 64"
|
||||
# define TORQUE_CPU_ARM64
|
||||
# define TORQUE_LITTLE_ENDIAN
|
||||
|
||||
#else
|
||||
# error "GCC: Unsupported Target CPU"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ static const F32 F32_MAX = F32(3.402823466e+38F); ///< Constant
|
|||
#endif
|
||||
|
||||
/// Integral type matching the host's memory address width.
|
||||
#ifdef TORQUE_CPU_X64
|
||||
#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64)
|
||||
typedef U64 MEM_ADDRESS;
|
||||
#else
|
||||
typedef U32 MEM_ADDRESS;
|
||||
|
|
|
|||
|
|
@ -34,21 +34,29 @@ static MRandomLCG sgPlatRandom;
|
|||
|
||||
U32 Platform::getMathControlState()
|
||||
{
|
||||
#ifdef TORQUE_CPU_X86
|
||||
U16 cw;
|
||||
asm("fstcw %0" : "=m" (cw) :);
|
||||
return cw;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Platform::setMathControlState(U32 state)
|
||||
{
|
||||
#ifdef TORQUE_CPU_X86
|
||||
U16 cw = state;
|
||||
asm("fldcw %0" : : "m" (cw));
|
||||
#endif
|
||||
}
|
||||
|
||||
void Platform::setMathControlStateKnown()
|
||||
{
|
||||
#ifdef TORQUE_CPU_X86
|
||||
U16 cw = 0x27F;
|
||||
asm("fldcw %0" : : "m" (cw));
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
|
|
|
|||
|
|
@ -207,7 +207,6 @@ void PlatformWindowSDL::_setVideoMode( const GFXVideoMode &mode )
|
|||
SDL_MaximizeWindow(mWindowHandle);
|
||||
}
|
||||
|
||||
getScreenResChangeSignal().trigger(this, true);
|
||||
mSuppressReset = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue