mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-12 12:30:07 +00:00
NTSC bleed-over is now an optional rendering feature, disabled for now
This commit is contained in:
parent
31c14d8d4c
commit
24028d2d69
@ -8,7 +8,7 @@ import javafx.scene.image.WritableImage;
|
||||
*/
|
||||
public abstract class TileRenderer {
|
||||
|
||||
public abstract WritableImage redrawSprite(byte[] spriteData, WritableImage image);
|
||||
public abstract WritableImage redrawSprite(byte[] spriteData, WritableImage image, boolean useBleedOver);
|
||||
|
||||
public abstract int getWidth();
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class AppleTileRenderer extends TileRenderer {
|
||||
public static boolean useSolidPalette = true;
|
||||
|
||||
@Override
|
||||
public WritableImage redrawSprite(byte[] spriteData, WritableImage img) {
|
||||
public WritableImage redrawSprite(byte[] spriteData, WritableImage img, boolean useBleedOver) {
|
||||
if (img == null) {
|
||||
img = new WritableImage(28, 32);
|
||||
}
|
||||
@ -23,12 +23,14 @@ public class AppleTileRenderer extends TileRenderer {
|
||||
}
|
||||
int[][] palette = useSolidPalette ? solidPalette : textPalette;
|
||||
for (int y = 0; y < 16; y++) {
|
||||
int bleedOver = (spriteData[y * 2 + 1] & 192) == 192 ? 256 : 0;
|
||||
int bleedOver = useBleedOver ? (spriteData[y * 2 + 1] & 192) == 192 ? 256 : 0 : 0;
|
||||
int scan = hgrToDhgr[bleedOver | (spriteData[y * 2] & 255)][spriteData[y * 2 + 1] & 255];
|
||||
int last = (scan >> 26) & 3;
|
||||
int keep = scan & 0xff;
|
||||
scan <<= 2;
|
||||
scan |= last;
|
||||
if (useBleedOver) {
|
||||
scan |= last;
|
||||
}
|
||||
for (int x = 0; x < 14; x++) {
|
||||
boolean isHiBit = ((spriteData[y * 2 + x / 7] & 128) != 0);
|
||||
|
||||
|
@ -3,7 +3,6 @@ package org.badvision.outlaweditor.apple.dhgr;
|
||||
import org.badvision.outlaweditor.apple.*;
|
||||
import javafx.scene.image.WritableImage;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.badvision.outlaweditor.TileRenderer;
|
||||
import static org.badvision.outlaweditor.apple.AppleNTSCGraphics.*;
|
||||
|
||||
/**
|
||||
@ -12,7 +11,7 @@ import static org.badvision.outlaweditor.apple.AppleNTSCGraphics.*;
|
||||
*/
|
||||
public class AppleDHGRTileRenderer extends AppleTileRenderer {
|
||||
@Override
|
||||
public WritableImage redrawSprite(byte[] spriteData, WritableImage img) {
|
||||
public WritableImage redrawSprite(byte[] spriteData, WritableImage img, boolean useBleedOver) {
|
||||
if (img == null) {
|
||||
img = new WritableImage(28, 32);
|
||||
}
|
||||
@ -30,7 +29,9 @@ public class AppleDHGRTileRenderer extends AppleTileRenderer {
|
||||
int last = (scan >> 26) & 3;
|
||||
int keep = scan & 0xff;
|
||||
scan <<= 2;
|
||||
scan |= last;
|
||||
if (useBleedOver) {
|
||||
scan |= last;
|
||||
}
|
||||
for (int x = 0; x < 14; x++) {
|
||||
boolean isHiBit = ((spriteData[y * 2 + x / 7] & 128) != 0);
|
||||
|
||||
|
@ -168,6 +168,6 @@ public enum FillPattern {
|
||||
for (int i=0; i < pattern.length; i++) {
|
||||
b[i]=(byte) pattern[i];
|
||||
}
|
||||
return Platform.AppleII_DHGR.tileRenderer.redrawSprite(b, null);
|
||||
return Platform.AppleII_DHGR.tileRenderer.redrawSprite(b, null, true);
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class TileUtils {
|
||||
System.err.println("Unable to find any platform support for '" + d.getPlatform() + "'");
|
||||
continue;
|
||||
}
|
||||
displays.put(p, p.tileRenderer.redrawSprite(d.getValue(), displays.get(p)));
|
||||
displays.put(p, p.tileRenderer.redrawSprite(d.getValue(), displays.get(p), false));
|
||||
}
|
||||
DataProducer.notifyObservers(t);
|
||||
}
|
||||
@ -79,7 +79,7 @@ public class TileUtils {
|
||||
public static WritableImage getImage(Tile t, Platform p) {
|
||||
Map<Platform, WritableImage> displays = getDisplay(t);
|
||||
byte[] data = getPlatformData(t, p);
|
||||
return displays.put(p, p.tileRenderer.redrawSprite(data, displays.get(p)));
|
||||
return displays.put(p, p.tileRenderer.redrawSprite(data, displays.get(p), false));
|
||||
}
|
||||
|
||||
public static void setImage(Tile t, Platform p, WritableImage img) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user