Merge remote-tracking branch 'devhead/Preview4_0' into tsneo

# Conflicts:
#	Engine/source/platform/types.visualc.h
#	Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
#	Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript
#	Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript
#	Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui
This commit is contained in:
Jeff Hutchinson 2021-09-01 22:26:23 -04:00
commit 17231ca9fb
51 changed files with 736 additions and 488 deletions

View file

@ -438,15 +438,15 @@ ImageAsset::ImageTypes ImageAsset::getImageTypeFromName(const char* name)
}
DefineEngineMethod(ImageAsset, getImagePath, const char*, (), ,
"Creates an instance of the given GameObject given the asset definition.\n"
"@return The GameObject entity created from the asset.")
"Gets the image filepath of this asset.\n"
"@return File path of the image file.")
{
return object->getImagePath();
}
DefineEngineMethod(ImageAsset, getImageInfo, const char*, (), ,
"Creates an instance of the given GameObject given the asset definition.\n"
"@return The GameObject entity created from the asset.")
"Gets the info and properties of the image.\n"
"@return The info/properties of the image.")
{
return object->getImageInfo();
}

View file

@ -429,6 +429,13 @@ void TerrainAsset::copyTo(SimObject* object)
Parent::copyTo(object);
}
DefineEngineMethod(TerrainAsset, getTerrainFilePath, const char*, (), ,
"Gets the terrain filepath of this asset.\n"
"@return File path of the terrain file.")
{
return object->getTerrainFilePath();
}
//-----------------------------------------------------------------------------
// GuiInspectorTypeAssetId
//-----------------------------------------------------------------------------

View file

@ -284,8 +284,8 @@ class String::StringData : protected StringDataImpl
delete [] mUTF16;
}
void* operator new(size_t size, U32 len);
void* operator new( size_t size, U32 len, DataChunker& chunker );
void* TORQUE_NOINLINE operator new(size_t size, U32 len);
void* TORQUE_NOINLINE operator new( size_t size, U32 len, DataChunker& chunker );
void operator delete(void *);
bool isShared() const

View file

@ -881,6 +881,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 3, mProfile );
@ -926,6 +932,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 2, mProfile );
@ -957,6 +969,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 1, mProfile );
}
@ -976,6 +994,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
drawUtil->drawRect( baseRect, mProfile->mBorderColorNA );
}
}
@ -1095,6 +1119,13 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// If we're rendering a bitmap border, then it will take care of the arrow.
if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Draw a triangle (down arrow)
S32 left = baseRect.point.x + baseRect.extent.x - 12;
S32 right = left + 8;

View file

