generated from sigonasr2/JavaProjectTemplate
FillCircle/FillOval fix
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
8e13249507
commit
087cd3bcb5
@ -25,8 +25,10 @@ class Player{
|
||||
|
||||
public class JavaProjectTemplate {
|
||||
public static final String PROGRAM_NAME="Sig's Java Project Template";
|
||||
public static int WINDOW_WIDTH=1280;
|
||||
public static int WINDOW_HEIGHT=720;
|
||||
public static int WINDOW_WIDTH=256;
|
||||
public static int WINDOW_HEIGHT=240;
|
||||
public static int PIXEL_SIZE_X=4;
|
||||
public static int PIXEL_SIZE_Y=4;
|
||||
public static Panel game;
|
||||
|
||||
Player pl = new Player();
|
||||
|
@ -92,6 +92,31 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
||||
p.ACTUAL_WINDOW_WIDTH=(int)d.getWidth();
|
||||
p.ACTUAL_WINDOW_HEIGHT=(int)d.getHeight();
|
||||
p.init(false);
|
||||
/*{
|
||||
int32_t ww = vScreenSize.x * vPixelSize.x;
|
||||
int32_t wh = vScreenSize.y * vPixelSize.y;
|
||||
float wasp = (float)ww / (float)wh;
|
||||
|
||||
if (bPixelCohesion)
|
||||
{
|
||||
vScreenPixelSize = (vWindowSize / vScreenSize);
|
||||
vViewSize = (vWindowSize / vScreenSize) * vScreenSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
vViewSize.x = (int32_t)vWindowSize.x;
|
||||
vViewSize.y = (int32_t)((float)vViewSize.x / wasp);
|
||||
|
||||
if (vViewSize.y > vWindowSize.y)
|
||||
{
|
||||
vViewSize.y = vWindowSize.y;
|
||||
vViewSize.x = (int32_t)((float)vViewSize.y * wasp);
|
||||
}
|
||||
}
|
||||
|
||||
vViewPos = (vWindowSize - vViewSize) / 2;
|
||||
}
|
||||
*/
|
||||
}
|
||||
});
|
||||
p = new Panel(f);
|
||||
@ -287,6 +312,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
||||
//System.out.println("X:"+(Math.sin(theta)*r+center_x)+" Y:"+(Math.cos(theta)*r+center_y));
|
||||
points.add(new Point<Double>((double)(Math.round(Math.sin(theta)*r+center_x)),(double)(Math.round(Math.cos(theta)*r+center_y))));
|
||||
}
|
||||
points.add(points.get(1));
|
||||
FillPolygon(0d,0d,col,points,PolygonStructure.FAN);
|
||||
}
|
||||
|
||||
@ -307,6 +333,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
|
||||
newP.y+=center_y;
|
||||
points.add(newP);
|
||||
}
|
||||
points.add(points.get(1));
|
||||
FillPolygon(0d,0d,col,points,PolygonStructure.FAN);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user