diff --git a/build.sh b/build.sh index 13f20f81..4433f6d6 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,20 @@ +#DEPENDENCIES +#Windows, JDK17, Maven, GitBash, 7zip, MinGW, GCC, Make + +#completely clear build directory rm -rf ./build +#build directory structure mkdir build mkdir ./build/assets +#compile project and copy into build dir mvn package cp ./target/Renderer-0.1.jar ./build/engine.jar +#build launcher cd ./launcher/ make clean make build cd .. -cp ./launcher/launcher.exe ./build/ +#copy launcher, jdk, and assets into build dir +mv ./launcher/launcher.exe ./build/ unzip ./launcher/jdk.zip -d ./build/ cp -r ./assets/* ./build/assets/ \ No newline at end of file diff --git a/launcher/Makefile b/launcher/Makefile index 05f0554b..0562b7b2 100644 --- a/launcher/Makefile +++ b/launcher/Makefile @@ -1,3 +1,9 @@ + +#TODO: make support multiple OSes +#detect os: (not that bad) +#https://stackoverflow.com/questions/714100/os-detecting-makefile +#mingw flags to not have console window +#https://stackoverflow.com/questions/4441551/how-to-stop-a-program-compiled-with-mingw-g-from-opening-a-console-window-in build: ./src/main.c gcc ./src/main.c -o launcher diff --git a/launcher/jdk.zip b/launcher/jdk.zip index a1c15bc5..cd9ea565 100644 Binary files a/launcher/jdk.zip and b/launcher/jdk.zip differ diff --git a/launcher/launcher b/launcher/launcher deleted file mode 100755 index 5eaf6fbf..00000000 Binary files a/launcher/launcher and /dev/null differ diff --git a/launcher/src/main.c b/launcher/src/main.c index da1fa2bb..39bb3c68 100644 --- a/launcher/src/main.c +++ b/launcher/src/main.c @@ -2,13 +2,18 @@ #include #include #include +#include +#include +#include #define MAX_PATH_SIZE 250 #define LOG_HOLDER_SIZE 500 void logVar(char * message, char * var); +void redirectStdout(); int main(){ + redirectStdout(); char currentWorkingDirectory[MAX_PATH_SIZE]; if(getcwd(currentWorkingDirectory,sizeof(currentWorkingDirectory)) != NULL){ } else { @@ -34,6 +39,17 @@ int main(){ return 0; } +void redirectStdout(){ + int outfd = open("stdout.txt", O_CREAT|O_WRONLY|O_TRUNC, 0644); + if (!outfd) + { + printf("Error opening stdout redirect"); + fflush(stdout); + } + dup2(outfd, 1); // replace stdout + close(outfd); +} + char logHolder[LOG_HOLDER_SIZE]; void logVar(char * message, char * var){ diff --git a/nbactions-lwjgl-natives-macos.xml b/nbactions-lwjgl-natives-macos.xml deleted file mode 100644 index c6ba5e42..00000000 --- a/nbactions-lwjgl-natives-macos.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - run - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:3.0.0:exec - - - -XstartOnFirstThread -classpath %classpath electrosphere.main.Main - java - - - - debug - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:3.0.0:exec - - - -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -XstartOnFirstThread -classpath %classpath electrosphere.main.Main - java - true - - - - profile - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:3.0.0:exec - - - -XstartOnFirstThread -classpath %classpath electrosphere.main.Main - java - - - diff --git a/nbactions.xml b/nbactions.xml deleted file mode 100644 index 21a9f2fd..00000000 --- a/nbactions.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - run - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:1.5.0:exec - - - -classpath %classpath electrosphere.main.Main - java - - - - debug - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:3.0.0:exec - - - -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath electrosphere.main.Main - java - true - - - - profile - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:3.0.0:exec - - - -classpath %classpath electrosphere.main.Main - java - - - diff --git a/pom.xml b/pom.xml index fa61118d..e60f7382 100644 --- a/pom.xml +++ b/pom.xml @@ -198,75 +198,91 @@ - - - maven-assembly-plugin - - - - true - electrosphere.main.Main - - - - jar-with-dependencies - - - - - assemble-all - package - - single - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - package - - shade - - - - - electrosphere.main.Main - - - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - - exec - - - - - java - false - true - electrosphere.main.Main - - - -cp - target/classes;target/Renderer-0.1-jar-with-dependencies.jar - electrosphere.main.Main - - - - - + + + + maven-assembly-plugin + + + + true + electrosphere.main.Main + + + + jar-with-dependencies + + + + + assemble-all + package + + single + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + electrosphere.main.Main + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + + + exec + + + java + false + true + electrosphere.main.Main + + + -cp + target/classes;target/Renderer-0.1-jar-with-dependencies.jar + electrosphere.main.Main + + + + + + Telephone + generate-sources + + java + + + java + + -jar + Telephone-0.2.1.jar + + + + + + + \ No newline at end of file diff --git a/src/main/java/electrosphere/main/Globals.java b/src/main/java/electrosphere/main/Globals.java index 0d20c8ce..06973408 100644 --- a/src/main/java/electrosphere/main/Globals.java +++ b/src/main/java/electrosphere/main/Globals.java @@ -312,8 +312,8 @@ public class Globals { public static boolean RENDER_FLAG_RENDER_SHADOW_MAP = false; public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER_CONTENT = false; public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER = false; - public static boolean RENDER_FLAG_RENDER_BLACK_BACKGROUND = false; - public static boolean RENDER_FLAG_RENDER_WHITE_BACKGROUND = true; + public static boolean RENDER_FLAG_RENDER_BLACK_BACKGROUND = true; + public static boolean RENDER_FLAG_RENDER_WHITE_BACKGROUND = false; public static boolean RENDER_FLAG_RENDER_UI = true;