Fix memory to 1.5GB, add profiling build

master
paradust7 2022-04-09 07:01:06 +00:00
parent cccec97971
commit 4700e9cde3
3 changed files with 29 additions and 10 deletions

View File

@ -14,7 +14,7 @@ pushd minetest
export EMSDK_EXTRA="-sUSE_SDL=2"
export CFLAGS="$CFLAGS $EMSDK_EXTRA"
export CXXFLAGS="$CXXFLAGS $EMSDK_EXTRA"
export LDFLAGS="$LDFLAGS $EMSDK_EXTRA -sALLOW_MEMORY_GROWTH=1 -sPTHREAD_POOL_SIZE=20 -s EXPORTED_RUNTIME_METHODS=ccall,cwrap"
export LDFLAGS="$LDFLAGS $EMSDK_EXTRA -sPTHREAD_POOL_SIZE=20 -s EXPORTED_RUNTIME_METHODS=ccall,cwrap -s INITIAL_MEMORY=1610612736"
export LDFLAGS="$LDFLAGS -L$INSTALL_DIR/lib -lssl -lcrypto -lemsocket -lwebsocket.js"
# Used by CMakeFiles.txt in the webport
@ -84,3 +84,11 @@ cp "$BASE_DIR/static/index.html" "$WWW_DIR"
cp "$BASE_DIR/static/.htaccess" "$WWW_DIR"
echo "DONE"
popd
popd
# Optional script to upload to webserver
if [ -f upload.sh ]; then
./upload.sh
fi

View File

@ -14,13 +14,24 @@ test -d "$INSTALL_DIR"
# Debug / Release
export BUILD_KIND=Release
if [ $BUILD_KIND == Debug ]; then
export COMMON_CFLAGS="-g -gsource-map -O0 --source-map-base=/dev/"
export COMMON_LDFLAGS="-sSAFE_HEAP=1 -sASSERTIONS=2 -sDEMANGLE_SUPPORT=1"
else
export COMMON_CFLAGS="-O2"
export COMMON_LDFLAGS=""
fi
case $BUILD_KIND in
Debug)
export COMMON_CFLAGS="-O0 -g -gsource-map --source-map-base=/dev/"
export COMMON_LDFLAGS="-sSAFE_HEAP=1 -sASSERTIONS=2 -sDEMANGLE_SUPPORT=1"
;;
Profile)
export BUILD_KIND="Release"
export COMMON_CFLAGS="--profiling -O2 -g -gsource-map --source-map-base=/dev/"
export COMMON_LDFLAGS=""
;;
Release)
export COMMON_CFLAGS="-O2"
export COMMON_LDFLAGS=""
;;
*)
echo "Unknown build: $BUILD_KIND"
exit 1
esac
export CFLAGS="$COMMON_CFLAGS -pthread -sUSE_PTHREADS=1 -fexceptions"
export CXXFLAGS="$COMMON_CFLAGS -pthread -sUSE_PTHREADS=1 -fexceptions"

View File

@ -298,8 +298,8 @@
} else {
var headerHeight = document.getElementById('header').offsetHeight;
var footerHeight = document.getElementById('footer').offsetHeight;
screenX = document.documentElement.clientWidth;
screenY = document.documentElement.clientHeight - headerHeight - footerHeight;
screenX = document.documentElement.clientWidth - 6;
screenY = document.documentElement.clientHeight - headerHeight - footerHeight - 6;
}
// Size of the viewport (after scaling)