|
21 | 21 |
|
22 | 22 | import com.badlogic.gdx.audio.Music;
|
23 | 23 | import com.badlogic.gdx.graphics.Color;
|
24 |
| -import com.badlogic.gdx.graphics.GL20; |
25 | 24 | import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
26 | 25 | import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
|
27 | 26 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
@@ -63,11 +62,8 @@ public class Scene implements Serializable, AssetConsumer {
|
63 | 62 | private SceneCamera camera = new SceneCamera();
|
64 | 63 |
|
65 | 64 | private Array<AtlasRegion> background;
|
66 |
| - private Array<AtlasRegion> lightMap; |
67 | 65 | private String backgroundAtlas;
|
68 | 66 | private String backgroundRegionId;
|
69 |
| - private String lightMapAtlas; |
70 |
| - private String lightMapRegionId; |
71 | 67 |
|
72 | 68 | /** For polygonal PathFinding */
|
73 | 69 | private PolygonalNavGraph polygonalNavGraph;
|
@@ -292,24 +288,6 @@ public void draw(SpriteBatch batch) {
|
292 | 288 | layer.draw(batch);
|
293 | 289 | batch.end();
|
294 | 290 | }
|
295 |
| - |
296 |
| - // Draw the light map |
297 |
| - if (lightMap != null) { |
298 |
| - // Multiplicative blending for light maps |
299 |
| - batch.setBlendFunction(GL20.GL_DST_COLOR, GL20.GL_ZERO); |
300 |
| - batch.setProjectionMatrix(camera.calculateParallaxMatrix(1, 1)); |
301 |
| - batch.begin(); |
302 |
| - |
303 |
| - float x = 0; |
304 |
| - |
305 |
| - for (AtlasRegion tile : lightMap) { |
306 |
| - batch.draw(tile, x, 0f); |
307 |
| - x += tile.getRegionWidth(); |
308 |
| - } |
309 |
| - |
310 |
| - batch.end(); |
311 |
| - batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); |
312 |
| - } |
313 | 291 | }
|
314 | 292 |
|
315 | 293 | public void drawBBoxLines(ShapeRenderer renderer) {
|
@@ -392,8 +370,6 @@ public void addActor(BaseActor actor) {
|
392 | 370 | public void setBackground(String bgAtlas, String bgId, String lightMapAtlas, String lightMapId) {
|
393 | 371 | this.backgroundAtlas = bgAtlas;
|
394 | 372 | this.backgroundRegionId = bgId;
|
395 |
| - this.lightMapAtlas = lightMapAtlas; |
396 |
| - this.lightMapRegionId = lightMapId; |
397 | 373 | }
|
398 | 374 |
|
399 | 375 | /**
|
@@ -547,22 +523,6 @@ public void setBackgroundRegionId(String backgroundRegionId) {
|
547 | 523 | this.backgroundRegionId = backgroundRegionId;
|
548 | 524 | }
|
549 | 525 |
|
550 |
| - public String getLightMapAtlas() { |
551 |
| - return lightMapAtlas; |
552 |
| - } |
553 |
| - |
554 |
| - public void setLightMapAtlas(String lightMapAtlas) { |
555 |
| - this.lightMapAtlas = lightMapAtlas; |
556 |
| - } |
557 |
| - |
558 |
| - public String getLightMapRegionId() { |
559 |
| - return lightMapRegionId; |
560 |
| - } |
561 |
| - |
562 |
| - public void setLightMapRegionId(String lightMapRegionId) { |
563 |
| - this.lightMapRegionId = lightMapRegionId; |
564 |
| - } |
565 |
| - |
566 | 526 | public String getMusicFilename() {
|
567 | 527 | return musicFilename;
|
568 | 528 | }
|
@@ -630,11 +590,6 @@ public void loadAssets() {
|
630 | 590 | EngineAssetManager.getInstance().loadAtlas(backgroundAtlas);
|
631 | 591 | }
|
632 | 592 |
|
633 |
| - // LOAD LIGHT MAP |
634 |
| - if (lightMapAtlas != null && !lightMapAtlas.isEmpty()) { |
635 |
| - EngineAssetManager.getInstance().loadAtlas(lightMapAtlas); |
636 |
| - } |
637 |
| - |
638 | 593 | if (musicFilename != null)
|
639 | 594 | EngineAssetManager.getInstance().loadMusic(musicFilename);
|
640 | 595 |
|
@@ -672,11 +627,6 @@ public void retrieveAssets() {
|
672 | 627 | // camera.updatePos(followActor);
|
673 | 628 | }
|
674 | 629 |
|
675 |
| - // RETRIEVE LIGHT MAP |
676 |
| - if (lightMapAtlas != null && !lightMapAtlas.isEmpty()) { |
677 |
| - lightMap = EngineAssetManager.getInstance().getRegions(lightMapAtlas, lightMapRegionId); |
678 |
| - } |
679 |
| - |
680 | 630 | // RETRIEVE ACTORS
|
681 | 631 | for (BaseActor a : actors.values()) {
|
682 | 632 | if (a instanceof AssetConsumer)
|
@@ -704,11 +654,6 @@ public void dispose() {
|
704 | 654 | EngineAssetManager.getInstance().disposeAtlas(backgroundAtlas);
|
705 | 655 | }
|
706 | 656 |
|
707 |
| - // LOAD LIGHT MAP |
708 |
| - if (lightMapAtlas != null && !lightMapAtlas.isEmpty()) { |
709 |
| - EngineAssetManager.getInstance().disposeAtlas(lightMapAtlas); |
710 |
| - } |
711 |
| - |
712 | 657 | // orderedActors.clear();
|
713 | 658 |
|
714 | 659 | for (BaseActor a : actors.values()) {
|
@@ -750,11 +695,6 @@ public void write(Json json) {
|
750 | 695 | json.writeValue("backgroundRegionId", backgroundRegionId);
|
751 | 696 | }
|
752 | 697 |
|
753 |
| - if (lightMapAtlas != null) { |
754 |
| - json.writeValue("lightMapAtlas", lightMapAtlas); |
755 |
| - json.writeValue("lightMapRegionId", lightMapRegionId); |
756 |
| - } |
757 |
| - |
758 | 698 | if (musicFilename != null) {
|
759 | 699 | json.writeValue("musicFilename", musicFilename);
|
760 | 700 | json.writeValue("loopMusic", loopMusic);
|
@@ -823,8 +763,6 @@ public void read(Json json, JsonValue jsonData) {
|
823 | 763 |
|
824 | 764 | backgroundAtlas = json.readValue("backgroundAtlas", String.class, jsonData);
|
825 | 765 | backgroundRegionId = json.readValue("backgroundRegionId", String.class, jsonData);
|
826 |
| - lightMapAtlas = json.readValue("lightMapAtlas", String.class, jsonData); |
827 |
| - lightMapRegionId = json.readValue("lightMapRegionId", String.class, jsonData); |
828 | 766 |
|
829 | 767 | musicFilename = json.readValue("musicFilename", String.class, jsonData);
|
830 | 768 |
|
|
0 commit comments