mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #10 from danteruiz/mergedInterstitialBugFixes
remove magic numbers
This commit is contained in:
commit
2143664e33
1 changed files with 4 additions and 7 deletions
|
@ -459,13 +459,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var MAX_TEXTURE_STABILITY_COUNT = 30;
|
||||||
|
var INTERVAL_PROGRESS = 0.04;
|
||||||
function update() {
|
function update() {
|
||||||
var renderStats = Render.getConfig("Stats");
|
var renderStats = Render.getConfig("Stats");
|
||||||
var physicsEnabled = Window.isPhysicsEnabled();
|
var physicsEnabled = Window.isPhysicsEnabled();
|
||||||
var thisInterval = Date.now();
|
var thisInterval = Date.now();
|
||||||
var deltaTime = (thisInterval - lastInterval);
|
var deltaTime = (thisInterval - lastInterval);
|
||||||
lastInterval = thisInterval;
|
lastInterval = thisInterval;
|
||||||
var deltaTimeMS = deltaTime / 1000;
|
|
||||||
|
|
||||||
var domainLoadingProgressPercentage = Window.domainLoadingProgress();
|
var domainLoadingProgressPercentage = Window.domainLoadingProgress();
|
||||||
var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage);
|
var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage);
|
||||||
|
@ -485,7 +486,7 @@
|
||||||
|
|
||||||
textureMemSizeAtLastCheck = textureResourceGPUMemSize;
|
textureMemSizeAtLastCheck = textureResourceGPUMemSize;
|
||||||
|
|
||||||
if (textureMemSizeStabilityCount >= 30) {
|
if (textureMemSizeStabilityCount >= MAX_TEXTURE_STABILITY_COUNT) {
|
||||||
|
|
||||||
if (textureResourceGPUMemSize > 0) {
|
if (textureResourceGPUMemSize > 0) {
|
||||||
var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize);
|
var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize);
|
||||||
|
@ -501,11 +502,7 @@
|
||||||
target = TOTAL_LOADING_PROGRESS;
|
target = TOTAL_LOADING_PROGRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deltaTime > 1.0) {
|
currentProgress = lerp(currentProgress, target, INTERVAL_PROGRESS);
|
||||||
deltaTimeMS = 0.02;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentProgress = lerp(currentProgress, target, (deltaTimeMS * 2.0));
|
|
||||||
var properties = {
|
var properties = {
|
||||||
localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / TOTAL_LOADING_PROGRESS))), y: -0.935, z: 0.0 },
|
localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / TOTAL_LOADING_PROGRESS))), y: -0.935, z: 0.0 },
|
||||||
dimensions: {
|
dimensions: {
|
||||||
|
|
Loading…
Reference in a new issue