|
4 | 4 | import cam72cam.mod.model.common.ModelLoader; |
5 | 5 | import cam72cam.mod.model.common.util.FaceAccessor; |
6 | 6 | import cam72cam.mod.render.common.ModelRenderer; |
7 | | -import cam72cam.mod.render.obj.OBJTextureSheet; |
| 7 | +import cam72cam.mod.render.common.CachedTexture; |
8 | 8 | import cam72cam.mod.resource.Identifier; |
9 | 9 |
|
10 | 10 | import java.util.*; |
@@ -32,9 +32,9 @@ public class Model { |
32 | 32 | public final int packedTextureHeight; |
33 | 33 | private int defaultLodSize; |
34 | 34 |
|
35 | | - private final Map<String, NavigableMap<Integer, OBJTextureSheet>> textures = new HashMap<>(); |
36 | | - private final Map<String, NavigableMap<Integer, OBJTextureSheet>> speculars = new HashMap<>(); |
37 | | - private final Map<String, NavigableMap<Integer, OBJTextureSheet>> normals = new HashMap<>(); |
| 35 | + private final Map<String, NavigableMap<Integer, CachedTexture>> textures = new HashMap<>(); |
| 36 | + private final Map<String, NavigableMap<Integer, CachedTexture>> speculars = new HashMap<>(); |
| 37 | + private final Map<String, NavigableMap<Integer, CachedTexture>> normals = new HashMap<>(); |
38 | 38 |
|
39 | 39 | public String hash; |
40 | 40 |
|
@@ -66,9 +66,9 @@ public Model(Identifier location, VAOLayout layout, Supplier<float[]> vboSupplie |
66 | 66 | * @param spec specular sheets per variant/LOD (may be empty) |
67 | 67 | * @param norm normal sheets per variant/LOD (may be empty) |
68 | 68 | */ |
69 | | - public void linkTextures(Map<String, NavigableMap<Integer, OBJTextureSheet>> tex, |
70 | | - Map<String, NavigableMap<Integer, OBJTextureSheet>> spec, |
71 | | - Map<String, NavigableMap<Integer, OBJTextureSheet>> norm) { |
| 69 | + public void linkTextures(Map<String, NavigableMap<Integer, CachedTexture>> tex, |
| 70 | + Map<String, NavigableMap<Integer, CachedTexture>> spec, |
| 71 | + Map<String, NavigableMap<Integer, CachedTexture>> norm) { |
72 | 72 | this.textures.putAll(tex); |
73 | 73 | this.speculars.putAll(spec); |
74 | 74 | this.normals.putAll(norm); |
@@ -198,17 +198,17 @@ public float[] getVboData() { |
198 | 198 | } |
199 | 199 |
|
200 | 200 | /** @return albedo texture sheets, keyed by variant name then LOD size */ |
201 | | - public Map<String, NavigableMap<Integer, OBJTextureSheet>> getTextures() { |
| 201 | + public Map<String, NavigableMap<Integer, CachedTexture>> getTextures() { |
202 | 202 | return textures; |
203 | 203 | } |
204 | 204 |
|
205 | 205 | /** @return specular texture sheets, keyed by variant name then LOD size */ |
206 | | - public Map<String, NavigableMap<Integer, OBJTextureSheet>> getSpeculars() { |
| 206 | + public Map<String, NavigableMap<Integer, CachedTexture>> getSpeculars() { |
207 | 207 | return speculars; |
208 | 208 | } |
209 | 209 |
|
210 | 210 | /** @return normal texture sheets, keyed by variant name then LOD size */ |
211 | | - public Map<String, NavigableMap<Integer, OBJTextureSheet>> getNormals() { |
| 211 | + public Map<String, NavigableMap<Integer, CachedTexture>> getNormals() { |
212 | 212 | return normals; |
213 | 213 | } |
214 | 214 |
|
@@ -253,18 +253,18 @@ protected final void shareTexturesWith(Model owner) { |
253 | 253 | } |
254 | 254 |
|
255 | 255 | private void deallocTextures() { |
256 | | - for (Map<Integer, OBJTextureSheet> lodMap : textures.values()) { |
257 | | - for (OBJTextureSheet texture : lodMap.values()) { |
| 256 | + for (Map<Integer, CachedTexture> lodMap : textures.values()) { |
| 257 | + for (CachedTexture texture : lodMap.values()) { |
258 | 258 | texture.dealloc(); |
259 | 259 | } |
260 | 260 | } |
261 | | - for (Map<Integer, OBJTextureSheet> lodMap : speculars.values()) { |
262 | | - for (OBJTextureSheet texture : lodMap.values()) { |
| 261 | + for (Map<Integer, CachedTexture> lodMap : speculars.values()) { |
| 262 | + for (CachedTexture texture : lodMap.values()) { |
263 | 263 | texture.dealloc(); |
264 | 264 | } |
265 | 265 | } |
266 | | - for (Map<Integer, OBJTextureSheet> lodMap : normals.values()) { |
267 | | - for (OBJTextureSheet texture : lodMap.values()) { |
| 266 | + for (Map<Integer, CachedTexture> lodMap : normals.values()) { |
| 267 | + for (CachedTexture texture : lodMap.values()) { |
268 | 268 | texture.dealloc(); |
269 | 269 | } |
270 | 270 | } |
|
0 commit comments