mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
GFX card profile config file logging moved to debug only
WIP mode of guiSliderCtrl to be a filled rectangle instead of a textured UI Fixed bug with guiTextEditCtrl losing focus updating history passing malformed strings Updated WIP options menu Editor/Project settings WIP Updated editor theme to be consistent, and feed off the editor settings Updated popup menus to reference renamed profiles Added more in-progress modules for examples/stress testing
This commit is contained in:
parent
dd3422b5a2
commit
07b28cb29a
44 changed files with 972 additions and 415 deletions
|
|
@ -41,17 +41,22 @@ void GFXCardProfiler::loadProfileScript(const char* aScriptName)
|
|||
void *data = NULL;
|
||||
U32 dataSize = 0;
|
||||
|
||||
|
||||
Torque::FS::ReadFile( scriptName.c_str(), data, dataSize, true );
|
||||
|
||||
if(data == NULL)
|
||||
{
|
||||
#if TORQUE_DEBUG
|
||||
Con::warnf(" - No card profile %s exists", scriptName.c_str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
const char *script = static_cast<const char *>(data);
|
||||
|
||||
#if TORQUE_DEBUG
|
||||
Con::printf(" - Loaded card profile %s", scriptName.c_str());
|
||||
#endif
|
||||
|
||||
Con::evaluate(script, false, NULL);
|
||||
delete[] script;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ IMPLEMENT_CALLBACK( GuiSliderCtrl, onMouseDragged, void, (), (),
|
|||
GuiSliderCtrl::GuiSliderCtrl()
|
||||
: mRange( 0., 1.f ),
|
||||
mTicks( 10 ),
|
||||
mRenderTicks(true),
|
||||
mSnap( false ),
|
||||
mValue( 0.5f ),
|
||||
mThumbSize( 8, 20 ),
|
||||
|
|
@ -98,7 +99,9 @@ GuiSliderCtrl::GuiSliderCtrl()
|
|||
mDisplayValue( false ),
|
||||
mMouseOver( false ),
|
||||
mDepressed( false ),
|
||||
mMouseDragged( false )
|
||||
mMouseDragged( false ),
|
||||
mUseFillBar(false),
|
||||
mFillBarColor(ColorI(255,255,255))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -117,6 +120,12 @@ void GuiSliderCtrl::initPersistFields()
|
|||
addProtectedField( "value", TypeF32, Offset( mValue, GuiSliderCtrl ),
|
||||
_setValue, defaultProtectedGetFn,
|
||||
"The value corresponding to the current slider position." );
|
||||
addField("useFillBar", TypeBool, Offset(mUseFillBar, GuiSliderCtrl),
|
||||
"Whether to render the tick marks.");
|
||||
addField("fillBarColor", TypeColorI, Offset(mFillBarColor, GuiSliderCtrl),
|
||||
"Whether to render the tick marks.");
|
||||
addField("renderTicks", TypeBool, Offset(mRenderTicks, GuiSliderCtrl),
|
||||
"Whether to render the tick marks.");
|
||||
|
||||
endGroup( "Slider" );
|
||||
|
||||
|
|
@ -365,9 +374,18 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
GFXDrawUtil* drawUtil = GFX->getDrawUtil();
|
||||
|
||||
if (mUseFillBar)
|
||||
{
|
||||
|
||||
drawUtil->drawRectFill(RectI(offset.x, offset.y, getWidth() * mValue, getHeight()), mFillBarColor);
|
||||
|
||||
renderChildControls(offset, updateRect);
|
||||
return;
|
||||
}
|
||||
|
||||
if( mHasTexture )
|
||||
{
|
||||
if(mTicks > 0)
|
||||
if(mTicks > 0 && mRenderTicks)
|
||||
{
|
||||
// TODO: tick marks should be positioned based on the bitmap dimensions.
|
||||
Point2I mid(ext.x, ext.y/2);
|
||||
|
|
@ -443,11 +461,14 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
PrimBuild::vertex2i( pos.x + mid.x, pos.y + mid.y );
|
||||
|
||||
// tick marks
|
||||
for( U32 t = 0; t <= ( mTicks + 1 ); t++ )
|
||||
if (mRenderTicks)
|
||||
{
|
||||
S32 x = (S32)( F32( mid.x - 1 ) / F32( mTicks + 1 ) * F32( t ) );
|
||||
PrimBuild::vertex2i( pos.x + x, pos.y + mid.y - mShiftPoint );
|
||||
PrimBuild::vertex2i( pos.x + x, pos.y + mid.y + mShiftPoint );
|
||||
for (U32 t = 0; t <= (mTicks + 1); t++)
|
||||
{
|
||||
S32 x = (S32)(F32(mid.x - 1) / F32(mTicks + 1) * F32(t));
|
||||
PrimBuild::vertex2i(pos.x + x, pos.y + mid.y - mShiftPoint);
|
||||
PrimBuild::vertex2i(pos.x + x, pos.y + mid.y + mShiftPoint);
|
||||
}
|
||||
}
|
||||
PrimBuild::end();
|
||||
}
|
||||
|
|
@ -462,11 +483,14 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
PrimBuild::vertex2i( pos.x + mid.x, pos.y + mid.y );
|
||||
|
||||
// tick marks
|
||||
for( U32 t = 0; t <= ( mTicks + 1 ); t++ )
|
||||
if (mRenderTicks)
|
||||
{
|
||||
S32 y = (S32)( F32( mid.y - 1 ) / F32( mTicks + 1 ) * F32( t ) );
|
||||
PrimBuild::vertex2i( pos.x + mid.x - mShiftPoint, pos.y + y );
|
||||
PrimBuild::vertex2i( pos.x + mid.x + mShiftPoint, pos.y + y );
|
||||
for (U32 t = 0; t <= (mTicks + 1); t++)
|
||||
{
|
||||
S32 y = (S32)(F32(mid.y - 1) / F32(mTicks + 1) * F32(t));
|
||||
PrimBuild::vertex2i(pos.x + mid.x - mShiftPoint, pos.y + y);
|
||||
PrimBuild::vertex2i(pos.x + mid.x + mShiftPoint, pos.y + y);
|
||||
}
|
||||
}
|
||||
PrimBuild::end();
|
||||
mDisplayValue = false;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class GuiSliderCtrl : public GuiControl
|
|||
|
||||
Point2F mRange;
|
||||
U32 mTicks;
|
||||
bool mRenderTicks;
|
||||
bool mSnap;
|
||||
F32 mValue;
|
||||
RectI mThumb;
|
||||
|
|
@ -51,6 +52,8 @@ class GuiSliderCtrl : public GuiControl
|
|||
bool mMouseOver;
|
||||
bool mMouseDragged;
|
||||
bool mHasTexture;
|
||||
bool mUseFillBar;
|
||||
ColorI mFillBarColor;
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1246,7 +1246,7 @@ void GuiTextEditCtrl::onLoseFirstResponder()
|
|||
|
||||
//execute the validate command
|
||||
if( mValidateCommand.isNotEmpty() )
|
||||
evaluate( mValidateCommand );
|
||||
evaluate( mValidateCommand.c_str() );
|
||||
|
||||
onValidate_callback();
|
||||
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
Sim::findObject("PopUpMenuControl", backgroundCtrl);
|
||||
|
||||
GuiControlProfile* profile;
|
||||
Sim::findObject("GuiMenubarProfile", profile);
|
||||
Sim::findObject("ToolsGuiMenuBarProfile", profile);
|
||||
|
||||
if (!profile)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1703,7 +1703,7 @@ void PostEffect::setShaderConst(const String &name, const F32 &val)
|
|||
|
||||
void PostEffect::setShaderConst(const String& name, const int& val)
|
||||
{
|
||||
PROFILE_SCOPE(PostEffect_SetShaderConst_Float);
|
||||
PROFILE_SCOPE(PostEffect_SetShaderConst_Int);
|
||||
|
||||
EffectConstTable::Iterator iter = mEffectConsts.find(name);
|
||||
if (iter == mEffectConsts.end())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue