Skip to content

Commit

Permalink
Tanks v1.1.1 - New graphics options and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aehmttw committed Apr 11, 2021
1 parent 2817eff commit f44cde7
Show file tree
Hide file tree
Showing 118 changed files with 4,251 additions and 3,118 deletions.
4 changes: 2 additions & 2 deletions src/main/java/basewindow/BaseFontRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

public abstract class BaseFontRenderer
{
public BaseWindow home;
public BaseWindow window;

public BaseFontRenderer(BaseWindow h)
{
this.home = h;
this.window = h;
}

public abstract void drawString(double x, double y, double z, double sX, double sY, String s);
Expand Down
74 changes: 74 additions & 0 deletions src/main/java/basewindow/BaseShapeRenderer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package basewindow;

public abstract class BaseShapeRenderer
{
public boolean supportsBatching = false;

public abstract void fillOval(double x, double y, double sX, double sY);

public abstract void fillOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillPartialOval(double x, double y, double sX, double sY, double start, double end);

public abstract void fillFacingOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillGlow(double x, double y, double sX, double sY);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade);

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade, boolean light);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void drawOval(double x, double y, double sX, double sY);

public abstract void drawOval(double x, double y, double z, double sX, double sY);

public abstract void fillRect(double x, double y, double sX, double sY);

public abstract void fillBox(double x, double y, double z, double sX, double sY, double sZ);

public abstract void fillBox(double x, double y, double z, double sX, double sY, double sZ, byte options);

public abstract void fillQuad(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);

public abstract void fillQuadBox(double x1, double y1,
double x2, double y2,
double x3, double y3,
double x4, double y4,
double z, double sZ,
byte options);

public abstract void drawRect(double x, double y, double sX, double sY);

public abstract void drawImage(double x, double y, double sX, double sY, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, String image, boolean scaled);

public abstract void drawImage(double x, double y, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled, boolean depthtest);

public abstract void drawImage(double x, double y, double sX, double sY, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled, boolean depthtest);

}
91 changes: 23 additions & 68 deletions src/main/java/basewindow/BaseWindow.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package basewindow;

import basewindow.transformation.*;
import lwjglwindow.ShadowMap;
import lwjglwindow.ImmediateModeModelPart;

import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;

public abstract class BaseWindow
{
public BaseShapeRenderer shapeRenderer;
public BaseFontRenderer fontRenderer;

public boolean angled = false;
Expand All @@ -23,6 +24,12 @@ public abstract class BaseWindow
public double absoluteMouseX;
public double absoluteMouseY;

public double colorR;
public double colorG;
public double colorB;
public double colorA;
public double glow;

public boolean fullscreen;

public HashMap<Integer, InputPoint> touchPoints = new HashMap<Integer, InputPoint>();
Expand Down Expand Up @@ -89,6 +96,8 @@ public abstract class BaseWindow

public BasePlatformHandler platformHandler;

public ModelPart.ShapeDrawer shapeDrawer;

public BaseWindow(String name, int x, int y, int z, IUpdater u, IDrawer d, IWindowHandler w, boolean vsync, boolean showMouse)
{
this.name = name;
Expand All @@ -100,6 +109,7 @@ public BaseWindow(String name, int x, int y, int z, IUpdater u, IDrawer d, IWind
this.vsync = vsync;
this.windowHandler = w;
this.showMouseOnLaunch = showMouse;
this.shapeDrawer = new ImmediateModeModelPart.ImmediateModeShapeDrawer(this);

if (System.getProperties().toString().contains("Mac OS X"))
mac = true;
Expand Down Expand Up @@ -164,85 +174,18 @@ public void stopTiming()

public abstract void setIcon(String icon);

public abstract void fillOval(double x, double y, double sX, double sY);

public abstract void fillOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillPartialOval(double x, double y, double sX, double sY, double start, double end);

public abstract void fillFacingOval(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillGlow(double x, double y, double sX, double sY);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest);

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade);

public abstract void fillGlow(double x, double y, double sX, double sY, boolean shade, boolean light);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade);

public abstract void fillFacingGlow(double x, double y, double z, double sX, double sY, boolean depthTest, boolean shade, boolean light);

public abstract void setColor(double r, double g, double b, double a, double glow);

public abstract void setColor(double r, double g, double b, double a);

public abstract void setColor(double r, double g, double b);

public abstract void drawOval(double x, double y, double sX, double sY);

public abstract void drawOval(double x, double y, double z, double sX, double sY);

public abstract void fillRect(double x, double y, double sX, double sY);

public abstract void fillBox(double x, double y, double z, double sX, double sY, double sZ);

public abstract void fillBox(double x, double y, double z, double sX, double sY, double sZ, byte options);

public abstract void fillQuad(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);

public abstract void fillQuadBox(double x1, double y1,
double x2, double y2,
double x3, double y3,
double x4, double y4,
double z, double sZ,
byte options);

public abstract void drawRect(double x, double y, double sX, double sY);

public abstract void setUpPerspective();

public abstract void applyTransformations();

public abstract void loadPerspective();

public abstract void drawImage(double x, double y, double sX, double sY, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, String image, boolean scaled);

public abstract void drawImage(double x, double y, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, boolean scaled, boolean depthtest);

public abstract void drawImage(double x, double y, double sX, double sY, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled);

public abstract void drawImage(double x, double y, double z, double sX, double sY, double u1, double v1, double u2, double v2, String image, double rotation, boolean scaled, boolean depthtest);

public abstract String getClipboard();

public abstract void setClipboard(String s);
Expand Down Expand Up @@ -271,6 +214,12 @@ public abstract void fillQuadBox(double x1, double y1,

public abstract void setBatchMode(boolean enabled, boolean quads, boolean depth, boolean glow, boolean depthMask);

public abstract void setTextureCoords(double u, double v);

public abstract void setTexture(String image);

public abstract void stopTexture();

public abstract void addVertex(double x, double y, double z);

public abstract void addVertex(double x, double y);
Expand All @@ -283,6 +232,12 @@ public abstract void fillQuadBox(double x1, double y1,

public abstract void setLighting(double light, double glowLight, double shadow, double glowShadow);

public abstract ModelPart createModelPart();

public abstract ModelPart createModelPart(Model model, ArrayList<ModelPart.Shape> shapes, Model.Material material);

public abstract PosedModel createPosedModel(Model m);

public void setupKeyCodes()
{
keyNames.put(InputCodes.KEY_UNKNOWN, "Unknown key");
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/basewindow/ComputerFileManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package basewindow;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
Expand All @@ -15,7 +16,12 @@ public BaseFile getFile(String file)
@Override
public ArrayList<String> getInternalFileContents(String file)
{
Scanner s = new Scanner(new InputStreamReader(getClass().getResourceAsStream(file)));
InputStream st = getClass().getResourceAsStream(file);

if (st == null)
return null;

Scanner s = new Scanner(new InputStreamReader(st));
ArrayList<String> al = new ArrayList<String>();

while (s.hasNext())
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/basewindow/IModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package basewindow;

public interface IModel
{
void draw(double posX, double posY, double posZ, double sX, double sY, double sZ, double yaw, double pitch, double roll, boolean depthTest);
void draw(double posX, double posY, double sX, double sY, double yaw);
}
Loading

0 comments on commit f44cde7

Please sign in to comment.