Merge remote-tracking branch 'upstream/master' into reverse-z
This commit is contained in:
@@ -212,7 +212,7 @@ bool BehaviorKnowledge::HasGoal(ScriptingTypeHandle type) const
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant BehaviorKnowledge::GetGoal(ScriptingTypeHandle type)
|
||||
const Variant& BehaviorKnowledge::GetGoal(ScriptingTypeHandle type) const
|
||||
{
|
||||
for (const Variant& goal : Goals)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="type">The goal type.</param>
|
||||
/// <returns>The goal value or null if not found.</returns>
|
||||
API_FUNCTION() Variant GetGoal(ScriptingTypeHandle type);
|
||||
API_FUNCTION() const Variant& GetGoal(ScriptingTypeHandle type) const;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the goal to the knowledge. If goal of that type already exists then it's value is updated.
|
||||
|
||||
@@ -124,7 +124,7 @@ void GameplayGlobals::SetDefaultValues(const Dictionary<String, Variant>& values
|
||||
}
|
||||
}
|
||||
|
||||
Variant GameplayGlobals::GetValue(const StringView& name) const
|
||||
const Variant& GameplayGlobals::GetValue(const StringView& name) const
|
||||
{
|
||||
ScopeLock lock(Locker);
|
||||
auto e = Variables.TryGet(name);
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="name">The variable name.</param>
|
||||
/// <returns>The value.</returns>
|
||||
API_FUNCTION() Variant GetValue(const StringView& name) const;
|
||||
API_FUNCTION() const Variant& GetValue(const StringView& name) const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of the global variable (it must be added first).
|
||||
|
||||
@@ -273,7 +273,7 @@ AnimGraphParameter* AnimatedModel::GetParameter(const StringView& name)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Variant AnimatedModel::GetParameterValue(const StringView& name)
|
||||
const Variant& AnimatedModel::GetParameterValue(const StringView& name) const
|
||||
{
|
||||
CHECK_ANIM_GRAPH_PARAM_ACCESS_RESULT(Variant::Null);
|
||||
for (auto& param : GraphInstance.Parameters)
|
||||
@@ -299,7 +299,7 @@ void AnimatedModel::SetParameterValue(const StringView& name, const Variant& val
|
||||
LOG(Warning, "Failed to set animated model '{0}' missing parameter '{1}'", ToString(), name);
|
||||
}
|
||||
|
||||
Variant AnimatedModel::GetParameterValue(const Guid& id)
|
||||
const Variant& AnimatedModel::GetParameterValue(const Guid& id) const
|
||||
{
|
||||
CHECK_ANIM_GRAPH_PARAM_ACCESS_RESULT(Variant::Null);
|
||||
for (auto& param : GraphInstance.Parameters)
|
||||
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="name">The parameter name.</param>
|
||||
/// <returns>The value.</returns>
|
||||
API_FUNCTION() Variant GetParameterValue(const StringView& name);
|
||||
API_FUNCTION() const Variant& GetParameterValue(const StringView& name) const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the anim graph instance parameter value.
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="id">The parameter id.</param>
|
||||
/// <returns>The value.</returns>
|
||||
API_FUNCTION() Variant GetParameterValue(const Guid& id);
|
||||
API_FUNCTION() const Variant& GetParameterValue(const Guid& id) const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the anim graph instance parameter value.
|
||||
|
||||
@@ -91,14 +91,14 @@ Variant ParticleEffectParameter::GetDefaultValue() const
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
Variant ParticleEffectParameter::GetDefaultEmitterValue() const
|
||||
const Variant& ParticleEffectParameter::GetDefaultEmitterValue() const
|
||||
{
|
||||
CHECK_RETURN(IsValid(), Variant::False);
|
||||
const ParticleSystemParameter& param = _effect->ParticleSystem->Emitters[_emitterIndex]->Graph.Parameters[_paramIndex];
|
||||
return param.Value;
|
||||
}
|
||||
|
||||
Variant ParticleEffectParameter::GetValue() const
|
||||
const Variant& ParticleEffectParameter::GetValue() const
|
||||
{
|
||||
CHECK_RETURN(IsValid(), Variant::False);
|
||||
const Variant& paramValue = _effect->Instance.Emitters[_emitterIndex].Parameters[_paramIndex];
|
||||
@@ -205,7 +205,7 @@ ParticleEffectParameter* ParticleEffect::GetParameter(const StringView& emitterT
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Variant ParticleEffect::GetParameterValue(const StringView& emitterTrackName, const StringView& paramName)
|
||||
const Variant& ParticleEffect::GetParameterValue(const StringView& emitterTrackName, const StringView& paramName)
|
||||
{
|
||||
const auto param = GetParameter(emitterTrackName, paramName);
|
||||
CHECK_RETURN(param, Variant::Null);
|
||||
|
||||
@@ -109,13 +109,13 @@ public:
|
||||
/// Gets the default value of the parameter (set in particle emitter asset).
|
||||
/// </summary>
|
||||
/// <returns>The default value.</returns>
|
||||
API_PROPERTY() Variant GetDefaultEmitterValue() const;
|
||||
API_PROPERTY() const Variant& GetDefaultEmitterValue() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the parameter.
|
||||
/// </summary>
|
||||
/// <returns>The value.</returns>
|
||||
API_PROPERTY() Variant GetValue() const;
|
||||
API_PROPERTY() const Variant& GetValue() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of the parameter.
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
/// <param name="emitterTrackName">The emitter track name (in particle system asset).</param>
|
||||
/// <param name="paramName">The emitter parameter name (in particle emitter asset).</param>
|
||||
/// <returns>The value.</returns>
|
||||
API_FUNCTION() Variant GetParameterValue(const StringView& emitterTrackName, const StringView& paramName);
|
||||
API_FUNCTION() const Variant& GetParameterValue(const StringView& emitterTrackName, const StringView& paramName);
|
||||
|
||||
/// <summary>
|
||||
/// Set the particle parameter value.
|
||||
|
||||
@@ -778,7 +778,16 @@ void WindowsWindow::UpdateCursor()
|
||||
if (!_lastCursorHidden)
|
||||
{
|
||||
_lastCursorHidden = true;
|
||||
::ShowCursor(FALSE);
|
||||
while(::ShowCursor(FALSE) >= 0)
|
||||
{
|
||||
if (_cursorHiddenSafetyCount >= 100)
|
||||
{
|
||||
LOG(Warning, "Cursor has failed to hide.");
|
||||
break;
|
||||
}
|
||||
_cursorHiddenSafetyCount += 1;
|
||||
}
|
||||
_cursorHiddenSafetyCount = 0;
|
||||
}
|
||||
::SetCursor(nullptr);
|
||||
return;
|
||||
@@ -786,7 +795,16 @@ void WindowsWindow::UpdateCursor()
|
||||
else if (_lastCursorHidden)
|
||||
{
|
||||
_lastCursorHidden = false;
|
||||
::ShowCursor(TRUE);
|
||||
while(::ShowCursor(TRUE) < 0)
|
||||
{
|
||||
if (_cursorHiddenSafetyCount >= 100)
|
||||
{
|
||||
LOG(Warning, "Cursor has failed to show.");
|
||||
break;
|
||||
}
|
||||
_cursorHiddenSafetyCount += 1;
|
||||
}
|
||||
_cursorHiddenSafetyCount = 0;
|
||||
}
|
||||
|
||||
int32 index = 0;
|
||||
|
||||
@@ -29,6 +29,7 @@ private:
|
||||
bool _trackingMouse = false;
|
||||
bool _clipCursorSet = false;
|
||||
bool _lastCursorHidden = false;
|
||||
int _cursorHiddenSafetyCount = 0;
|
||||
bool _isDuringMaximize = false;
|
||||
Windows::HANDLE _monitor = nullptr;
|
||||
Windows::LONG _clipCursorRect[4];
|
||||
|
||||
@@ -306,7 +306,7 @@ HRESULT LoadFromEXRFile(const StringView& path, DirectX::ScratchImage& image)
|
||||
LOG_STR(Warning, String(err));
|
||||
FreeEXRErrorMessage(err);
|
||||
}
|
||||
return S_FALSE;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Setup image
|
||||
@@ -326,7 +326,7 @@ HRESULT LoadFromEXRFile(const StringView& path, DirectX::ScratchImage& image)
|
||||
return result;
|
||||
#else
|
||||
LOG(Warning, "EXR format is not supported.");
|
||||
return S_FALSE;
|
||||
return E_FAIL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace FlaxEngine.GUI
|
||||
if (value > _maximum)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
_minimum = value;
|
||||
UpdateThumb();
|
||||
if (Value < _minimum)
|
||||
Value = _minimum;
|
||||
}
|
||||
@@ -116,6 +117,7 @@ namespace FlaxEngine.GUI
|
||||
if (value < _minimum)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
_maximum = value;
|
||||
UpdateThumb();
|
||||
if (Value > _maximum)
|
||||
Value = _maximum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user