Skip to content

Commit

Permalink
Rename methods to be shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
makamys committed Jan 25, 2024
1 parent b54e24b commit b478c51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/main/java/makamys/coretweaks/util/GLUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class GLUtil {
public static void resetState() {
LOGGER.debug("Attempting to reset GL state.");
LOGGER.debug("GL state before restore:");
OpenGLDebugging.dumpOpenGLState();
OpenGLDebugging.dumpState();

glMatrixMode(GL_MODELVIEW);
for(int i = 0; i < glGetInteger(GL_MODELVIEW_STACK_DEPTH) - 1; i++) {
Expand All @@ -32,7 +32,7 @@ public static void resetState() {
// TODO restore other stuff too, like attrib stack

LOGGER.debug("GL state after restore:");
OpenGLDebugging.dumpOpenGLState();
OpenGLDebugging.dumpState();
}

}
30 changes: 15 additions & 15 deletions src/main/java/makamys/coretweaks/util/OpenGLDebugging.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,29 @@ public static void dumpToFile(Consumer<Consumer<String>> dumper, String fileName
}
}

public static void dumpOpenGLStateToFile() {
dumpToFile((p) -> dumpOpenGLState(p), "gl-dump-state.txt");
public static void dumpStateToFile() {
dumpToFile((p) -> dumpState(p), "gl-dump-state.txt");
}

public static void dumpOpenGLState() {
dumpOpenGLState(LINE_LOGGER);
public static void dumpState() {
dumpState(LINE_LOGGER);
}

public static void dumpOpenGLState(Consumer<String> printer) {
public static void dumpState(Consumer<String> printer) {
for (int i = 0; i < instance.propertyList.length; ++i) {
printer.accept(instance.propertyList[i].name + ":" + getPropertyAsString(i) + " (" + instance.propertyList[i].description + ")");
}
}

public static void dumpAllIsEnabledToFile() {
dumpToFile((p) -> dumpAllIsEnabled(p), "gl-dump-enabled.txt");
public static void dumpIsEnabledToFile() {
dumpToFile((p) -> dumpIsEnabled(p), "gl-dump-enabled.txt");
}

public static void dumpAllIsEnabled() {
dumpAllIsEnabled(LINE_LOGGER);
public static void dumpIsEnabled() {
dumpIsEnabled(LINE_LOGGER);
}

public static void dumpAllIsEnabled(Consumer<String> printer) {
public static void dumpIsEnabled(Consumer<String> printer) {
for (int i = 0; i < instance.propertyList.length; ++i) {
if (instance.propertyList[i].fetchCommand.equals("glIsEnabled()")) {
printer.accept(instance.propertyList[i].name + ":");
Expand All @@ -129,15 +129,15 @@ public static void dumpAllIsEnabled(Consumer<String> printer) {
}
}

public static void dumpAllTypeToFile(String type) {
dumpToFile((p) -> dumpAllType(type, p), "gl-dump-type-" + type + ".txt");
public static void dumpTypeToFile(String type) {
dumpToFile((p) -> dumpType(type, p), "gl-dump-type-" + type + ".txt");
}

public static void dumpAllType(String type) {
dumpAllType(type, LINE_LOGGER);
public static void dumpType(String type) {
dumpType(type, LINE_LOGGER);
}

public static void dumpAllType(String type, Consumer<String> printer) {
public static void dumpType(String type, Consumer<String> printer) {
for (int i = 0; i < instance.propertyList.length; ++i) {
if (instance.propertyList[i].category.equals(type)) {
printer.accept(instance.propertyList[i].name + ":");
Expand Down

0 comments on commit b478c51

Please sign in to comment.