Skip to content

Commit

Permalink
Frametime graph is better
Browse files Browse the repository at this point in the history
1. Fixes cursors for TekWar (Da best game) ;)
2. Fixes frametimes for VSync'd settings and small micro stutters
3. Changes framerate caps to be multiples so that the cap matches popular gaming monitor refresh rates
4. Removed the stupid sleeps..  really..  wtf were you thinking?
5. Removed the update text..  that's just bloat.  Want an update, visit my github, it isn't rocket science.
  • Loading branch information
atsb committed Jul 6, 2023
1 parent f2a7999 commit ea6c725
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NuBuildGDX is a fork of BuildGDX aiming for stability, bug fixing and performanc

My goal is to get it in good shape for long term availability and support. I will also be personally maintaining some dependencies for this as some parts are very deeply intertwined with API versions and I don't trust upstream projects to not keep changing API's every release they do.

For renderer's, the PolyGDX and Classic ones will be removed. PolyGDX's performance is atrocious and Classic is basically unplayable due to its poor frametime graph (many micro stutters). Polymost is the best, smoothest and to be honest, the only one you should be using.
For renderer's, the PolyGDX will be removed. There is nothing wrong with Polymost, it is tried and tested.

# Summary
Reduce the bloat, increase the stability.. basically.
6 changes: 1 addition & 5 deletions src/ru/m210projects/Build/Architecture/BuildFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,8 @@ public boolean process(boolean shouldRender) {
if (shouldRender) {
graphics.updateTime();
graphics.frameId++;
} else {
// Sleeps to avoid wasting CPU in an empty loop.
if (frameRate == -1) frameRate = 10;
if (frameRate == 0) frameRate = getConfig().backgroundFPS;
if (frameRate == 0) frameRate = 30;
}

if (frameRate > 0) graphics.sync(frameRate);

return shouldRender;
Expand Down
2 changes: 1 addition & 1 deletion src/ru/m210projects/Build/Settings/BuildSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BuildSettings {
public static BuildVariable<Boolean> vsync;
public static BuildVariable<Integer> paletteGamma;

public static final Integer[] fpslimits = { 0, 30, 60, 120, 144, 200, 250, 300 };
public static final Integer[] fpslimits = { 0, 30, 60, 120, 144, 240, 320, 480};

public static void init(final Engine engine, final BuildConfig cfg)
{
Expand Down
5 changes: 3 additions & 2 deletions src/ru/m210projects/Build/desktop/AWT/AWTMouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

public class AWTMouse implements MouseMotionListener, MouseListener, MouseWheelListener, MouseInterface {

class TouchEvent {
static class TouchEvent {
static final int TOUCH_DOWN = 0;
static final int TOUCH_UP = 1;
static final int TOUCH_DRAGGED = 2;
Expand Down Expand Up @@ -88,7 +88,7 @@ public AWTMouse(JDisplay display)
{
try {
robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
} catch (Exception e) {}
} catch (Exception ignored) {}
this.display = display;

Canvas canvas = display.getCanvas();
Expand All @@ -97,6 +97,7 @@ public AWTMouse(JDisplay display)
canvas.removeMouseMotionListener(this);
canvas.removeMouseWheelListener(this);
}
assert canvas != null;
canvas.addMouseListener(this);
canvas.addMouseMotionListener(this);
canvas.addMouseWheelListener(this);
Expand Down
23 changes: 0 additions & 23 deletions src/ru/m210projects/Build/desktop/DesktopMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ public synchronized boolean show(String header, String message, MessageType type
return false;

BuildGdx.input.setCursorCatched(false);
if(message.length() >= 384)
{
message = message.substring(0, 384);
message += "...";
}

// DisplayMode fullscreen = null;
// if(BuildGdx.graphics != null && BuildGdx.graphics.isFullscreen()) {
// fullscreen = BuildGdx.graphics.getDisplayMode();
// BuildGdx.graphics.setWindowedMode(BuildGdx.graphics.getWidth(), BuildGdx.graphics.getHeight());
// }

if(update)
{
message = "You are using the old version of BuildGdx and have to update it! \r\n \r\n \r\n" + message;
type = MessageType.Info;
}

switch(type)
{
Expand All @@ -74,9 +57,6 @@ public synchronized boolean show(String header, String message, MessageType type
ShowPanel(JOptionPane.INFORMATION_MESSAGE, JOptionPane.YES_NO_OPTION, header, message);
}

// if(fullscreen != null)
// BuildGdx.graphics.setFullscreenMode(fullscreen);

Object selectedValue = panel.getValue();
if (selectedValue instanceof Integer) {
if(((Integer)selectedValue).intValue() == JOptionPane.YES_OPTION)
Expand All @@ -86,9 +66,6 @@ public synchronized boolean show(String header, String message, MessageType type
return false;
case Info:
ShowPanel(JOptionPane.INFORMATION_MESSAGE, JOptionPane.DEFAULT_OPTION, header, message);
// if(fullscreen != null)
// BuildGdx.graphics.setFullscreenMode(fullscreen);

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ru/m210projects/Launcher/desktop/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

public class Main {

public static String appversion = "v1.18";
public static String appversion = "v1.18.1";
public static final String headerPath = "Headers";
public static final String iconPath = "Games";
public static final Platform platform = getPlatform();
Expand Down
2 changes: 1 addition & 1 deletion src/ru/m210projects/Tekwar/Screens/SmkMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public synchronized void show() {
helpclock = 0;
message = MessageType.NONE;

BuildGdx.input.setCursorCatched(false);
BuildGdx.input.setCursorCatched(true);
game.pInput.ctrlResetKeyStatus();
init(init());
}
Expand Down

0 comments on commit ea6c725

Please sign in to comment.