@ -150,7 +150,7 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
{
VariableField newField;
newField.mFieldName = StringTable->insert(name);
newField.mFieldLabel = StringTable->insert(label);
newField.mFieldLabel = StringTable->insert(label, true);
newField.mFieldTypeName = StringTable->insert(typeName);
newField.mFieldDescription = StringTable->insert(description);
newField.mDefaultValue = StringTable->insert(defaultValue);

View file

@ -110,7 +110,7 @@ public:
bool isAlive();
/// Returns the platform specific thread id for this thread.
U32 getId();
dsize_t getId();
};
@ -122,12 +122,12 @@ class ThreadManager
struct MainThreadId
{
U32 mId;
dsize_t mId;
MainThreadId()
{
mId = ThreadManager::getCurrentThreadId();
}
U32 get()
dsize_t get()
{
// Okay, this is a bit soso. The main thread ID may get queried during
// global ctor phase before MainThreadId's ctor ran. Since global
@ -152,21 +152,21 @@ public:
static bool isMainThread();
/// Returns true if threadId is the same as the calling thread's id.
static bool isCurrentThread(U32 threadId);
static bool isCurrentThread(dsize_t threadId);
/// Returns true if the 2 thread ids represent the same thread. Some thread
/// APIs return an opaque object as a thread id, so the == operator cannot
/// reliably compare thread ids.
// this comparator is needed by pthreads and ThreadManager.
static bool compare(U32 threadId_1, U32 threadId_2);
static bool compare(dsize_t threadId_1, dsize_t threadId_2);
/// Returns the platform specific thread id of the calling thread. Some
/// platforms do not guarantee that this ID stays the same over the life of
/// the thread, so use ThreadManager::compare() to compare thread ids.
static U32 getCurrentThreadId();
static dsize_t getCurrentThreadId();
/// Returns the platform specific thread id ot the main thread.
static U32 getMainThreadId() { return smMainThreadId.get(); }
static dsize_t getMainThreadId() { return smMainThreadId.get(); }
/// Each thread should add itself to the thread pool the first time it runs.
static void addThread(Thread* thread)
@ -184,7 +184,7 @@ public:
ThreadManager &manager = *ManagedSingleton< ThreadManager >::instance();
manager.poolLock.lock();
U32 threadID = thread->getId();
dsize_t threadID = thread->getId();
for(U32 i = 0;i < manager.threadPool.size();++i)
{
if( compare( manager.threadPool[i]->getId(), threadID ) )
@ -199,7 +199,7 @@ public:
/// Searches the pool of known threads for a thread whose id is equivalent to
/// the given threadid. Compares thread ids with ThreadManager::compare().
static Thread* getThreadById(U32 threadid)
static Thread* getThreadById(dsize_t threadid)
{
AssertFatal(threadid != 0, "ThreadManager::getThreadById() Searching for a bad thread id.");
Thread* ret = NULL;
@ -236,9 +236,9 @@ inline bool ThreadManager::isMainThread()
return compare( ThreadManager::getCurrentThreadId(), smMainThreadId.get() );
}
inline bool ThreadManager::isCurrentThread(U32 threadId)
inline bool ThreadManager::isCurrentThread(dsize_t threadId)
{
U32 current = getCurrentThreadId();
dsize_t current = getCurrentThreadId();
return compare(current, threadId);
}

View file

@ -46,6 +46,7 @@ typedef unsigned long U64;
#define TORQUE_FORCEINLINE __attribute__((always_inline))
#define TORQUE_CASE_FALLTHROUGH __attribute__((fallthrough))
#define TORQUE_NOINLINE __attribute__ ((noinline))
#define TORQUE_UNLIKELY
//--------------------------------------
// Identify the compiler string

View file

@ -134,9 +134,9 @@ bool Thread::isAlive()
return ( !mData->mDead );
}
U32 Thread::getId()
dsize_t Thread::getId()
{
return (U32)mData->mThreadID;
return (dsize_t)mData->mThreadID;
}
void Thread::_setName( const char* )
@ -145,12 +145,12 @@ void Thread::_setName( const char* )
// that one thread you are looking for is just so much fun.
}
U32 ThreadManager::getCurrentThreadId()
dsize_t ThreadManager::getCurrentThreadId()
{
return (U32)SDL_ThreadID();
return (dsize_t)SDL_ThreadID();
}
bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
bool ThreadManager::compare(dsize_t threadId_1, dsize_t threadId_2)
{
return (threadId_1 == threadId_2);
}

View file

@ -43,7 +43,7 @@ public:
Thread* mThread;
HANDLE mThreadHnd;
Semaphore mGateway;
U32 mThreadID;
dsize_t mThreadID;
U32 mDead;
PlatformThreadData()
@ -157,7 +157,7 @@ bool Thread::isAlive()
return ( !mData->mDead );
}
U32 Thread::getId()
dsize_t Thread::getId()
{
return mData->mThreadID;
}
@ -197,12 +197,12 @@ void Thread::_setName( const char* name )
#endif
}
U32 ThreadManager::getCurrentThreadId()
dsize_t ThreadManager::getCurrentThreadId()
{
return GetCurrentThreadId();
}
bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
bool ThreadManager::compare(dsize_t threadId_1, dsize_t threadId_2)
{
return (threadId_1 == threadId_2);
}

View file

@ -137,9 +137,9 @@ bool Thread::isAlive()
return ( !mData->mDead );
}
U32 Thread::getId()
dsize_t Thread::getId()
{
return (U32)mData->mThreadID;
return (dsize_t)mData->mThreadID;
}
void Thread::_setName( const char* )
@ -148,12 +148,12 @@ void Thread::_setName( const char* )
// that one thread you are looking for is just so much fun.
}
U32 ThreadManager::getCurrentThreadId()
dsize_t ThreadManager::getCurrentThreadId()
{
return (U32)pthread_self();
return (dsize_t)pthread_self();
}
bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
bool ThreadManager::compare(dsize_t threadId_1, dsize_t threadId_2)
{
return pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
}

View file

@ -442,7 +442,7 @@ inline bool isSFXThread()
{
ThreadSafeRef< SFXUpdateThread > sfxThread = UPDATE_THREAD();
U32 threadId;
dsize_t threadId;
if( sfxThread != NULL )
threadId = sfxThread->getId();
else