Skip to content

Commit 14bf3d2

Browse files
committed
At least get background colors back.
There's still issues with fading in visible cells.
1 parent 1107da8 commit 14bf3d2

File tree

1 file changed

+48
-52
lines changed
  • SquidSquad/DungeonDemo/core/src/main/java/com/github/yellowstonegames

1 file changed

+48
-52
lines changed

SquidSquad/DungeonDemo/core/src/main/java/com/github/yellowstonegames/DungeonDemo.java

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -289,62 +289,58 @@ public void putMap(){
289289
if (vision.seen.contains(x, y)) {
290290
// cells that were seen more than one frame ago, and aren't visible now, appear as a gray memory.
291291
gg.backgrounds[x][y] = toRGBA8888(vision.backgroundColors[x][y]);
292-
gg.put(x, y, glyph, stoneText);
292+
gg.put(x, y, (x == playerX && y == playerY) ? ' ' : glyph, stoneText);
293293
}
294294
}
295295
}
296296

297-
// for (int y = 0; y < PLACE_HEIGHT; y++) {
298-
// for (int x = 0; x < PLACE_WIDTH; x++) {
299-
// if (vision.inView.contains(x, y)) {
300-
// if(toCursor.contains(Coord.get(x, y))){
301-
// gg.backgrounds[x][y] = rainbow;
302-
// gg.put(x, y, vision.prunedPlaceMap[x][y], stoneText);
303-
// }
304-
// else {
305-
// switch (vision.prunedPlaceMap[x][y]) {
306-
// case '~':
307-
// gg.backgrounds[x][y] = toRGBA8888(lighten(DEEP_OKLAB, 0.6f * Math.min(1.2f, Math.max(0, light[x][y] + waves.getConfiguredNoise(x, y, modifiedTime)))));
308-
// gg.put(x, y, vision.prunedPlaceMap[x][y], deepText);
309-
// break;
310-
// case ',':
311-
// gg.backgrounds[x][y] = toRGBA8888(lighten(SHALLOW_OKLAB, 0.6f * Math.min(1.2f, Math.max(0, light[x][y] + waves.getConfiguredNoise(x, y, modifiedTime)))));
312-
// gg.put(x, y, vision.prunedPlaceMap[x][y], shallowText);
313-
// break;
314-
// case '"':
315-
// gg.backgrounds[x][y] = toRGBA8888(darken(lerpColors(GRASS_OKLAB, DRY_OKLAB, waves.getConfiguredNoise(x, y) * 0.5f + 0.5f), 0.4f * Math.min(1.1f, Math.max(0, 1f - light[x][y] + waves.getConfiguredNoise(x, y, modifiedTime * 0.7f)))));
316-
// gg.put(x, y, vision.prunedPlaceMap[x][y], grassText);
317-
// break;
318-
// case ' ':
319-
// gg.backgrounds[x][y] = 0;
320-
// break;
321-
// default:
322-
// gg.backgrounds[x][y] = toRGBA8888(lighten(STONE_OKLAB, 0.6f * light[x][y]));
323-
// gg.put(x, y, vision.prunedPlaceMap[x][y], stoneText);
324-
// }
325-
// }
326-
// } else if (seen.contains(x, y)) {
327-
// switch (vision.prunedPlaceMap[x][y]) {
328-
// case '~':
329-
// gg.backgrounds[x][y] = toRGBA8888(edit(DEEP_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
330-
// gg.put(x, y, vision.prunedPlaceMap[x][y], deepText);
331-
// break;
332-
// case ',':
333-
// gg.backgrounds[x][y] = toRGBA8888(edit(SHALLOW_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
334-
// gg.put(x, y, vision.prunedPlaceMap[x][y], shallowText);
335-
// break;
336-
// case ' ':
337-
// gg.backgrounds[x][y] = 0;
338-
// break;
339-
// default:
340-
// gg.backgrounds[x][y] = toRGBA8888(edit(STONE_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
341-
// gg.put(x, y, vision.prunedPlaceMap[x][y], stoneText);
342-
// }
343-
// } else {
344-
// gg.backgrounds[x][y] = 0;
345-
// }
346-
// }
347-
// }
297+
for (int y = 0; y < PLACE_HEIGHT; y++) {
298+
for (int x = 0; x < PLACE_WIDTH; x++) {
299+
if (vision.inView.contains(x, y)) {
300+
{
301+
switch (vision.prunedPlaceMap[x][y]) {
302+
case '~':
303+
gg.backgrounds[x][y] = toRGBA8888(lerpColors(DEEP_OKLAB, vision.backgroundColors[x][y], 0.4f + 0.3f * waves.getConfiguredNoise(x, y, time)));
304+
gg.put(x, y, vision.prunedPlaceMap[x][y], deepText);
305+
break;
306+
case ',':
307+
gg.backgrounds[x][y] = toRGBA8888(lerpColors(SHALLOW_OKLAB, vision.backgroundColors[x][y], 0.4f + 0.3f * waves.getConfiguredNoise(x, y, time)));
308+
gg.put(x, y, vision.prunedPlaceMap[x][y], shallowText);
309+
break;
310+
case '"':
311+
gg.backgrounds[x][y] = toRGBA8888(lerpColors(lerpColors(GRASS_OKLAB, DRY_OKLAB, waves.getConfiguredNoise(x, y) * 0.5f + 0.5f), vision.backgroundColors[x][y], 0.3f + 0.2f * waves.getConfiguredNoise(x, y, time * 0.7f)));
312+
gg.put(x, y, vision.prunedPlaceMap[x][y], grassText);
313+
break;
314+
case ' ':
315+
gg.backgrounds[x][y] = 0;
316+
break;
317+
default:
318+
gg.backgrounds[x][y] = toRGBA8888(lerpColors(STONE_OKLAB, vision.backgroundColors[x][y], 0.5f));
319+
gg.put(x, y, vision.prunedPlaceMap[x][y], stoneText);
320+
}
321+
}
322+
} else if (vision.seen.contains(x, y)) {
323+
switch (vision.prunedPlaceMap[x][y]) {
324+
case '~':
325+
gg.backgrounds[x][y] = toRGBA8888(edit(DEEP_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
326+
gg.put(x, y, vision.prunedPlaceMap[x][y], deepText);
327+
break;
328+
case ',':
329+
gg.backgrounds[x][y] = toRGBA8888(edit(SHALLOW_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
330+
gg.put(x, y, vision.prunedPlaceMap[x][y], shallowText);
331+
break;
332+
case ' ':
333+
gg.backgrounds[x][y] = 0;
334+
break;
335+
default:
336+
gg.backgrounds[x][y] = toRGBA8888(edit(STONE_OKLAB, 0f, 0f, 0f, 0f, 0.7f, 0f, 0f, 1f));
337+
gg.put(x, y, vision.prunedPlaceMap[x][y], stoneText);
338+
}
339+
} else {
340+
gg.backgrounds[x][y] = 0;
341+
}
342+
}
343+
}
348344
}
349345

350346
/**

0 commit comments

Comments
 (0)