Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.7 #1328

Merged
merged 35 commits into from Jun 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ad7b75d
Fix for fuzzy borders between textures
Nov 8, 2014
a3f08df
Fix for fuzzy borders
Jan 12, 2015
21443df
Added missing VS2012 template files to Empty template.
crabmusket Apr 7, 2015
fac856c
Merge pull request #1269 from eightyeight/add-vs2012-to-empty
crabmusket Apr 8, 2015
4a705c8
Move the Vagrant config into a distro-specific folder.
crabmusket Apr 19, 2015
656c04a
Merge pull request #1278 from eightyeight/tweak-vagrant
crabmusket Apr 20, 2015
f8d41a2
Merge pull request #1283 from Azaezel/randiiiiiii
Azaezel Apr 24, 2015
2f69ffd
Fixes issue #1277
Areloch Apr 21, 2015
eb03511
Merge pull request #1288 from eightyeight/issue1277
crabmusket Apr 27, 2015
12d435c
Remove value constructors for ConsoleValueRef & fix callbacks which u…
jamesu May 6, 2015
69f2efa
Merge remote-tracking branch 'lukaspj/Fuzzy-texture-border-fix' into …
crabmusket May 9, 2015
f3199b0
Fix for no sound output under Linux
Levitator1 Apr 28, 2015
ae4ac53
Remove comments.
crabmusket May 9, 2015
d4e5b47
Merge branch 'linux-sound' into release-3.7
crabmusket May 9, 2015
462aeef
opengl crashfix: cannot self-multiply a uniform. use a temp-variable.
Azaezel May 1, 2015
a879ad4
re-enables prior functionality allowing folks to post-editor modify t…
Azaezel Apr 8, 2015
9cfc852
Apply vignette settings properly for #1302.
crabmusket May 16, 2015
42bd368
Default to no bounds instead of crazy bounds. See #1287.
crabmusket May 16, 2015
587afaa
Case-sensitive filenames for Linux. See #1287.
crabmusket May 16, 2015
aacad0d
Merge pull request #1308 from eightyeight/linux-filenames
crabmusket May 16, 2015
49d2ab8
Add more info to fatal assert in SceneContainer. See #1287.
crabmusket May 16, 2015
b3d33c0
Merge pull request #1309 from eightyeight/add-details-to-assert
crabmusket May 16, 2015
c1e7041
Corrected another filename case.
crabmusket May 16, 2015
4f83afe
Merge pull request #1310 from eightyeight/more-case-issues
crabmusket May 16, 2015
d1bcc75
Merge pull request #1307 from eightyeight/forestitem-default-bounds
crabmusket May 17, 2015
5fcf385
Added toolbar expand button images.
crabmusket May 17, 2015
f827411
Merge pull request #1313 from eightyeight/editor-toolbar-images
crabmusket May 17, 2015
7a54e30
Merge pull request #1305 from eightyeight/vignette-settings
crabmusket May 22, 2015
d9436e6
Add workaround for issue #1292
jamesu May 15, 2015
c5dd723
Fix for rendering particles to the glow buffer
May 21, 2015
e18312b
Fixed a issue with the terrain blending having hard-edges.
Areloch Jun 8, 2015
2adbecb
Merge pull request #1324 from Areloch/37_Terr_Blend_Hotfix
Areloch Jun 8, 2015
6218d79
No need for server-only aps to generate visible textures. (the other …
Azaezel Jun 6, 2015
b5f8e9a
gfxGLDevice setShader fix.
rextimmy Jun 14, 2015
0759fe5
Added one more link to the readme.
crabmusket Jun 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Engine/source/T3D/gameBase/gameConnection.cpp
Expand Up @@ -999,8 +999,10 @@ bool GameConnection::readDemoStartBlock(BitStream *stream)

void GameConnection::demoPlaybackComplete()
{
static ConsoleValueRef demoPlaybackArgv[1] = { "demoPlaybackComplete" };
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(1, demoPlaybackArgv, false));
static const char* demoPlaybackArgv[1] = { "demoPlaybackComplete" };
static StringStackConsoleWrapper demoPlaybackCmd(1, demoPlaybackArgv);

Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(demoPlaybackCmd.argc, demoPlaybackCmd.argv, false));
Parent::demoPlaybackComplete();
}

