mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Merge branch 'Preview4_0' into alpha40/updateSDL2022
This commit is contained in:
commit
af88302935
34 changed files with 478 additions and 547 deletions
|
|
@ -247,7 +247,7 @@ bool TerrainAsset::getAssetByFilename(StringTableEntry fileName, AssetPtr<Terrai
|
|||
{
|
||||
//Didn't find any assets
|
||||
//If possible, see if we can run an in-place import and the get the asset from that
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
Con::warnf("TerrainAsset::getAssetByFilename - Attempted to in-place import a terrainFile(%s) that had no associated asset", fileName);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -399,7 +399,12 @@ U32 ConditionalExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
|
|||
|
||||
TypeReq ConditionalExprNode::getPreferredType()
|
||||
{
|
||||
return trueExpr->getPreferredType();
|
||||
// We can't make it calculate a type based on subsequent expressions as the expression
|
||||
// could be a string, or just numbers. To play it safe, stringify anything that deals with
|
||||
// a conditional, and let the interpreter cast as needed to other types safely.
|
||||
//
|
||||
// See: Regression Test 7 in ScriptTest. It has a string result in the else portion of the ?: ternary.
|
||||
return TypeReqString;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1079,6 +1079,22 @@ TEST(Script, MiscRegressions)
|
|||
)");
|
||||
|
||||
ASSERT_EQ(regression6.getBool(), true);
|
||||
|
||||
ConsoleValue regression7 = RunScript(R"(
|
||||
function Tween::vectorAdd(%v1, %v2)
|
||||
{
|
||||
%temp = "";
|
||||
for (%i = 0; %i < getWordCount(%v1); %i++) {
|
||||
%e = getWord(%v1, %i) + getWord(%v2, %i);
|
||||
%temp = %i == 0 ? %e : %temp SPC %e;
|
||||
}
|
||||
|
||||
return %temp;
|
||||
}
|
||||
return Tween::vectorAdd("1 2 3", "4 5 6");
|
||||
)");
|
||||
|
||||
ASSERT_STREQ(regression7.getString(), "5 7 9");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ void GFXCardProfiler::loadProfileScript(const char* aScriptName)
|
|||
|
||||
if(data == NULL)
|
||||
{
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
Con::warnf(" - No card profile %s exists", scriptName.c_str());
|
||||
#endif
|
||||
return;
|
||||
|
|
@ -54,7 +54,7 @@ void GFXCardProfiler::loadProfileScript(const char* aScriptName)
|
|||
|
||||
const char *script = static_cast<const char *>(data);
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
Con::printf(" - Loaded card profile %s", scriptName.c_str());
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ GFXGLTextureObject::GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *p
|
|||
mFrameAllocatorPtr(NULL)
|
||||
{
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
mFrameAllocatorMarkGuard = FrameAllocator::getWaterMark();
|
||||
#endif
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ GFXLockedRect* GFXGLTextureObject::lock(U32 mipLevel, RectI *inRect)
|
|||
mFrameAllocatorMark = FrameAllocator::getWaterMark();
|
||||
mFrameAllocatorPtr = (U8*)FrameAllocator::alloc( size );
|
||||
mLockedRect.bits = mFrameAllocatorPtr;
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
mFrameAllocatorMarkGuard = FrameAllocator::getWaterMark();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@ private:
|
|||
|
||||
//FrameAllocator
|
||||
U32 mFrameAllocatorMark;
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
U32 mFrameAllocatorMarkGuard;
|
||||
#endif
|
||||
U8 *mFrameAllocatorPtr;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_READ_FRAMEBUFFER, GL
|
|||
GFXGLPreserveInteger TORQUE_CONCAT(preserve2_, __LINE__) (GL_DRAW_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindFramebuffer)
|
||||
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
|
||||
// Handy macro for checking the status of a framebuffer. Framebuffers can fail in
|
||||
// all sorts of interesting ways, these are just the most common. Further, no existing GL profiling
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void TamlCustomField::set( const char* pFieldName, const char* pFieldValue )
|
|||
// Set field name.
|
||||
mFieldName = StringTable->insert( pFieldName );
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
// Is the field value too big?
|
||||
if ( dStrlen(pFieldValue) >= sizeof(mFieldValue) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ public:
|
|||
private:
|
||||
inline TamlCustomField* registerField( TamlCustomField* pCustomField )
|
||||
{
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
// Ensure a field name conflict does not exist.
|
||||
for( Vector<TamlCustomField*>::iterator nodeFieldItr = mFields.begin(); nodeFieldItr != mFields.end(); ++nodeFieldItr )
|
||||
{
|
||||
|
|
@ -724,7 +724,7 @@ public:
|
|||
// Set ignore-empty flag.
|
||||
pCustomNode->setIgnoreEmpty( ignoreEmpty );
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
#ifdef TORQUE_DEBUG
|
||||
// Ensure a node name conflict does not exist.
|
||||
for( TamlCustomNodeVector::iterator nodeItr = mNodes.begin(); nodeItr != mNodes.end(); ++nodeItr )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@
|
|||
#if defined(__FreeBSD__)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
#include <utime.h>
|
||||
|
||||
/* these are for reading directors, getting stats, etc. */
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ void DiffuseVertColorFeatureHLSL::processVert( Vector< ShaderComponent* >& comp
|
|||
outColor->setStructName( "OUT" );
|
||||
outColor->setType( "float4" );
|
||||
|
||||
output = new GenOp( " @ = @.bgra;\r\n", outColor, inColor );
|
||||
output = new GenOp( " @ = @;\r\n", outColor, inColor );
|
||||
}
|
||||
else
|
||||
output = NULL; // Nothing we need to do.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue