Skip to content

Commit

Permalink
Cleaned up for a release
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpthorne committed Jan 5, 2017
1 parent 8d17d26 commit c29dad0
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 30 deletions.
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>Java DX9-Overlay-API</name>
<description>This takes the original DX9-Overlay-API project and provides a Java Wrapper for ease of use in Java.
</description>

<groupId>me.kevinpthorne</groupId>
<artifactId>java-dx9-overlay-api</artifactId>
<version>1.0</version>
Expand All @@ -24,5 +28,16 @@

</dependencies>

<build>
<resources>
<resource>
<directory>resources</directory>
<excludes>
<exclude>dx9_overlay.dll</exclude>
</excludes>
</resource>
</resources>
</build>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Source: <a href="https://github.com/agrippa1994/DX9-Overlay-API/blob/master/include/c%23/Overlay.cs">DX9-Overlay-API GitHub</a>
* <br>
* Created by kevint on 1/3/2017.
* Created by kevinpthorne on 1/3/2017.
*/
public interface DX9OverlayAPI extends Library {

Expand Down
24 changes: 4 additions & 20 deletions src/main/java/me/kevinpthorne/dx9overlayapi/DX9OverlayUtil.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
package me.kevinpthorne.dx9overlayapi;


import com.sun.jna.NativeLong;
import com.sun.jna.ptr.IntByReference;
import sun.security.util.BigInt;

import java.awt.Color;
import java.awt.Point;
import java.math.BigInteger;

/**
* Created by kevint on 1/3/2017.
* Utility methods here for repeated operations like translating java.awt.Color
* to a D3COLOR type and dealing with referenced returns.
* <br><br>
* Created by kevinpthorne on 1/3/2017.
*/
public class DX9OverlayUtil {

// public static string ToHexValueRGB(Color color)
// {
// return "" + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
// }
// public static string ToHexValueARGB(Color color)
// {
// return "" + color.A.ToString("X2") + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
// }
// public Point GetScreenSpecs()
// {
// int x, y;
// GetScreenSpecs(out x, out y);
// return new Point(x, y);
// }

public static NativeLong colorToD3Color(Color color) {
return new NativeLong(new BigInteger(colorToHex(color), 16).longValue());
}

private static String colorToHex(Color color) {
//TODO fix alpha
String argb = Integer.toHexString(color.getRGB());
argb = argb.substring(2, argb.length());
return Integer.toHexString(color.getAlpha()) + argb;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package me.kevinpthorne.dx9overlayapi.elements;

import com.sun.jna.ptr.IntByReference;
import me.kevinpthorne.dx9overlayapi.DX9OverlayAPI;
import me.kevinpthorne.dx9overlayapi.DX9OverlayUtil;

import java.awt.Color;
import java.awt.Rectangle;


/**
* Created by kevint on 1/3/2017.
* Created by kevinpthorne on 1/3/2017.
*/
public class Box extends OverlayElement {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

import java.awt.Point;


/**
* Created by kevint on 1/3/2017.
* Created by kevinpthorne on 1/3/2017.
*/
public class Image extends OverlayElement {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.awt.Point;

/**
* Created by kevint on 1/3/2017.
* Created by kevinpthorne on 1/3/2017.
*/
public class Line extends OverlayElement {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package me.kevinpthorne.dx9overlayapi.elements;

import java.awt.*;
import java.awt.Color;

/**
* Created by kevint on 1/3/2017.
* Generic class for any overlays
*
* Created by kevinpthorne on 1/3/2017.
*/
public abstract class OverlayElement {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.awt.Point;

/**
* Created by kevint on 1/3/2017.
* Created by kevinpthorne on 1/3/2017.
*/
public class TextLabel extends OverlayElement {

Expand Down

0 comments on commit c29dad0

Please sign in to comment.