package sig; import javax.swing.JPanel; import javax.vecmath.Vector3f; import java.awt.Graphics; import java.awt.Color; public class Panel extends JPanel{ long startTime = System.nanoTime(); long endTime = System.nanoTime(); public void repaint() { super.repaint(); startTime = System.nanoTime(); } public void paintComponent(Graphics g) { g.setColor(Color.BLACK); g.fillRect(0,0,SigRenderer.SCREEN_WIDTH,SigRenderer.SCREEN_HEIGHT); //Vector3f origin = new Vector3f(Math.cos(SigRenderer.rot)*10,0,10+Math.sin(SigRenderer.rot)*10); /*for (int x=0;x0) {hit=1;} if (side==0) { perpWallDist=sideDistX-deltaDistX; } else { perpWallDist=sideDistY-deltaDistY; } } int lineHeight = (int)(h/perpWallDist); int drawStart=-lineHeight/2+h/2; if (drawStart<0) { drawStart=0; } int drawEnd=lineHeight/2+h/2; if (drawEnd>=h) {drawEnd=h-1;} Color col; switch(SigRenderer.worldMap[mapX][mapY]) { case 1:{col=Color.RED;}break; case 2:{col=Color.GREEN;}break; case 3:{col=Color.BLUE;}break; case 4:{col=Color.WHITE;}break; default:{col=Color.YELLOW;}break; } if (side==1) {col=col.darker();} g.setColor(col); g.drawLine(x,drawStart,x,drawEnd); } endTime=System.nanoTime(); SigRenderer.DRAWLOOPTIME = (endTime-startTime)/1000000f; } }