diff --git a/C++/scripts/build.sh b/C++/scripts/build.sh index 074ffa4..0656a8a 100755 --- a/C++/scripts/build.sh +++ b/C++/scripts/build.sh @@ -1,5 +1,5 @@ #Compiles the entire program then runs it, producing an executable. -#C +#C++ printf "Running program...\n\n\n" if g++ $(find . -type f -name "*.cpp") ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then ./${PROJECT_NAME} "$@" diff --git a/C++/scripts/commit.sh b/C++/scripts/commit.sh index 0f56a8f..2693b46 100755 --- a/C++/scripts/commit.sh +++ b/C++/scripts/commit.sh @@ -1,5 +1,5 @@ #Adds a commit message and pushes project to github repository. -#C +#C++ COMMIT_MESSAGE="$*" FIRST_LINE=true while IFS= read -r line diff --git a/C++/scripts/filelist b/C++/scripts/filelist index e0fa154..5f624fd 100644 --- a/C++/scripts/filelist +++ b/C++/scripts/filelist @@ -1,2 +1,3 @@ build.sh commit.sh +web.sh diff --git a/C++/scripts/md5 b/C++/scripts/md5 index 9781a45..9403698 100644 --- a/C++/scripts/md5 +++ b/C++/scripts/md5 @@ -1,2 +1,3 @@ -build.sh:50a30b43fe30f45d4b7776f1929f359e - -commit.sh:89783d2e6a165aa9612c79cfbd804a35 - +build.sh:530634457ea9041267c05d4ced95eee1 - +commit.sh:d03a46e721060c22ccb146e19d27e70a - +web.sh:3fdcf079bbabf079cc24c32fa7133c40 - diff --git a/C++/scripts/web.sh b/C++/scripts/web.sh new file mode 100755 index 0000000..d00e5ca --- /dev/null +++ b/C++/scripts/web.sh @@ -0,0 +1,9 @@ +#Compiles emscripten instance of this project for the web. +#C++ +if [ -d "assets" ]; then + em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h --preload-file ./assets +else + em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h +fi + +emrun ${PROJECT_NAME}.html