Remove unused imports. Fix deprecated draw functions
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
8f13a24fd4
commit
ce856fc8b0
@ -5,14 +5,9 @@ import javax.swing.JFrame;
|
|||||||
import net.java.games.input.Component;
|
import net.java.games.input.Component;
|
||||||
import net.java.games.input.Controller;
|
import net.java.games.input.Controller;
|
||||||
import net.java.games.input.ControllerEnvironment;
|
import net.java.games.input.ControllerEnvironment;
|
||||||
import net.java.games.input.ControllerEvent;
|
|
||||||
import net.java.games.input.ControllerListener;
|
|
||||||
import net.java.games.input.Event;
|
|
||||||
import net.java.games.input.EventQueue;
|
|
||||||
import net.java.games.input.Component.Identifier;
|
import net.java.games.input.Component.Identifier;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import sig.engine.Panel;
|
import sig.engine.Panel;
|
||||||
@ -74,7 +69,6 @@ public class RabiClone{
|
|||||||
|
|
||||||
p.render();
|
p.render();
|
||||||
|
|
||||||
Event event = new Event();
|
|
||||||
long lastGameTime = System.nanoTime();
|
long lastGameTime = System.nanoTime();
|
||||||
while (true) {
|
while (true) {
|
||||||
long timePassed = System.nanoTime()-lastGameTime;
|
long timePassed = System.nanoTime()-lastGameTime;
|
||||||
|
@ -18,8 +18,6 @@ import javax.swing.JFrame;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.event.MouseInputListener;
|
import javax.swing.event.MouseInputListener;
|
||||||
|
|
||||||
import net.java.games.input.Component;
|
|
||||||
|
|
||||||
import java.awt.event.KeyListener;
|
import java.awt.event.KeyListener;
|
||||||
|
|
||||||
import sig.DrawLoop;
|
import sig.DrawLoop;
|
||||||
@ -217,21 +215,16 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
|||||||
DrawLoop.drawGame(this);
|
DrawLoop.drawGame(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void FillRect(byte[] p,byte col,double x,double y,double w,double h) {
|
||||||
* @deprecated Until it implements the new indexed coloring mode, this is unusable.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void FillRect(int[] p,Color col,double x,double y,double w,double h) {
|
|
||||||
for (int xx=0;xx<w;xx++) {
|
for (int xx=0;xx<w;xx++) {
|
||||||
for (int yy=0;yy<h;yy++) {
|
for (int yy=0;yy<h;yy++) {
|
||||||
int index = ((int)y+yy)*getWidth()+(int)x+xx;
|
int index = ((int)y+yy)*getWidth()+(int)x+xx;
|
||||||
//TODO Old Color System
|
Draw(p,index,col);
|
||||||
//Draw(p,index,col.getColor());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FillCircle(int[] p,Color col,double center_x,double center_y,double r) {
|
public void FillCircle(byte[] p,byte col,double center_x,double center_y,double r) {
|
||||||
int counter=0;
|
int counter=0;
|
||||||
Point[] points = new Point[CIRCLE_PRECISION];
|
Point[] points = new Point[CIRCLE_PRECISION];
|
||||||
for (double theta=0;theta<Math.PI*2;theta+=((Math.PI*2)/CIRCLE_PRECISION)) {
|
for (double theta=0;theta<Math.PI*2;theta+=((Math.PI*2)/CIRCLE_PRECISION)) {
|
||||||
@ -243,7 +236,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void FillOval(int[] p,Color col,double center_x,double center_y,double w,double h) {
|
public void FillOval(byte[] p,byte col,double center_x,double center_y,double w,double h) {
|
||||||
int counter=0;
|
int counter=0;
|
||||||
Point[] points = new Point[CIRCLE_PRECISION];
|
Point[] points = new Point[CIRCLE_PRECISION];
|
||||||
double r = Math.max(w,h);
|
double r = Math.max(w,h);
|
||||||
@ -264,11 +257,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
|||||||
FillPolygon(p,col,0,0,points);
|
FillPolygon(p,col,0,0,points);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void FillPolygon(byte[] p,byte col,double x_offset,double y_offset,Point...points) {
|
||||||
* @deprecated Until it implements the new indexed coloring mode, this is unusable.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void FillPolygon(int[] p,Color col,double x_offset,double y_offset,Point...points) {
|
|
||||||
Edge[] edges = new Edge[points.length];
|
Edge[] edges = new Edge[points.length];
|
||||||
List<Edge> edges_sorted = new ArrayList<Edge>();
|
List<Edge> edges_sorted = new ArrayList<Edge>();
|
||||||
for (int i=0;i<points.length;i++) {
|
for (int i=0;i<points.length;i++) {
|
||||||
@ -304,8 +293,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
|||||||
for (int x=(int)Math.round(e1.x_of_min_y);x<=e2.x_of_min_y;x++) {
|
for (int x=(int)Math.round(e1.x_of_min_y);x<=e2.x_of_min_y;x++) {
|
||||||
int index = (scanLine+(int)y_offset)*getWidth()+x+(int)x_offset;
|
int index = (scanLine+(int)y_offset)*getWidth()+x+(int)x_offset;
|
||||||
if (index<p.length&&index>=0) {
|
if (index<p.length&&index>=0) {
|
||||||
//TODO Old color system.
|
Draw(p,index,col);
|
||||||
//Draw(p,index,col.getColor());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user