-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned Git repo and edited TimeDebug class
Added .gitignore Added LICENSE removed .classpath removed .project removed bin/ removed .settings/
- Loading branch information
Showing
79 changed files
with
196 additions
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# Eclipse files # | ||
.classpath | ||
.project | ||
.settings/ | ||
bin/ | ||
|
||
# specials project files # | ||
!libs/** | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Slaynash | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-7.26 KB
bin/slaynash/sgengine/gui/text2d/fontMeshCreator/TextMeshCreator.class
Binary file not shown.
Binary file removed
BIN
-734 Bytes
bin/slaynash/sgengine/gui/text2d/fontMeshCreator/TextMeshData.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.21 KB
...nash/sgengine/world3d/CharacterController$KinematicClosestNotMeConvexResultCallback.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,118 @@ | ||
package slaynash.sgengine; | ||
|
||
import java.awt.Color; | ||
import java.awt.Graphics; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Random; | ||
|
||
import javax.swing.JFrame; | ||
import javax.swing.SwingUtilities; | ||
|
||
import org.lwjgl.opengl.GL11; | ||
|
||
public class DebugTimer { | ||
|
||
private static long startTime = 0; | ||
private static long baseTime = 0; | ||
|
||
private static List<DebugTime> times = new ArrayList<DebugTime>(); | ||
private static List<DebugTime> savedTimes = new ArrayList<DebugTime>(); | ||
private static TimingDebugFrame frame; | ||
private static float totalTime = 0; | ||
|
||
public static void outputAndUpdateTime(String string) { | ||
if(Configuration.isUsingTimingDebug()) { | ||
GL11.glFinish(); | ||
//LogSystem.out_println("[TIMING] VR Render time [Left][Defe]: "+((System.nanoTime()-startTime)/1e6f)+"ms"); | ||
times.add(new DebugTime(((System.nanoTime()-startTime)/1e6f), string)); | ||
startTime = System.nanoTime(); | ||
} | ||
} | ||
|
||
public static void start() { | ||
startTime = System.nanoTime(); | ||
public static void restart() { | ||
times.clear(); | ||
baseTime = startTime = System.nanoTime(); | ||
} | ||
|
||
public static void outputAndUpdateTime(String string) { | ||
if(Configuration.isUsingTimingDebug()) LogSystem.out_printf(string, ((System.nanoTime()-startTime)/1e6f)); | ||
startTime = System.nanoTime(); | ||
private static class DebugTime{ | ||
float duration; | ||
String name; | ||
|
||
public DebugTime(float duration, String name) { | ||
this.duration = duration; | ||
this.name = name; | ||
} | ||
} | ||
|
||
public static void finishUpdate() { | ||
synchronized (savedTimes) { | ||
savedTimes.clear(); | ||
savedTimes.addAll(times); | ||
|
||
totalTime = ((System.nanoTime()-baseTime)/1e6f); | ||
if(Configuration.isUsingTimingDebug()) { | ||
LogSystem.out_println(""); | ||
LogSystem.out_println("[DebugTimer] Total time: "+totalTime+"ms"); | ||
for(int i=0;i<times.size();i++) { | ||
DebugTime dt = times.get(i); | ||
LogSystem.out_printf("[DebugTimer] %f%% - %f ms - %s\n", (dt.duration/totalTime*100), dt.duration, dt.name); | ||
} | ||
LogSystem.out_println(""); | ||
} | ||
|
||
} | ||
|
||
if(frame != null) SwingUtilities.invokeLater(new Runnable() { | ||
|
||
@Override | ||
public void run() { | ||
frame.validate(); | ||
} | ||
}); | ||
} | ||
|
||
public static void showDebugFrame() { | ||
if(frame == null) | ||
frame = new TimingDebugFrame(); | ||
if(!frame.isVisible()) | ||
frame.setVisible(true); | ||
} | ||
|
||
private static class TimingDebugFrame extends JFrame { | ||
private static final long serialVersionUID = -7547608523892329109L; | ||
|
||
TimingDebugFrame(){ | ||
super("SGE timing debug frame"); | ||
setResizable(false); | ||
setSize(440, 440); | ||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); | ||
} | ||
|
||
@Override | ||
public void paintComponents(Graphics g) { | ||
synchronized (savedTimes) { | ||
super.paintComponents(g); | ||
|
||
Random rng= new Random(0); | ||
|
||
float lastAng = 0; | ||
float ang = 0; | ||
|
||
g.setColor(Color.BLACK); | ||
g.drawString(String.format("%.2f", totalTime)+"ms - "+(int)(1000/totalTime)+"fps", 0, 50); | ||
|
||
for(DebugTime t:savedTimes) { | ||
ang = t.duration/totalTime*360; | ||
g.setColor(new Color(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256))); | ||
g.fillArc(20, 30, 400, 400, (int)lastAng, (int)ang); | ||
lastAng+=ang; | ||
} | ||
g.setColor(Color.WHITE); | ||
g.fillArc(20, 30, 400, 400, (int)lastAng, 360-(int)lastAng); | ||
|
||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.