Expand Down
5 changes: 3 additions & 2 deletions Engine/source/cinterface/c_scripting.cpp
Expand Up @@ -76,9 +76,10 @@ extern "C" {
if (!entry)
return "";

ConsoleValueRef argv[] = {"consoleExportXML"};
static const char* exportArgv[1] = { "consoleExportXML" };
static StringStackConsoleWrapper exportCmd(1, exportArgv);

return entry->cb.mStringCallbackFunc(NULL, 1, argv);
return entry->cb.mStringCallbackFunc(NULL, exportCmd.argc, exportCmd.argv);
}

MarshalNativeEntry* script_get_namespace_entry(const char* nameSpace, const char* name)
Expand Down
88 changes: 45 additions & 43 deletions Engine/source/console/console.cpp
Expand Up @@ -1534,9 +1534,16 @@ StringTableEntry getModNameFromPath(const char *path)
void postConsoleInput( RawData data )
{
// Schedule this to happen at the next time event.
ConsoleValue values[2];
ConsoleValueRef argv[2];
argv[0] = "eval";
argv[1] = ( const char* ) data.data;

values[0].init();
values[0].setStringValue("eval");
values[1].init();
values[1].setStringValue((const char*)data.data);
argv[0].value = &values[0];
argv[1].value = &values[1];

Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(2, argv, false));
}

Expand Down Expand Up @@ -1610,36 +1617,6 @@ ConsoleValueRef::ConsoleValueRef(const ConsoleValueRef &ref)
value = ref.value;
}

ConsoleValueRef::ConsoleValueRef(const char *newValue) : value(NULL)
{
*this = newValue;
}

ConsoleValueRef::ConsoleValueRef(const String &newValue) : value(NULL)
{
*this = (const char*)(newValue.utf8());
}

ConsoleValueRef::ConsoleValueRef(U32 newValue) : value(NULL)
{
*this = newValue;
}

ConsoleValueRef::ConsoleValueRef(S32 newValue) : value(NULL)
{
*this = newValue;
}

ConsoleValueRef::ConsoleValueRef(F32 newValue) : value(NULL)
{
*this = newValue;
}

ConsoleValueRef::ConsoleValueRef(F64 newValue) : value(NULL)
{
*this = newValue;
}

ConsoleValueRef& ConsoleValueRef::operator=(const ConsoleValueRef &newValue)
{
value = newValue.value;
Expand Down Expand Up @@ -1759,12 +1736,34 @@ const char *ConsoleValue::getStringValue()
return sval;
else if (type == TypeInternalStringStackPtr)
return STR.mBuffer + (uintptr_t)sval;
if(type == TypeInternalFloat)
return Con::getData(TypeF32, &fval, 0);
else if(type == TypeInternalInt)
return Con::getData(TypeS32, &ival, 0);
else
return Con::getData(type, dataPtr, 0, enumTable);
{
// We need a string representation, so lets create one
const char *internalValue = NULL;

if(type == TypeInternalFloat)
internalValue = Con::getData(TypeF32, &fval, 0);
else if(type == TypeInternalInt)
internalValue = Con::getData(TypeS32, &ival, 0);
else
return Con::getData(type, dataPtr, 0, enumTable); // We can't save sval here since it is the same as dataPtr

if (!internalValue)
return "";

U32 stringLen = dStrlen(internalValue);
U32 newLen = ((stringLen + 1) + 15) & ~15; // pad upto next cache line

if (bufferLen == 0)
sval = (char *) dMalloc(newLen);
else if(newLen > bufferLen)
sval = (char *) dRealloc(sval, newLen);

dStrcpy(sval, internalValue);
bufferLen = newLen;

return sval;
}
}

StringStackPtr ConsoleValue::getStringStackPtr()
Expand Down Expand Up @@ -1800,11 +1799,13 @@ void ConsoleValue::setIntValue(U32 val)
{
fval = (F32)val;
ival = val;
if(sval != typeValueEmpty)
if(bufferLen > 0)
{
if (type != TypeInternalStackString && type != TypeInternalStringStackPtr) dFree(sval);
sval = typeValueEmpty;
dFree(sval);
bufferLen = 0;
}

sval = typeValueEmpty;
type = TypeInternalInt;
}
else
Expand All @@ -1825,11 +1826,12 @@ void ConsoleValue::setFloatValue(F32 val)
{
fval = val;
ival = static_cast<U32>(val);
if(sval != typeValueEmpty)
if(bufferLen > 0)
{
if (type != TypeInternalStackString && type != TypeInternalStringStackPtr) dFree(sval);
sval = typeValueEmpty;
dFree(sval);
bufferLen = 0;
}
sval = typeValueEmpty;
type = TypeInternalFloat;
}
else
Expand Down
15 changes: 5 additions & 10 deletions Engine/source/console/console.h
Expand Up @@ -186,19 +186,20 @@ class ConsoleValue
fval = 0;
sval = typeValueEmpty;
bufferLen = 0;
type = TypeInternalString;
type = TypeInternalString;
}

void cleanup()
{
if (type <= TypeInternalString &&
sval != typeValueEmpty && type != TypeInternalStackString && type != TypeInternalStringStackPtr)
if (bufferLen > 0)
{
dFree(sval);
bufferLen = 0;
}
sval = typeValueEmpty;
type = ConsoleValue::TypeInternalString;
ival = 0;
fval = 0;
bufferLen = 0;
}
};

Expand All @@ -214,12 +215,6 @@ class ConsoleValueRef
~ConsoleValueRef() { ; }

ConsoleValueRef(const ConsoleValueRef &ref);
ConsoleValueRef(const char *value);
ConsoleValueRef(const String &ref);
ConsoleValueRef(U32 value);
ConsoleValueRef(S32 value);
ConsoleValueRef(F32 value);
ConsoleValueRef(F64 value);

static ConsoleValueRef fromValue(ConsoleValue *value) { ConsoleValueRef ref; ref.value = value; return ref; }

Expand Down
40 changes: 26 additions & 14 deletions Engine/source/console/consoleInternal.cpp
Expand Up @@ -512,13 +512,17 @@ void ConsoleValue::setStringValue(const char * value)
*/
if (value == typeValueEmpty)
{
if (sval && sval != typeValueEmpty && type != TypeInternalStackString && type != TypeInternalStringStackPtr) dFree(sval);
sval = typeValueEmpty;
if (bufferLen > 0)
{
dFree(sval);
bufferLen = 0;
fval = 0.f;
ival = 0;
type = TypeInternalString;
return;
}

sval = typeValueEmpty;
fval = 0.f;
ival = 0;
type = TypeInternalString;
return;
}

U32 stringLen = dStrlen(value);
Expand All @@ -541,7 +545,7 @@ void ConsoleValue::setStringValue(const char * value)
// may as well pad to the next cache line
U32 newLen = ((stringLen + 1) + 15) & ~15;

if(sval == typeValueEmpty || type == TypeInternalStackString || type == TypeInternalStringStackPtr)
if(bufferLen == 0)
sval = (char *) dMalloc(newLen);
else if(newLen > bufferLen)
sval = (char *) dRealloc(sval, newLen);
Expand All @@ -562,11 +566,16 @@ void ConsoleValue::setStackStringValue(const char *value)

if(type <= ConsoleValue::TypeInternalString)
{
// sval might still be temporarily present so we need to check and free it
if (bufferLen > 0)
{
dFree(sval);
bufferLen = 0;
}

if (value == typeValueEmpty)
{
if (sval && sval != typeValueEmpty && type != ConsoleValue::TypeInternalStackString && type != ConsoleValue::TypeInternalStringStackPtr) dFree(sval);
sval = typeValueEmpty;
bufferLen = 0;
fval = 0.f;
ival = 0;
type = TypeInternalString;
Expand All @@ -587,7 +596,7 @@ void ConsoleValue::setStackStringValue(const char *value)

type = TypeInternalStackString;
sval = (char*)value;
bufferLen = stringLen;
bufferLen = 0;
}
else
Con::setData(type, dataPtr, 0, 1, &value, enumTable);
Expand All @@ -598,7 +607,11 @@ void ConsoleValue::setStringStackPtrValue(StringStackPtr ptrValue)
if(type <= ConsoleValue::TypeInternalString)
{
const char *value = StringStackPtrRef(ptrValue).getPtr(&STR);
if (sval && sval != typeValueEmpty && type != ConsoleValue::TypeInternalStackString && type != TypeInternalStringStackPtr) dFree(sval);
if (bufferLen > 0)
{
dFree(sval);
bufferLen = 0;
}

U32 stringLen = dStrlen(value);
if(stringLen < 256)
Expand All @@ -614,7 +627,7 @@ void ConsoleValue::setStringStackPtrValue(StringStackPtr ptrValue)

type = TypeInternalStringStackPtr;
sval = (char*)(value - STR.mBuffer);
bufferLen = stringLen;
bufferLen = 0;
}
else
{
Expand Down Expand Up @@ -680,8 +693,7 @@ Dictionary::Entry* Dictionary::addVariable( const char *name,
Entry *ent = add(StringTable->insert(name));

if ( ent->value.type <= ConsoleValue::TypeInternalString &&
ent->value.sval != typeValueEmpty &&
ent->value.type != ConsoleValue::TypeInternalStackString && ent->value.type != ConsoleValue::TypeInternalStringStackPtr )
ent->value.bufferLen > 0 )
dFree(ent->value.sval);

ent->value.type = type;
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/console/simEvents.cpp
Expand Up @@ -129,7 +129,7 @@ ConsoleValueRef SimConsoleThreadExecCallback::waitForResult()
return retVal;
}

return (const char*)NULL;
return ConsoleValueRef();
}

//-----------------------------------------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion Engine/source/forest/editor/forestEditorCtrl.cpp
Expand Up @@ -97,7 +97,6 @@ void ForestEditorCtrl::onSleep()

bool ForestEditorCtrl::updateActiveForest( bool createNew )
{
mForest = dynamic_cast<Forest*>( Sim::findObject( "theForest" ) );
Con::executef( this, "onActiveForestUpdated", mForest ? mForest->getIdString() : "", createNew ? "1" : "0" );

if ( mTool )
Expand Down Expand Up @@ -400,4 +399,13 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
{
return object->isDirty();
}

DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )")
{
Forest *forestObject;
if (!Sim::findObject(obj, forestObject))
return;

object->setActiveForest(forestObject);
}
3 changes: 3 additions & 0 deletions Engine/source/forest/editor/forestEditorCtrl.h
Expand Up @@ -86,6 +86,9 @@ class ForestEditorCtrl : public EditTSCtrl
/// Causes the editor to reselect the active forest.
bool updateActiveForest( bool createNew );

/// Sets the active Forest
void setActiveForest(Forest* forestObject) { mForest = forestObject; }

/// Returns the active Forest.
Forest *getActiveForest() const { return mForest; }

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/forest/ts/tsForestItemData.h
Expand Up @@ -88,7 +88,7 @@ class TSForestItemData : public ForestItemData
const Vector<S32>& getLOSDetails() const { return mLOSDetails; }

// ForestItemData
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Invalid; }
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Zero; }
bool render( TSRenderState *rdata, const ForestItem& item ) const;
ForestCellBatch* allocateBatch() const;
bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const;
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/gfx/gl/gfxGLDevice.cpp
Expand Up @@ -811,9 +811,9 @@ GFXShader* GFXGLDevice::createShader()
return shader;
}

void GFXGLDevice::setShader( GFXShader *shader )
void GFXGLDevice::setShader(GFXShader *shader, bool force)
{
if(mCurrentShader == shader)
if(mCurrentShader == shader && !force)
return;

if ( shader )
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/gfx/gl/gfxGLDevice.h
Expand Up @@ -90,7 +90,7 @@ class GFXGLDevice : public GFXDevice
virtual F32 getPixelShaderVersion() const { return mPixelShaderVersion; }
virtual void setPixelShaderVersion( F32 version ) { mPixelShaderVersion = version; }

virtual void setShader(GFXShader* shd);
virtual void setShader(GFXShader *shader, bool force = false);

/// @attention GL cannot check if the given format supports blending or filtering!
virtual GFXFormat selectSupportedFormat(GFXTextureProfile *profile,
Expand Down
14 changes: 7 additions & 7 deletions Engine/source/math/mathTypes.cpp
Expand Up @@ -1019,7 +1019,7 @@ F32 mRandF()
return gRandGen.randF();
}

DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX),
"( int a, int b ) "
"@brief Returns a random number based on parameters passed in..\n\n"
"If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one "
Expand All @@ -1033,21 +1033,21 @@ DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
"@see setRandomSeed\n"
"@ingroup Random" )
{
if (b == 0)
return F32(gRandGen.randI(0,getMax( a, 0 )));
else
if (a != S32_MAX)
{
if (b != 0)
if (b == S32_MAX)
return F32(gRandGen.randI(0, getMax(a, 0)));
else
{
S32 min = a;
S32 max = b;
if (min > max)
if (min > max)
{
S32 t = min;
min = max;
max = t;
}
return F32(gRandGen.randI(min,max));
return F32(gRandGen.randI(min, max));
}
}
return gRandGen.randF();
Expand Down