@pirireis/webglobeplugins 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -55,9 +55,7 @@ ${relativeBBoxPositionRadian}
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
void main() {
|
|
58
|
-
|
|
59
|
-
float altitude = 20000.0;
|
|
60
|
-
bool hasDemSample = false;
|
|
58
|
+
|
|
61
59
|
|
|
62
60
|
// Always define v_index to avoid undefined varyings when picking is disabled.
|
|
63
61
|
|
|
@@ -74,6 +72,9 @@ void main() {
|
|
|
74
72
|
// Always define v_index to avoid undefined varyings when picking is disabled.
|
|
75
73
|
v_index = a_index;
|
|
76
74
|
|
|
75
|
+
|
|
76
|
+
float elevation = ${WORLD_RADIUS_3D};
|
|
77
|
+
float altitude = 20000.0;
|
|
77
78
|
if (is3D == true) {
|
|
78
79
|
for (int i = 0; i < 6; i++) {
|
|
79
80
|
if( i == u_breakLoopIndex - 1 ) {
|
package/programs/programcache.js
CHANGED
|
@@ -89,35 +89,41 @@ const glProgramCache = (function () {
|
|
|
89
89
|
})();
|
|
90
90
|
const noRegisterGlobeProgramCache = (function () {
|
|
91
91
|
const cache = new Map();
|
|
92
|
-
const keyFunction = (globe, ProgramClass, mode) => `${globe.id}_${ProgramClass.name}_${mode}`;
|
|
93
92
|
function getProgram(globe, ProgramClass, mode) {
|
|
94
|
-
const key = keyFunction(globe, ProgramClass, mode);
|
|
95
93
|
if (!cache.has(globe)) {
|
|
96
94
|
cache.set(globe, new Map());
|
|
97
95
|
}
|
|
98
96
|
;
|
|
99
|
-
if (!cache.get(globe).has(
|
|
100
|
-
cache.get(globe).set(
|
|
97
|
+
if (!cache.get(globe).has(ProgramClass)) {
|
|
98
|
+
cache.get(globe).set(ProgramClass, new Map());
|
|
99
|
+
}
|
|
100
|
+
;
|
|
101
|
+
const modeKey = mode !== undefined ? mode : '__default__';
|
|
102
|
+
if (!cache.get(globe).get(ProgramClass).has(modeKey)) {
|
|
103
|
+
cache.get(globe).get(ProgramClass).set(modeKey, {
|
|
101
104
|
program: new ProgramClass(globe, mode),
|
|
102
105
|
count: 1
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
else {
|
|
106
|
-
cache.get(globe).get(
|
|
109
|
+
cache.get(globe).get(ProgramClass).get(modeKey).count++;
|
|
107
110
|
}
|
|
108
|
-
return cache.get(globe).get(
|
|
111
|
+
return cache.get(globe).get(ProgramClass).get(modeKey).program;
|
|
109
112
|
}
|
|
110
113
|
;
|
|
111
114
|
function releaseProgram(globe, ProgramClass, mode) {
|
|
112
|
-
const
|
|
113
|
-
if (cache.has(globe) && cache.get(globe).has(
|
|
114
|
-
if (cache.get(globe).get(
|
|
115
|
+
const modeKey = mode !== undefined ? mode : '__default__';
|
|
116
|
+
if (cache.has(globe) && cache.get(globe).has(ProgramClass) && cache.get(globe).get(ProgramClass).has(modeKey)) {
|
|
117
|
+
if (cache.get(globe).get(ProgramClass).get(modeKey).count === 0) {
|
|
115
118
|
throw new Error("The program counter is already 0, cannot release program");
|
|
116
119
|
}
|
|
117
|
-
cache.get(globe).get(
|
|
118
|
-
if (cache.get(globe).get(
|
|
119
|
-
cache.get(globe).get(
|
|
120
|
-
cache.get(globe).delete(
|
|
120
|
+
cache.get(globe).get(ProgramClass).get(modeKey).count--;
|
|
121
|
+
if (cache.get(globe).get(ProgramClass).get(modeKey).count === 0) {
|
|
122
|
+
cache.get(globe).get(ProgramClass).get(modeKey).program.free();
|
|
123
|
+
cache.get(globe).get(ProgramClass).delete(modeKey);
|
|
124
|
+
if (cache.get(globe).get(ProgramClass).size === 0) {
|
|
125
|
+
cache.get(globe).delete(ProgramClass);
|
|
126
|
+
}
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
129
|
}
|