mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 09:57:26 +02:00
Merge pull request #4990 from AndrewMeadows/isentropic
fix crash when creating a box with edit.js
This commit is contained in:
commit
6b3c51c5b7
3 changed files with 15 additions and 8 deletions
|
@ -957,9 +957,6 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
#endif
|
#endif
|
||||||
setLastEdited(now);
|
setLastEdited(now);
|
||||||
somethingChangedNotification(); // notify derived classes that something has changed
|
somethingChangedNotification(); // notify derived classes that something has changed
|
||||||
if (_created == UNKNOWN_CREATED_TIME) {
|
|
||||||
_created = now;
|
|
||||||
}
|
|
||||||
if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) {
|
if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) {
|
||||||
// anything that sets the transform or velocity must update _lastSimulated which is used
|
// anything that sets the transform or velocity must update _lastSimulated which is used
|
||||||
// for kinematic extrapolation (e.g. we want to extrapolate forward from this moment
|
// for kinematic extrapolation (e.g. we want to extrapolate forward from this moment
|
||||||
|
@ -968,6 +965,16 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// timestamps
|
||||||
|
quint64 timestamp = properties.getCreated();
|
||||||
|
if (_created == UNKNOWN_CREATED_TIME && timestamp != UNKNOWN_CREATED_TIME) {
|
||||||
|
quint64 now = usecTimestampNow();
|
||||||
|
if (timestamp > now) {
|
||||||
|
timestamp = now;
|
||||||
|
}
|
||||||
|
_created = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,16 +93,16 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeferredLightingEffect::bindSimpleProgram() {
|
void DeferredLightingEffect::bindSimpleProgram() {
|
||||||
// DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
|
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
|
||||||
_simpleProgram.bind();
|
_simpleProgram.bind();
|
||||||
_simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity());
|
_simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity());
|
||||||
// glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeferredLightingEffect::releaseSimpleProgram() {
|
void DeferredLightingEffect::releaseSimpleProgram() {
|
||||||
// glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
_simpleProgram.release();
|
_simpleProgram.release();
|
||||||
// DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
|
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeferredLightingEffect::renderSolidSphere(float radius, int slices, int stacks, const glm::vec4& color) {
|
void DeferredLightingEffect::renderSolidSphere(float radius, int slices, int stacks, const glm::vec4& color) {
|
||||||
|
|
Loading…
Reference in a new issue