Include rendering settings.

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 3 years ago committed by GitHub
parent 17de1993ca
commit 3dc3129ac1
  1. BIN
      bin/RabiClone.jar
  2. 10
      src/sig/RabiClone.java
  3. 5
      src/sig/engine/Panel.java
  4. 5
      src/sig/map/Map.java

Binary file not shown.

@ -25,6 +25,7 @@ import sig.engine.PaletteColor;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.RenderingHints;
public class RabiClone { public class RabiClone {
public static final String PROGRAM_NAME = "RabiClone"; public static final String PROGRAM_NAME = "RabiClone";
@ -62,10 +63,19 @@ public class RabiClone {
public static long TIME = 0; public static long TIME = 0;
public static long scaleTime; public static long scaleTime;
public static RenderingHints RENDERHINTS = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
public static void main(String[] args) { public static void main(String[] args) {
System.setProperty("sun.java2d.transaccel", "True"); System.setProperty("sun.java2d.transaccel", "True");
System.setProperty("sun.java2d.d3d", "True"); System.setProperty("sun.java2d.d3d", "True");
System.setProperty("sun.java2d.ddforcevram", "True"); System.setProperty("sun.java2d.ddforcevram", "True");
System.setProperty("sun.java2d.xrender", "True");
RENDERHINTS.put(RenderingHints.KEY_COLOR_RENDERING,RenderingHints.VALUE_COLOR_RENDER_SPEED);
RENDERHINTS.put(RenderingHints.KEY_DITHERING,RenderingHints.VALUE_DITHER_DISABLE);
RENDERHINTS.put(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
RENDERHINTS.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
RENDERHINTS.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_SPEED);
Key.InitializeKeyConversionMap(); Key.InitializeKeyConversionMap();

@ -1,6 +1,7 @@
package sig.engine; package sig.engine;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Image; import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.image.ColorModel; import java.awt.image.ColorModel;
import java.awt.image.MemoryImageSource; import java.awt.image.MemoryImageSource;
@ -19,6 +20,7 @@ import javax.swing.JPanel;
import javax.swing.event.MouseInputListener; import javax.swing.event.MouseInputListener;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import java.awt.Graphics2D;
import sig.DrawLoop; import sig.DrawLoop;
import sig.RabiClone; import sig.RabiClone;
@ -367,7 +369,8 @@ public class Panel extends JPanel implements Runnable,KeyListener {
do { do {
do { do {
if (RabiClone.f.getBufferStrategy()!=null) { if (RabiClone.f.getBufferStrategy()!=null) {
Graphics g2 = RabiClone.f.getBufferStrategy().getDrawGraphics(); Graphics2D g2 = (Graphics2D)RabiClone.f.getBufferStrategy().getDrawGraphics();
g2.setRenderingHints(RabiClone.RENDERHINTS);
if (g2!=null) { if (g2!=null) {
try { try {
paintComponent(g2); paintComponent(g2);

@ -48,7 +48,9 @@ public class Map {
public static Map LoadMap(Maps map) { public static Map LoadMap(Maps map) {
try { try {
Map newMap;
if (RabiClone.CURRENT_MAP!=null) { if (RabiClone.CURRENT_MAP!=null) {
newMap = map.getMap();
if (RabiClone.CURRENT_MAP!=map) { if (RabiClone.CURRENT_MAP!=map) {
Map currentMapData = RabiClone.CURRENT_MAP.getMap(); Map currentMapData = RabiClone.CURRENT_MAP.getMap();
resetMapData(currentMapData); resetMapData(currentMapData);
@ -60,8 +62,9 @@ public class Map {
} }
} else { } else {
map.initializeMap(); map.initializeMap();
RabiClone.CURRENT_MAP=map;
newMap = map.getMap();
} }
Map newMap = RabiClone.CURRENT_MAP.getMap()!=null?RabiClone.CURRENT_MAP.getMap():new Map();
DataInputStream stream = new DataInputStream(new FileInputStream(map.getFile())); DataInputStream stream = new DataInputStream(new FileInputStream(map.getFile()));
int marker=0; int marker=0;
int iterationCount=MAP_WIDTH*MAP_HEIGHT; int iterationCount=MAP_WIDTH*MAP_HEIGHT;

Loading…
Cancel
Save