mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +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.
|
// Pause would do nothing on the Xbox. Threads are not scheduled.
|
||||||
#elif defined( _WIN64 )
|
#elif defined( _WIN64 )
|
||||||
YieldProcessor( );
|
YieldProcessor( );
|
||||||
|
#elif (defined( __arm64__ ) && defined( __APPLE__ )) || defined( __arch64__ )
|
||||||
|
pthread_yield_np();
|
||||||
#else
|
#else
|
||||||
__asm { pause };
|
__asm { pause };
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
|
||||||
{
|
{
|
||||||
U32 ip;
|
U32 ip;
|
||||||
st.read(&ip);
|
st.read(&ip);
|
||||||
#ifdef TORQUE_CPU_X64
|
#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64)
|
||||||
*(U64*)(code + ip) = (U64)ste;
|
*(U64*)(code + ip) = (U64)ste;
|
||||||
#else
|
#else
|
||||||
code[ip] = *((U32 *)&ste);
|
code[ip] = *((U32 *)&ste);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Compiler
|
||||||
|
|
||||||
void evalSTEtoCode(StringTableEntry ste, U32 ip, U32 *ptr)
|
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;
|
*(U64*)(ptr) = (U64)ste;
|
||||||
#else
|
#else
|
||||||
*ptr = (U32)ste;
|
*ptr = (U32)ste;
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ namespace Compiler
|
||||||
|
|
||||||
inline StringTableEntry CodeToSTE(U32 *code, U32 ip)
|
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)));
|
return (StringTableEntry)(*((U64*)(code + ip)));
|
||||||
#else
|
#else
|
||||||
return (StringTableEntry)(*(code + ip));
|
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));
|
result.setInt(cb.mIntCallbackFunc(state->thisObject, argc, argv));
|
||||||
break;
|
break;
|
||||||
case FloatCallbackType:
|
case FloatCallbackType:
|
||||||
result.setFloat(cb.mBoolCallbackFunc(state->thisObject, argc, argv));
|
result.setFloat(cb.mFloatCallbackFunc(state->thisObject, argc, argv));
|
||||||
break;
|
break;
|
||||||
case VoidCallbackType:
|
case VoidCallbackType:
|
||||||
cb.mVoidCallbackFunc(state->thisObject, argc, argv);
|
cb.mVoidCallbackFunc(state->thisObject, argc, argv);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
#include "core/util/md5.h"
|
#include "core/util/md5.h"
|
||||||
#include "console/enginePrimitives.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;
|
typedef unsigned int unsigned32;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long unsigned32;
|
typedef unsigned long unsigned32;
|
||||||
|
|
|
||||||
|
|
@ -1760,7 +1760,11 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */)
|
||||||
const char *pref = Con::getVariable( "$pref::Video::mode" );
|
const char *pref = Con::getVariable( "$pref::Video::mode" );
|
||||||
mode.parseFromString( pref );
|
mode.parseFromString( pref );
|
||||||
mode.antialiasLevel = 0;
|
mode.antialiasLevel = 0;
|
||||||
|
Point2I winPos = mPlatformWindow->getPosition(); // Save position so we can put window back.
|
||||||
mPlatformWindow->setVideoMode(mode);
|
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." );
|
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 )
|
if ( prefAA != mode.antialiasLevel )
|
||||||
{
|
{
|
||||||
mode.parseFromString( pref );
|
mode.parseFromString( pref );
|
||||||
|
Point2I winPos = mPlatformWindow->getPosition(); // Save position so we can put window back.
|
||||||
mPlatformWindow->setVideoMode(mode);
|
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." );
|
Con::printf( "AntiAliasing has been enabled while running BasicLighting." );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,11 @@ typedef unsigned long U64;
|
||||||
# define TORQUE_CPU_X64
|
# define TORQUE_CPU_X64
|
||||||
# define TORQUE_LITTLE_ENDIAN
|
# 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
|
#else
|
||||||
# error "GCC: Unsupported Target CPU"
|
# error "GCC: Unsupported Target CPU"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ static const F32 F32_MAX = F32(3.402823466e+38F); ///< Constant
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Integral type matching the host's memory address width.
|
/// 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;
|
typedef U64 MEM_ADDRESS;
|
||||||
#else
|
#else
|
||||||
typedef U32 MEM_ADDRESS;
|
typedef U32 MEM_ADDRESS;
|
||||||
|
|
|
||||||
|
|
@ -34,21 +34,29 @@ static MRandomLCG sgPlatRandom;
|
||||||
|
|
||||||
U32 Platform::getMathControlState()
|
U32 Platform::getMathControlState()
|
||||||
{
|
{
|
||||||
|
#ifdef TORQUE_CPU_X86
|
||||||
U16 cw;
|
U16 cw;
|
||||||
asm("fstcw %0" : "=m" (cw) :);
|
asm("fstcw %0" : "=m" (cw) :);
|
||||||
return cw;
|
return cw;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::setMathControlState(U32 state)
|
void Platform::setMathControlState(U32 state)
|
||||||
{
|
{
|
||||||
|
#ifdef TORQUE_CPU_X86
|
||||||
U16 cw = state;
|
U16 cw = state;
|
||||||
asm("fldcw %0" : : "m" (cw));
|
asm("fldcw %0" : : "m" (cw));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::setMathControlStateKnown()
|
void Platform::setMathControlStateKnown()
|
||||||
{
|
{
|
||||||
|
#ifdef TORQUE_CPU_X86
|
||||||
U16 cw = 0x27F;
|
U16 cw = 0x27F;
|
||||||
asm("fldcw %0" : : "m" (cw));
|
asm("fldcw %0" : : "m" (cw));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,6 @@ void PlatformWindowSDL::_setVideoMode( const GFXVideoMode &mode )
|
||||||
SDL_MaximizeWindow(mWindowHandle);
|
SDL_MaximizeWindow(mWindowHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
getScreenResChangeSignal().trigger(this, true);
|
|
||||||
mSuppressReset = false;
|
mSuppressReset = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,13 @@ function configureCanvas()
|
||||||
|
|
||||||
// Actually set the new video mode
|
// Actually set the new video mode
|
||||||
Canvas.setVideoMode(%resX, %resY, %fs, %bpp, %rate, %aa);
|
Canvas.setVideoMode(%resX, %resY, %fs, %bpp, %rate, %aa);
|
||||||
|
|
||||||
|
// For borderless on non-windows OS, move the window into position.
|
||||||
|
if (($pref::Video::deviceMode == $Video::ModeBorderless) && ($platform !$= "windows"))
|
||||||
|
{
|
||||||
|
%borderlessPos = getWords(Canvas.getMonitorUsableRect($pref::Video::deviceId), 0, 1);
|
||||||
|
Canvas.setWindowPosition(%borderlessPos);
|
||||||
|
}
|
||||||
Canvas.setFocus();
|
Canvas.setFocus();
|
||||||
|
|
||||||
// Lock and unlock the mouse to force the position to sync with the platform window
|
// Lock and unlock the mouse to force the position to sync with the platform window
|
||||||
|
|
@ -184,6 +191,12 @@ function GuiCanvas::checkCanvasRes(%this, %mode, %deviceId, %deviceMode, %startu
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (%deviceMode == $Video::ModeFullscreen)
|
||||||
|
{ // Fullscreen must match the aspect ratio of the monitor
|
||||||
|
%deviceRes = getWords(%this.getMonitorRect(%deviceId), 2);
|
||||||
|
if (mRoundColour(%resX / %resY, 2) != mRoundColour(%deviceRes.x / %deviceRes.y, 2))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!%startup)
|
if (!%startup)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -238,5 +251,13 @@ function GuiCanvas::getBestCanvasRes(%this, %deviceId, %deviceMode)
|
||||||
%bestRes = %testRes;
|
%bestRes = %testRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Borderless on non-windows OS should be the usable screen area.
|
||||||
|
if ((%deviceMode == $Video::ModeBorderless) && ($platform !$= "windows"))
|
||||||
|
{
|
||||||
|
%deviceRect = getWords(%this.getMonitorUsableRect(%deviceId), 2);
|
||||||
|
%bestRes = setWord(%bestRes, $WORD::RES_X, %deviceRect.x);
|
||||||
|
%bestRes = setWord(%bestRes, $WORD::RES_Y, %deviceRect.y);
|
||||||
|
}
|
||||||
|
|
||||||
return %bestRes;
|
return %bestRes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -845,6 +845,13 @@ function getScreenResolutionList(%deviceID, %deviceMode)
|
||||||
{
|
{
|
||||||
%returnsList = "";
|
%returnsList = "";
|
||||||
|
|
||||||
|
// For borderless on non-windows OS only add the usable area.
|
||||||
|
if ((%deviceMode == $Video::ModeBorderless) && ($platform !$= "windows"))
|
||||||
|
{
|
||||||
|
%borderlessRes = getWords(Canvas.getMonitorUsableRect(%newDeviceID), 2);
|
||||||
|
return _makePrettyResString(%borderlessRes);
|
||||||
|
}
|
||||||
|
|
||||||
%resCount = Canvas.getModeCount();
|
%resCount = Canvas.getModeCount();
|
||||||
for (%i = 0; %i < %resCount; %i++)
|
for (%i = 0; %i < %resCount; %i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -627,9 +627,14 @@ function onDisplayModeChange(%val)
|
||||||
}
|
}
|
||||||
%resolutionList = getScreenResolutionList(%newDeviceID, %newDeviceMode);
|
%resolutionList = getScreenResolutionList(%newDeviceID, %newDeviceMode);
|
||||||
|
|
||||||
// If we're switching to borderless, default to monitor res
|
|
||||||
if (%newDeviceMode == $Video::ModeBorderless)
|
if (%newDeviceMode == $Video::ModeBorderless)
|
||||||
%newRes = getWords(Canvas.getMonitorRect(%newDeviceID), 2);
|
{ // If we're switching to borderless, default to monitor res on Windows OS,
|
||||||
|
// monitor usable area for other platforms.
|
||||||
|
if ($platform $= "windows")
|
||||||
|
%newRes = getWords(Canvas.getMonitorRect(%newDeviceID), 2);
|
||||||
|
else
|
||||||
|
%newRes = getWords(Canvas.getMonitorUsableRect(%newDeviceID), 2);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ // Otherwise, if our old resolution is still in the list, attempt to reset it.
|
{ // Otherwise, if our old resolution is still in the list, attempt to reset it.
|
||||||
%oldRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
|
%oldRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ project(lpng)
|
||||||
|
|
||||||
# addDef(PNG_NO_ASSEMBLER_CODE)
|
# addDef(PNG_NO_ASSEMBLER_CODE)
|
||||||
|
|
||||||
|
# Issues with Neon at the moment (Arm support)
|
||||||
|
# https://sourceforge.net/p/libpng/bugs/281/
|
||||||
|
set(PNG_ARM_NEON off CACHE STRING "")
|
||||||
|
add_definitions(-DPNG_ARM_NEON_OPT=0)
|
||||||
|
|
||||||
addInclude(${libDir}/zlib)
|
addInclude(${libDir}/zlib)
|
||||||
|
|
||||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,14 @@
|
||||||
<TorsionProject>
|
<TorsionProject>
|
||||||
<Name>@TORQUE_APP_NAME@</Name>
|
<Name>@TORQUE_APP_NAME@</Name>
|
||||||
<WorkingDir/>
|
<WorkingDir/>
|
||||||
<EntryScript>main.cs</EntryScript>
|
<EntryScript>main.@TORQUE_SCRIPT_EXTENSION@</EntryScript>
|
||||||
<DebugHook>dbgSetParameters( #port#, "#password#", true );</DebugHook>
|
<DebugHook>dbgSetParameters( #port#, "#password#", true );</DebugHook>
|
||||||
<Mods>
|
<Mods>
|
||||||
<Folder>core</Folder>
|
<Folder>core</Folder>
|
||||||
<Folder>scripts</Folder>
|
|
||||||
<Folder>art</Folder>
|
|
||||||
<Folder>levels</Folder>
|
|
||||||
<Folder>shaders</Folder>
|
|
||||||
<Folder>data</Folder>
|
<Folder>data</Folder>
|
||||||
<Folder>tools</Folder>
|
<Folder>tools</Folder>
|
||||||
</Mods>
|
</Mods>
|
||||||
<ScannerExts>cs; gui; taml; module;</ScannerExts>
|
<ScannerExts>@TORQUE_SCRIPT_EXTENSION@; gui; taml; module;</ScannerExts>
|
||||||
<Configs>
|
<Configs>
|
||||||
<Config>
|
<Config>
|
||||||
<Name>Release</Name>
|
<Name>Release</Name>
|
||||||
|
|
|
||||||
|
|
@ -692,8 +692,8 @@ if(WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
addFramework("Cocoa")
|
addFramework("Cocoa")
|
||||||
addFramework("OpenGL")
|
addFramework("OpenGL")
|
||||||
#These are needed by sdl2 static lib
|
#These are needed by sdl2 static lib
|
||||||
addFramework("CoreAudio")
|
addFramework("CoreAudio")
|
||||||
addFramework("AudioUnit")
|
addFramework("AudioUnit")
|
||||||
|
|
@ -704,9 +704,29 @@ if (APPLE)
|
||||||
addFramework("Carbon")
|
addFramework("Carbon")
|
||||||
addFramework("AudioToolbox")
|
addFramework("AudioToolbox")
|
||||||
addLib("iconv")
|
addLib("iconv")
|
||||||
#set a few arch defaults
|
endif()
|
||||||
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "OSX Architecture" FORCE)
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "OSX Deployment target" FORCE)
|
#detect Architecture
|
||||||
|
if (APPLE AND NOT IOS)
|
||||||
|
option(TORQUE_MACOS_UNIVERSAL_BINARY OFF)
|
||||||
|
|
||||||
|
# Detect architecture if not using universal
|
||||||
|
if (TORQUE_MACOS_UNIVERSAL_BINARY)
|
||||||
|
set(ARCHITECTURE_STRING_APPLE "x86_64;arm64")
|
||||||
|
set(DEPLOYMENT_TARGET_APPLE "10.13")
|
||||||
|
else()
|
||||||
|
check_c_compiler_flag("-arch arm64" armSupportedApple)
|
||||||
|
if(armSupportedApple)
|
||||||
|
set(ARCHITECTURE_STRING_APPLE "arm64")
|
||||||
|
set(DEPLOYMENT_TARGET_APPLE "11.0")
|
||||||
|
else()
|
||||||
|
set(ARCHITECTURE_STRING_APPLE "x86_64")
|
||||||
|
set(DEPLOYMENT_TARGET_APPLE "10.9")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_OSX_ARCHITECTURES ${ARCHITECTURE_STRING_APPLE} CACHE STRING "OSX Architecture" FORCE)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET_APPLE} CACHE STRING "OSX Deployment target" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue