From 62b5c9fcfdf16fbc896106b5c84ebf2ff58ad5db Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 14:42:28 -0800 Subject: [PATCH 01/28] Fixed issue with string replace String replace doesn't always work correctly this fixes it. --- Engine/source/console/consoleFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index a5ea49f33..82bd5c566 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -480,7 +480,7 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char if(!scan) { dStrcpy(ret + dstp, source + scanp); - break; + return ret; } U32 len = scan - (source + scanp); dStrncpy(ret + dstp, source + scanp, len); From d5a6e15cfe9770be6900da3e9b5ec81e05e89e21 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 14:43:02 -0800 Subject: [PATCH 02/28] Fixed comment fixed an incomplete comment/documentation for displaySplashWindow. --- Engine/source/console/consoleFunctions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 82bd5c566..a721700ac 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -1598,6 +1598,7 @@ DefineEngineFunction( gotoWebPage, void, ( const char* address ),, DefineEngineFunction( displaySplashWindow, bool, (const char* path), ("art/gui/splash.bmp"), "Display a startup splash window suitable for showing while the engine still starts up.\n\n" "@note This is currently only implemented on Windows.\n\n" + "@param path relative path to splash screen image to display.\n" "@return True if the splash window could be successfully initialized.\n\n" "@ingroup Platform" ) { From 42126937e6c81c8c956c5f82d1c76cbfec5046dc Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 14:53:20 -0800 Subject: [PATCH 03/28] Fixed warning Fixed a compile warning about casting. --- Engine/source/console/typeValidators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/console/typeValidators.cpp b/Engine/source/console/typeValidators.cpp index 0b679a2ec..11249daf7 100644 --- a/Engine/source/console/typeValidators.cpp +++ b/Engine/source/console/typeValidators.cpp @@ -101,7 +101,7 @@ void Point3NormalizeValidator::validateType(SimObject *object, void *typePtr) namespace CommonValidators { FRangeValidator PositiveFloat(0.0f, F32_MAX); - FRangeValidator PositiveNonZeroFloat(F32( POINT_EPSILON ) , F32_MAX); + FRangeValidator PositiveNonZeroFloat((F32)POINT_EPSILON, F32_MAX); FRangeValidator NormalizedFloat(0.0f, 1.0f); Point3NormalizeValidator NormalizedPoint3(1.0f); }; From ac0ba277536a69adaf12a6e23e81b86e8047b376 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 15:18:00 -0800 Subject: [PATCH 04/28] Fixed degree symbol not displaying Fixed bug with degree symbol not displaying correctly in torque thanks to the forums: http://www.garagegames.com/community/forums/viewthread/125190/1#comment-804996 --- Engine/source/gfx/gFont.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Engine/source/gfx/gFont.cpp b/Engine/source/gfx/gFont.cpp index 7c838915d..4d6478541 100644 --- a/Engine/source/gfx/gFont.cpp +++ b/Engine/source/gfx/gFont.cpp @@ -568,6 +568,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector &startLineOff for (U32 i = 0; i < len;) { + U32 wide = 0; startLine = i; startLineOffset.push_back(startLine); @@ -584,6 +585,10 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector &startLineOff else if(isValidChar(txt[i])) { lineStrWidth += getCharInfo(txt[i]).xIncrement; + if(txt[i] < 0) // symbols which code > 127 + { + wide++; i++; + } if( lineStrWidth > lineWidth ) { needsNewLine = true; @@ -595,7 +600,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector &startLineOff if (!needsNewLine) { // we are done! - lineLen.push_back(i - startLine); + lineLen.push_back(i - startLine - wide); return; } @@ -628,7 +633,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector &startLineOff } } - lineLen.push_back(j - startLine); + lineLen.push_back(j - startLine - wide); i = j; // Now we need to increment through any space characters at the From 1903413a5494362c54193f76e86471794dc107ee Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 15:48:11 -0800 Subject: [PATCH 05/28] Removed unused variables Removed unused variables. --- Engine/source/gui/containers/guiContainer.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Engine/source/gui/containers/guiContainer.cpp b/Engine/source/gui/containers/guiContainer.cpp index 45bc09d93..2429014c4 100644 --- a/Engine/source/gui/containers/guiContainer.cpp +++ b/Engine/source/gui/containers/guiContainer.cpp @@ -128,9 +128,6 @@ bool GuiContainer::reOrder(SimObject* obj, SimObject* target) bool GuiContainer::resize( const Point2I &newPosition, const Point2I &newExtent ) { - RectI oldBounds = getBounds(); - Point2I minExtent = getMinExtent(); - if( !Parent::resize( newPosition, newExtent ) ) return false; From fe544597e3ce12dcac42797b656551db309f6e77 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 15:52:10 -0800 Subject: [PATCH 06/28] onScroll not always called onScroll callback wasn't always being called, fixed that. --- Engine/source/gui/containers/guiScrollCtrl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/gui/containers/guiScrollCtrl.cpp b/Engine/source/gui/containers/guiScrollCtrl.cpp index 91e86a770..97de975bf 100644 --- a/Engine/source/gui/containers/guiScrollCtrl.cpp +++ b/Engine/source/gui/containers/guiScrollCtrl.cpp @@ -493,6 +493,8 @@ void GuiScrollCtrl::calcThumbs() void GuiScrollCtrl::scrollDelta(S32 deltaX, S32 deltaY) { scrollTo(mChildRelPos.x + deltaX, mChildRelPos.y + deltaY); + + onScroll_callback(); } //----------------------------------------------------------------------------- From 789cc47b67676178cc2fc9ed3ac9eff49dde989c Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 29 Jan 2015 15:58:41 -0800 Subject: [PATCH 07/28] Fixed null profile crash If the profile was null it would crash. --- Engine/source/gui/containers/guiTabBookCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/containers/guiTabBookCtrl.cpp b/Engine/source/gui/containers/guiTabBookCtrl.cpp index d4dd4db43..6b77209aa 100644 --- a/Engine/source/gui/containers/guiTabBookCtrl.cpp +++ b/Engine/source/gui/containers/guiTabBookCtrl.cpp @@ -622,7 +622,7 @@ S32 GuiTabBookCtrl::calculatePageTabWidth( GuiTabPageCtrl *page ) const char* text = page->getText(); - if( !text || dStrlen(text) == 0 || mProfile->mFont == NULL ) + if( !text || dStrlen(text) == 0 || mProfile == NULL || mProfile->mFont == NULL ) return mMinTabWidth; GFont *font = mProfile->mFont; From 722008570a9e2141f6b3b5ad7744b474f8ab2751 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 12:02:56 -0800 Subject: [PATCH 08/28] Fixed bug with console expression result Fixed a bug with the result of a console expression not always displaying. --- Engine/source/gui/controls/guiConsoleTextCtrl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Engine/source/gui/controls/guiConsoleTextCtrl.cpp b/Engine/source/gui/controls/guiConsoleTextCtrl.cpp index 617099646..f7242e3a2 100644 --- a/Engine/source/gui/controls/guiConsoleTextCtrl.cpp +++ b/Engine/source/gui/controls/guiConsoleTextCtrl.cpp @@ -115,6 +115,9 @@ void GuiConsoleTextCtrl::onPreRender() { mResult = Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() ); + //Fixes a bug with the above not always grabbing the console text. + mResult = Con::getVariable("$guiConsoleTextCtrlTemp"); + // Of the resulting string we will be printing, // Find the number of lines and length of each. mProfile->mFont->wrapString( mResult, U32_MAX, mStartLineOffset, mLineLen ); From b11bc8e93a95afde4bc4cbbcaeb1fffe17272b41 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 12:17:38 -0800 Subject: [PATCH 09/28] Fixed some positioning bugs Fixed some cursor positioning bugs in the MLTextCtrl. Also removed parameters from function that doesn't actually take parameters. --- Engine/source/gui/controls/guiMLTextCtrl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Engine/source/gui/controls/guiMLTextCtrl.cpp b/Engine/source/gui/controls/guiMLTextCtrl.cpp index 4233190c6..62141540a 100644 --- a/Engine/source/gui/controls/guiMLTextCtrl.cpp +++ b/Engine/source/gui/controls/guiMLTextCtrl.cpp @@ -168,7 +168,7 @@ DefineEngineMethod( GuiMLTextCtrl, scrollToTag, void, (S32 tagID),, object->scrollToTag( tagID ); } -DefineEngineMethod( GuiMLTextCtrl, scrollToTop, void, ( S32 param1, S32 param2),, +DefineEngineMethod( GuiMLTextCtrl, scrollToTop, void, (),, "@brief Scroll to the top of the text.\n\n" "@tsexample\n" "// Inform GuiMLTextCtrl object to scroll to its top\n" @@ -631,7 +631,7 @@ bool GuiMLTextCtrl::setCursorPosition(const S32 newPosition) mCursorPosition = 0; return true; } - else if (newPosition >= mTextBuffer.length()) + else if (newPosition >= mTextBuffer.length() - 1) { mCursorPosition = mTextBuffer.length(); return true; @@ -669,11 +669,11 @@ void GuiMLTextCtrl::getCursorPositionAndColor(Point2I &cursorTop, Point2I &curso { S32 x = 0; S32 y = 0; - S32 height = mProfile->mFont->getHeight(); + S32 height = mProfile && mProfile->mFont ? mProfile->mFont->getHeight() : 0; color = mProfile->mCursorColor; for(Line *walk = mLineList; walk; walk = walk->next) { - if ((mCursorPosition <= walk->textStart + walk->len) || (walk->next == NULL)) + if ((mCursorPosition < walk->textStart + walk->len) || (walk->next == NULL)) { // it's in the atoms on this line... y = walk->y; @@ -768,7 +768,7 @@ void GuiMLTextCtrl::onMouseDown(const GuiEvent& event) mSelectionAnchorDropped = event.mousePoint; if (mSelectionAnchor < 0) mSelectionAnchor = 0; - else if (mSelectionAnchor >= mTextBuffer.length()) + else if (mSelectionAnchor >= mTextBuffer.length() - 1) mSelectionAnchor = mTextBuffer.length(); mVertMoveAnchorValid = false; From 77b9600303ac952cd3a5153ce2cbf5809d5034b3 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 13:54:56 -0800 Subject: [PATCH 10/28] IsActive fix & code cleanup Now if a text edit is set to inactive you can't mouse down. changed code to use setVariable so code is a bit cleaner. Fixed some small spacing issues. --- Engine/source/gui/controls/guiTextEditCtrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index c451400b7..a68104bcd 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -212,8 +212,7 @@ void GuiTextEditCtrl::execConsoleCallback() Parent::execConsoleCallback(); // Update the console variable: - if ( mConsoleVariable[0] ) - Con::setVariable( mConsoleVariable, mTextBuffer.getPtr8() ); + setVariable(mTextBuffer.getPtr8()); } void GuiTextEditCtrl::updateHistory( StringBuffer *inTxt, bool moveIndex ) @@ -374,6 +373,8 @@ S32 GuiTextEditCtrl::calculateCursorPos( const Point2I &globalPos ) void GuiTextEditCtrl::onMouseDown( const GuiEvent &event ) { + if(!isActive()) + return; mDragHit = false; // If we have a double click, select all text. Otherwise From d0972c9be15e84c7bb9e511ef15824612a7b79da Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:27:56 -0800 Subject: [PATCH 11/28] Small crash fix Crash fix when font isn't set. --- Engine/source/gui/core/guiControl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 86dfbee6e..56861dc77 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -602,6 +602,8 @@ void GuiControl::setUpdate() void GuiControl::renderJustifiedText(Point2I offset, Point2I extent, const char *text) { GFont *font = mProfile->mFont; + if(!font) + return; S32 textWidth = font->getStrWidthPrecise((const UTF8*)text); U32 textHeight = font->getHeight(); From ae706b240772a80fba796c8dbb1e857c74956cce Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:40:51 -0800 Subject: [PATCH 12/28] Removed unused parameters I am not sure why there were parameters for this method when they weren't being used (perhaps leftover from before?), but I removed them. --- Engine/source/gui/editor/guiMenuBar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index 3ecf7960c..c3ba8818f 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -159,7 +159,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onSubmenuSelect, void, ( const char* submenuId, // console methods //------------------------------------------------------------------------------ -DefineEngineMethod( GuiMenuBar, clearMenus, void, ( S32 param1, S32 param2),, +DefineEngineMethod( GuiMenuBar, clearMenus, void, (),, "@brief Clears all the menus from the menu bar.\n\n" "@tsexample\n" "// Inform the GuiMenuBar control to clear all menus from itself.\n" From f039c98f0827b24d5a0d9d895e6808328295fc12 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:46:26 -0800 Subject: [PATCH 13/28] Fixed bug with dash character in menu item Fixed a bug where if the text for a menu item started with - then it would auto be disabled. --- Engine/source/gui/editor/guiMenuBar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index c3ba8818f..56eec13c0 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -1018,7 +1018,7 @@ void GuiMenuBar::addSubmenuItem(Menu *menu, MenuItem *submenu, const char *text, newMenuItem->checkGroup = checkGroup; newMenuItem->nextMenuItem = NULL; newMenuItem->acceleratorIndex = 0; - newMenuItem->enabled = text[0] != '-'; + newMenuItem->enabled = (dStrlen(text) > 1 || text[0] != '-'); newMenuItem->visible = true; newMenuItem->bitmapIndex = -1; From 2458ecad9b018cfcfce8bbafc3c29581e5574f40 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:48:05 -0800 Subject: [PATCH 14/28] Fixed bug with bad index Fixed a crash that would occur if an incorrect index was passed to renderNodeName or renderNodeAxes. --- Engine/source/gui/editor/guiShapeEdPreview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index 098ff38f3..548634eeb 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -1603,6 +1603,8 @@ void GuiShapeEdPreview::renderNodes() const void GuiShapeEdPreview::renderNodeAxes(S32 index, const ColorF& nodeColor) const { + if(mModel->mNodeTransforms.size() <= index || index < 0) + return; const Point3F xAxis( 1.0f, 0.15f, 0.15f ); const Point3F yAxis( 0.15f, 1.0f, 0.15f ); const Point3F zAxis( 0.15f, 0.15f, 1.0f ); @@ -1626,6 +1628,8 @@ void GuiShapeEdPreview::renderNodeAxes(S32 index, const ColorF& nodeColor) const void GuiShapeEdPreview::renderNodeName(S32 index, const ColorF& textColor) const { + if(index < 0 || index >= mModel->getShape()->nodes.size() || index >= mProjectedNodes.size()) + return; const TSShape::Node& node = mModel->getShape()->nodes[index]; const String& nodeName = mModel->getShape()->getName( node.nameIndex ); From c85b5b99991be4984b5715bdedc2759f818bcc4d Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:54:01 -0800 Subject: [PATCH 15/28] Fixed odd callback bugs Fixed bugs with callbacks, I couldn't seem to use U8 correctly in script for some reason, but S32 works. I may have needed to use some extra operators or something maybe, it was so long ago I can't remember what I got in script as it was so long ago. --- .../source/gui/utility/guiMouseEventCtrl.cpp | 18 +++++++++--------- Engine/source/gui/utility/guiMouseEventCtrl.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Engine/source/gui/utility/guiMouseEventCtrl.cpp b/Engine/source/gui/utility/guiMouseEventCtrl.cpp index cde0359e9..e0df98af0 100644 --- a/Engine/source/gui/utility/guiMouseEventCtrl.cpp +++ b/Engine/source/gui/utility/guiMouseEventCtrl.cpp @@ -46,7 +46,7 @@ ConsoleDocClass( GuiMouseEventCtrl, ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDown, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDown, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse is pressed down while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -70,7 +70,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDown, void, ( U8 modifier, Point2I "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseUp, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseUp, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse is released while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -94,7 +94,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseUp, void, ( U8 modifier, Point2I m "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseMove, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseMove, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse is moved (without dragging) while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -118,7 +118,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseMove, void, ( U8 modifier, Point2I "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDragged, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDragged, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse is dragged while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -142,7 +142,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseDragged, void, ( U8 modifier, Poi "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseEnter, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseEnter, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse enters this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -166,7 +166,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseEnter, void, ( U8 modifier, Point "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseLeave, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseLeave, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse leaves this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -190,7 +190,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onMouseLeave, void, ( U8 modifier, Point "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseDown, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseDown, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the right mouse button is pressed while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -214,7 +214,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseDown, void, ( U8 modifier, P "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseUp, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseUp, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the right mouse button is released while in this control.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" @@ -238,7 +238,7 @@ IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseUp, void, ( U8 modifier, Poi "@see GuiControl\n\n" ); -IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseDragged, void, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount ), +IMPLEMENT_CALLBACK( GuiMouseEventCtrl, onRightMouseDragged, void, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount ), ( modifier, mousePoint, mouseClickCount ), "@brief Callback that occurs whenever the mouse is dragged in this control while the right mouse button is pressed.\n\n" "@param modifier Key that was pressed during this callback. Values are:\n\n" diff --git a/Engine/source/gui/utility/guiMouseEventCtrl.h b/Engine/source/gui/utility/guiMouseEventCtrl.h index 0a8bf7257..dfb21482d 100644 --- a/Engine/source/gui/utility/guiMouseEventCtrl.h +++ b/Engine/source/gui/utility/guiMouseEventCtrl.h @@ -41,15 +41,15 @@ class GuiMouseEventCtrl : public GuiControl GuiMouseEventCtrl(); - DECLARE_CALLBACK( void, onMouseDown, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onMouseUp, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onMouseMove, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onMouseDragged, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onMouseEnter, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onMouseLeave, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onRightMouseDown, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onRightMouseUp, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); - DECLARE_CALLBACK( void, onRightMouseDragged, ( U8 modifier, Point2I mousePoint,U8 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseDown, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseUp, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseMove, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseDragged, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseEnter, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onMouseLeave, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onRightMouseDown, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onRightMouseUp, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); + DECLARE_CALLBACK( void, onRightMouseDragged, ( S32 modifier, Point2I mousePoint, S32 mouseClickCount )); // GuiControl void onMouseDown(const GuiEvent & event); From 105c2b68f769ad1987f7fd83fb7a8a087558980a Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 15:55:07 -0800 Subject: [PATCH 16/28] Removed unused code removed some unused code. --- Engine/source/gui/utility/guiMouseEventCtrl.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Engine/source/gui/utility/guiMouseEventCtrl.cpp b/Engine/source/gui/utility/guiMouseEventCtrl.cpp index e0df98af0..6c3024214 100644 --- a/Engine/source/gui/utility/guiMouseEventCtrl.cpp +++ b/Engine/source/gui/utility/guiMouseEventCtrl.cpp @@ -270,11 +270,6 @@ GuiMouseEventCtrl::GuiMouseEventCtrl() //------------------------------------------------------------------------------ void GuiMouseEventCtrl::sendMouseEvent(const char * name, const GuiEvent & event) { - char buf[3][32]; - dSprintf(buf[0], 32, "%d", event.modifier); - dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y); - dSprintf(buf[2], 32, "%d", event.mouseClickCount); - if(dStricmp(name,"onMouseDown") == 0) onMouseDown_callback(event.modifier, event.mousePoint, event.mouseClickCount); else if(dStricmp(name,"onMouseUp") == 0) From c7e0d83587ebd18e8b870669db8e17aa69a5b6ea Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 12:13:06 -0800 Subject: [PATCH 17/28] Fixed possible divide by zero issues. Fixed several areas in the point class that could have a divide by zero issue. --- Engine/source/math/mPoint3.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Engine/source/math/mPoint3.h b/Engine/source/math/mPoint3.h index 5a85c6cd0..8ba244767 100644 --- a/Engine/source/math/mPoint3.h +++ b/Engine/source/math/mPoint3.h @@ -233,11 +233,13 @@ class Point3D bool isZero() const; F64 len() const; F64 lenSquared() const; + F64 magnitudeSafe() const; //-------------------------------------- Mathematical mutators public: void neg(); void normalize(); + void normalizeSafe(); void normalize(F64 val); void convolve(const Point3D&); void convolveInverse(const Point3D&); @@ -728,11 +730,13 @@ inline Point3F& Point3F::operator*=(const Point3F &_vec) inline Point3F Point3F::operator/(const Point3F &_vec) const { + AssertFatal(_vec.x != 0.0f && _vec.y != 0.0f && _vec.z != 0.0f, "Error, div by zero attempted"); return Point3F(x / _vec.x, y / _vec.y, z / _vec.z); } inline Point3F& Point3F::operator/=(const Point3F &_vec) { + AssertFatal(_vec.x != 0.0f && _vec.y != 0.0f && _vec.z != 0.0f, "Error, div by zero attempted"); x /= _vec.x; y /= _vec.y; z /= _vec.z; @@ -855,7 +859,8 @@ inline F64 Point3D::lenSquared() const inline F64 Point3D::len() const { - return mSqrtD(x*x + y*y + z*z); + F64 temp = x*x + y*y + z*z; + return (temp > 0.0) ? mSqrtD(x*x + y*y + z*z) : 0.0; } inline void Point3D::normalize() @@ -863,6 +868,28 @@ inline void Point3D::normalize() m_point3D_normalize(*this); } +inline F64 Point3D::magnitudeSafe() const +{ + if( isZero() ) + { + return 0.0; + } + else + { + return len(); + } +} + +inline void Point3D::normalizeSafe() +{ + F64 vmag = magnitudeSafe(); + + if( vmag > POINT_EPSILON ) + { + *this *= F64(1.0 / vmag); + } +} + inline void Point3D::normalize(F64 val) { m_point3D_normalize_f(*this, val); From ad267f050503447a275b40fc4c047878a161ae97 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 12:16:06 -0800 Subject: [PATCH 18/28] Fixed angle conversion issues Fixed a variable name and method that should be const. Also fixed several angle conversion functions that didn't convert the angle correct. --- Engine/source/math/mMatrix.cpp | 2 +- Engine/source/math/mQuat.cpp | 67 +++++++++++++++++++++------------- Engine/source/math/mQuat.h | 2 +- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/Engine/source/math/mMatrix.cpp b/Engine/source/math/mMatrix.cpp index 12af818ea..da1c137ca 100644 --- a/Engine/source/math/mMatrix.cpp +++ b/Engine/source/math/mMatrix.cpp @@ -163,7 +163,7 @@ EulerF MatrixF::toEuler() const const F32 * mat = m; EulerF r; - r.x = mAsin(mat[MatrixF::idx(2,1)]); + r.x = mAsin(mClampF(mat[MatrixF::idx(2,1)], -1.0, 1.0)); if(mCos(r.x) != 0.f) { diff --git a/Engine/source/math/mQuat.cpp b/Engine/source/math/mQuat.cpp index 7ffc4eaa3..29180d837 100644 --- a/Engine/source/math/mQuat.cpp +++ b/Engine/source/math/mQuat.cpp @@ -32,33 +32,48 @@ const QuatF QuatF::Identity(0.0f,0.0f,0.0f,1.0f); QuatF& QuatF::set( const EulerF & e ) { - F32 cx, sx; - F32 cy, sy; - F32 cz, sz; - mSinCos( e.x * 0.5f, sx, cx ); - mSinCos( e.y * 0.5f, sy, cy ); - mSinCos( e.z * 0.5f, sz, cz ); + /* + F32 cx, sx; + F32 cy, sy; + F32 cz, sz; + mSinCos( -e.x * 0.5f, sx, cx ); + mSinCos( -e.y * 0.5f, sy, cy ); + mSinCos( -e.z * 0.5f, sz, cz ); - // Qyaw(z) = [ (0, 0, sin z/2), cos z/2 ] - // Qpitch(x) = [ (sin x/2, 0, 0), cos x/2 ] - // Qroll(y) = [ (0, sin y/2, 0), cos y/2 ] - // this = Qresult = Qyaw*Qpitch*Qroll ZXY - // - // The code that folows is a simplification of: - // roll*=pitch; - // roll*=yaw; - // *this = roll; - F32 cycz, sysz, sycz, cysz; - cycz = cy*cz; - sysz = sy*sz; - sycz = sy*cz; - cysz = cy*sz; - w = cycz*cx - sysz*sx; - x = cycz*sx + sysz*cx; - y = sycz*cx + cysz*sx; - z = cysz*cx - sycz*sx; + // Qyaw(z) = [ (0, 0, sin z/2), cos z/2 ] + // Qpitch(x) = [ (sin x/2, 0, 0), cos x/2 ] + // Qroll(y) = [ (0, sin y/2, 0), cos y/2 ] + // this = Qresult = Qyaw*Qpitch*Qroll ZXY + // + // The code that folows is a simplification of: + // roll*=pitch; + // roll*=yaw; + // *this = roll; + F32 cycz, sysz, sycz, cysz; + cycz = cy*cz; + sysz = sy*sz; + sycz = sy*cz; + cysz = cy*sz; + w = cycz*cx + sysz*sx; + x = cycz*sx + sysz*cx; + y = sycz*cx - cysz*sx; + z = cysz*cx - sycz*sx; + */ + // Assuming the angles are in radians. + F32 c1 = mCos(e.y/2.0f); + F32 s1 = mSin(e.y/2.0f); + F32 c2 = mCos(e.z/2.0f); + F32 s2 = mSin(e.z/2.0f); + F32 c3 = mCos(e.x/2.0f); + F32 s3 = mSin(e.x/2.0f); + F32 c1c2 = c1*c2; + F32 s1s2 = s1*s2; + w =c1c2*c3 - s1s2*s3; + x =c1c2*s3 + s1s2*c3; + y =s1*c2*c3 + c1*s2*s3; + z =c1*s2*c3 - s1*c2*s3; - return *this; + return *this; } QuatF& QuatF::operator *=( const QuatF & b ) @@ -289,7 +304,7 @@ QuatF & QuatF::interpolate( const QuatF & q1, const QuatF & q2, F32 t ) return *this; } -Point3F & QuatF::mulP(const Point3F& p, Point3F* r) +Point3F & QuatF::mulP(const Point3F& p, Point3F* r) const { QuatF qq; QuatF qi = *this; diff --git a/Engine/source/math/mQuat.h b/Engine/source/math/mQuat.h index 433b30155..2ea1b94c1 100644 --- a/Engine/source/math/mQuat.h +++ b/Engine/source/math/mQuat.h @@ -81,7 +81,7 @@ public: QuatF& interpolate( const QuatF & q1, const QuatF & q2, F32 t ); F32 angleBetween( const QuatF & q ); - Point3F& mulP(const Point3F& a, Point3F* b); // r = p * this + Point3F& mulP(const Point3F& a, Point3F* r) const; // r = p * this QuatF& mul(const QuatF& a, const QuatF& b); // This = a * b // Vectors passed in must be normalized From 1372b4f600d4bffc6e06bfb65075577a9eeb40dc Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 14:14:02 -0800 Subject: [PATCH 19/28] Fixed raycast bug start x position is NaN Fixed bug in _castRay when the start x position is NaN. --- Engine/source/scene/sceneContainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index 5d81cc0bd..e9fd51812 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1012,6 +1012,11 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en F32 currStartX = normalStart.x; AssertFatal(currStartX != normalEnd.x, "This is going to cause problems in SceneContainer::castRay"); + if(_isnan(currStartX)) + { + PROFILE_END(); + return false; + } while (currStartX != normalEnd.x) { F32 currEndX = getMin(currStartX + csmTotalBinSize, normalEnd.x); From 50f875a2f57687966a98c4cad4332b58c46c85ac Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 14:18:06 -0800 Subject: [PATCH 20/28] Fixed bug with comparison cases of getRenderEnabled For some reason returning true/false rather that 1/0 from _getRenderEnabled would cause errors in some comparison cases to see if it was true or not (would treat it as if it was a string/word rather than a bool or int). --- Engine/source/scene/sceneObject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index 80e2ba338..1420bac11 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -720,9 +720,9 @@ const char* SceneObject::_getRenderEnabled( void* object, const char* data ) { SceneObject* obj = reinterpret_cast< SceneObject* >( object ); if( obj->mObjectFlags.test( RenderEnabledFlag ) ) - return "true"; + return "1"; else - return "false"; + return "0"; } //----------------------------------------------------------------------------- From e3dc606623a19105929803980e12a308c68e00a5 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 15:07:12 -0800 Subject: [PATCH 21/28] Fixed small warning Fixed small warning about unused local variable. --- Engine/lib/libvorbis/lib/codebook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/lib/libvorbis/lib/codebook.c b/Engine/lib/libvorbis/lib/codebook.c index ecb8b6878..3d68781fd 100644 --- a/Engine/lib/libvorbis/lib/codebook.c +++ b/Engine/lib/libvorbis/lib/codebook.c @@ -450,7 +450,7 @@ long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){ } } }else{ - int i,j; + int i; for(i=0;i Date: Wed, 11 Feb 2015 09:57:36 -0800 Subject: [PATCH 22/28] Fixed incorrect file size returned According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa365740%28v=vs.85%29.aspx to return the actual file size you need to use the high and low file size. --- Engine/source/platformWin32/winFileio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/platformWin32/winFileio.cpp b/Engine/source/platformWin32/winFileio.cpp index 7296ed32e..337c5b51e 100644 --- a/Engine/source/platformWin32/winFileio.cpp +++ b/Engine/source/platformWin32/winFileio.cpp @@ -998,7 +998,7 @@ S32 Platform::getFileSize(const char *pFilePath) return -1; // must be a real file then - return findData.nFileSizeLow; + return ((findData.nFileSizeHigh * (MAXDWORD+1)) + findData.nFileSizeLow); } From 246df9c454bf6c83d980ed3c8d86214d556c26e7 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 12 Feb 2015 08:25:16 -0800 Subject: [PATCH 23/28] Added parenthesis Added parenthesis to avoid turning height into a true/false evaluation result. --- Engine/source/gui/controls/guiMLTextCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/controls/guiMLTextCtrl.cpp b/Engine/source/gui/controls/guiMLTextCtrl.cpp index 62141540a..72a5258f7 100644 --- a/Engine/source/gui/controls/guiMLTextCtrl.cpp +++ b/Engine/source/gui/controls/guiMLTextCtrl.cpp @@ -669,7 +669,7 @@ void GuiMLTextCtrl::getCursorPositionAndColor(Point2I &cursorTop, Point2I &curso { S32 x = 0; S32 y = 0; - S32 height = mProfile && mProfile->mFont ? mProfile->mFont->getHeight() : 0; + S32 height = (mProfile && mProfile->mFont) ? mProfile->mFont->getHeight() : 0; color = mProfile->mCursorColor; for(Line *walk = mLineList; walk; walk = walk->next) { From 57bad98569492a642eebd76a79b8709f3a586a2c Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 12 Feb 2015 08:31:54 -0800 Subject: [PATCH 24/28] Fixed spacing and optimized Fixed tab vs 3 spaces and optimized the code a bit. --- Engine/source/math/mPoint3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/math/mPoint3.h b/Engine/source/math/mPoint3.h index 8ba244767..12af91c4b 100644 --- a/Engine/source/math/mPoint3.h +++ b/Engine/source/math/mPoint3.h @@ -859,8 +859,8 @@ inline F64 Point3D::lenSquared() const inline F64 Point3D::len() const { - F64 temp = x*x + y*y + z*z; - return (temp > 0.0) ? mSqrtD(x*x + y*y + z*z) : 0.0; + F64 temp = x*x + y*y + z*z; + return (temp > 0.0) ? mSqrtD(temp) : 0.0; } inline void Point3D::normalize() From 32a4365ea947a91dfd920db58fdaa89bd1ce24f1 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 12 Feb 2015 11:00:25 -0800 Subject: [PATCH 25/28] Optimized code Since floating point division is the most expensive operation, it was optimized. --- Engine/source/math/mQuat.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Engine/source/math/mQuat.cpp b/Engine/source/math/mQuat.cpp index 29180d837..d2b1a6ae6 100644 --- a/Engine/source/math/mQuat.cpp +++ b/Engine/source/math/mQuat.cpp @@ -60,12 +60,12 @@ QuatF& QuatF::set( const EulerF & e ) z = cysz*cx - sycz*sx; */ // Assuming the angles are in radians. - F32 c1 = mCos(e.y/2.0f); - F32 s1 = mSin(e.y/2.0f); - F32 c2 = mCos(e.z/2.0f); - F32 s2 = mSin(e.z/2.0f); - F32 c3 = mCos(e.x/2.0f); - F32 s3 = mSin(e.x/2.0f); + F32 c1 = mCos(e.y * 0.5f); + F32 s1 = mSin(e.y * 0.5f); + F32 c2 = mCos(e.z * 0.5f); + F32 s2 = mSin(e.z * 0.5f); + F32 c3 = mCos(e.x * 0.5f); + F32 s3 = mSin(e.x * 0.5f); F32 c1c2 = c1*c2; F32 s1s2 = s1*s2; w =c1c2*c3 - s1s2*s3; From 7809e595edfeacf7b18205d238a07289d5624c9b Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 12 Feb 2015 11:05:44 -0800 Subject: [PATCH 26/28] Fixed tab vs spaces Fixed tab vs spaces --- Engine/source/scene/sceneContainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index e9fd51812..90ac7c235 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1012,7 +1012,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en F32 currStartX = normalStart.x; AssertFatal(currStartX != normalEnd.x, "This is going to cause problems in SceneContainer::castRay"); - if(_isnan(currStartX)) + if(_isnan(currStartX)) { PROFILE_END(); return false; From 87bb479c8c23841fa9486f5a9d79a2595649e33f Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Thu, 12 Feb 2015 11:39:47 -0800 Subject: [PATCH 27/28] Check now platform independent Now it uses a Torque function to check so it compiles on Linux. --- Engine/source/scene/sceneContainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index 90ac7c235..0391ff669 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1012,7 +1012,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en F32 currStartX = normalStart.x; AssertFatal(currStartX != normalEnd.x, "This is going to cause problems in SceneContainer::castRay"); - if(_isnan(currStartX)) + if(mIsNaN_F(currStartX)) { PROFILE_END(); return false; From a22672dd7af00c78e78b65d39568a174c5a4cc94 Mon Sep 17 00:00:00 2001 From: MusicMonkey5555 Date: Fri, 17 Jul 2015 16:40:39 -0700 Subject: [PATCH 28/28] Update guiConsoleTextCtrl.cpp Removed redundant assignment. --- Engine/source/gui/controls/guiConsoleTextCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/controls/guiConsoleTextCtrl.cpp b/Engine/source/gui/controls/guiConsoleTextCtrl.cpp index f7242e3a2..5001663fd 100644 --- a/Engine/source/gui/controls/guiConsoleTextCtrl.cpp +++ b/Engine/source/gui/controls/guiConsoleTextCtrl.cpp @@ -113,7 +113,7 @@ void GuiConsoleTextCtrl::onPreRender() { if ( mConsoleExpression.isNotEmpty() ) { - mResult = Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() ); + Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() ); //Fixes a bug with the above not always grabbing the console text. mResult = Con::getVariable("$guiConsoleTextCtrlTemp");