optimisation flag -Os instead of -O3.legacy
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap android-arm | |||||
./build/lol-build configure android-arm | |||||
./build/lol-build build android-arm | |||||
./build/lol-build "$@" bootstrap android-arm | |||||
./build/lol-build "$@" configure android-arm | |||||
./build/lol-build "$@" build android-arm | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap emscripten-html | |||||
./build/lol-build configure emscripten-html | |||||
./build/lol-build build emscripten-html | |||||
./build/lol-build "$@" bootstrap emscripten-html | |||||
./build/lol-build "$@" configure emscripten-html | |||||
./build/lol-build "$@" build emscripten-html | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap windows-i386 | |||||
./build/lol-build configure windows-i386 | |||||
./build/lol-build build windows-i386 | |||||
./build/lol-build "$@" bootstrap windows-i386 | |||||
./build/lol-build "$@" configure windows-i386 | |||||
./build/lol-build "$@" build windows-i386 | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap windows-amd64 | |||||
./build/lol-build configure windows-amd64 | |||||
./build/lol-build build windows-amd64 | |||||
./build/lol-build "$@" bootstrap windows-amd64 | |||||
./build/lol-build "$@" configure windows-amd64 | |||||
./build/lol-build "$@" build windows-amd64 | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap nacl-i386 | |||||
./build/lol-build configure nacl-i386 | |||||
./build/lol-build build nacl-i386 | |||||
./build/lol-build "$@" bootstrap nacl-i386 | |||||
./build/lol-build "$@" configure nacl-i386 | |||||
./build/lol-build "$@" build nacl-i386 | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap nacl-amd64 | |||||
./build/lol-build configure nacl-amd64 | |||||
./build/lol-build build nacl-amd64 | |||||
./build/lol-build "$@" bootstrap nacl-amd64 | |||||
./build/lol-build "$@" configure nacl-amd64 | |||||
./build/lol-build "$@" build nacl-amd64 | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap ps3-ppu | |||||
./build/lol-build configure ps3-ppu | |||||
./build/lol-build build ps3-ppu | |||||
./build/lol-build "$@" bootstrap ps3-ppu | |||||
./build/lol-build "$@" configure ps3-ppu | |||||
./build/lol-build "$@" build ps3-ppu | |||||
@@ -4,7 +4,7 @@ | |||||
make distclean | make distclean | ||||
set -e | set -e | ||||
./build/lol-build bootstrap raspi-arm | |||||
./build/lol-build configure raspi-arm | |||||
./build/lol-build build raspi-arm | |||||
./build/lol-build "$@" bootstrap raspi-arm | |||||
./build/lol-build "$@" configure raspi-arm | |||||
./build/lol-build "$@" build raspi-arm | |||||
@@ -3,7 +3,12 @@ | |||||
# | # | ||||
# Lol Engine build script | # Lol Engine build script | ||||
# Usage: | # Usage: | ||||
# lol-build <action> [<platform>] | |||||
# lol-build [<flags>...] <action> [<platform>] | |||||
# | |||||
# Supported flags: | |||||
# --enable-debug | |||||
# --enable-devel | |||||
# --enable-release | |||||
# | # | ||||
# Where <action> is one of: | # Where <action> is one of: | ||||
# - bootstrap | # - bootstrap | ||||
@@ -30,8 +35,31 @@ | |||||
set -e | set -e | ||||
action="$1" | |||||
platform="$2" | |||||
############################################################################### | |||||
# Commandline parsing | |||||
# | |||||
action="" | |||||
platform="" | |||||
configure_flags="" | |||||
while [ "$#" -gt 0 ]; do | |||||
case "$1" in | |||||
--enable-debug|--enable-devel|--enable-release) | |||||
configure_flags="${configure_flags} $1" | |||||
;; | |||||
--*) | |||||
echo "E: invalid flag $1" | |||||
exit 1 | |||||
;; | |||||
*) | |||||
if [ -z "$action" ]; then | |||||
action="$1" | |||||
else | |||||
platform="$1" | |||||
fi | |||||
;; | |||||
esac | |||||
shift | |||||
done | |||||
############################################################################### | ############################################################################### | ||||
# Initialisation code | # Initialisation code | ||||
@@ -106,6 +134,11 @@ bootstrap() | |||||
esac | esac | ||||
} | } | ||||
do_configure() | |||||
{ | |||||
./configure ${configure_flags} "$@" | |||||
} | |||||
configure() | configure() | ||||
{ | { | ||||
cd "$top_srcdir" | cd "$top_srcdir" | ||||
@@ -188,34 +221,34 @@ configure() | |||||
SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk" | SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk" | ||||
CC="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" | CC="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" | ||||
CXX="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" | CXX="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" | ||||
./configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" | |||||
do_configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" | |||||
;; | ;; | ||||
android-arm) | android-arm) | ||||
CPPFLAGS="$CPPFLAGS -Wno-psabi -I$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/stlport -I$ANDROID_NDK_ROOT/sources/android/native_app_glue -fpic -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64" | CPPFLAGS="$CPPFLAGS -Wno-psabi -I$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/stlport -I$ANDROID_NDK_ROOT/sources/android/native_app_glue -fpic -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64" | ||||
CFLAGS="$CFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb" | CFLAGS="$CFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb" | ||||
CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb -fno-rtti -fno-exceptions" | CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb -fno-rtti -fno-exceptions" | ||||
LOL_LIBS="$LOL_LIBS -L$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi -lstlport_shared -lm -fpic -XCClinker -shared -u ANativeActivity_onCreate" | LOL_LIBS="$LOL_LIBS -L$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi -lstlport_shared -lm -fpic -XCClinker -shared -u ANativeActivity_onCreate" | ||||
PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS" | |||||
PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS" | |||||
# FIXME: is this needed? | # FIXME: is this needed? | ||||
# ant debug | # ant debug | ||||
# ant debug install | # ant debug install | ||||
# ant clean | # ant clean | ||||
;; | ;; | ||||
raspi-arm) | raspi-arm) | ||||
./configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs" | |||||
do_configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs" | |||||
;; | ;; | ||||
nacl-i386) | nacl-i386) | ||||
./configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" | |||||
do_configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" | |||||
;; | ;; | ||||
nacl-amd64) | nacl-amd64) | ||||
./configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" | |||||
do_configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" | |||||
;; | ;; | ||||
osx-amd64) | osx-amd64) | ||||
# HACK: use clang++ because of a memory leak in llvm-g++. | # HACK: use clang++ because of a memory leak in llvm-g++. | ||||
./configure CXX=clang++ CC=clang | |||||
do_configure CXX=clang++ CC=clang | |||||
;; | ;; | ||||
ps3-ppu) | ps3-ppu) | ||||
PATH="$PATH" ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc | |||||
PATH="$PATH" do_configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc | |||||
;; | ;; | ||||
win*-i386|win*-amd64) | win*-i386|win*-amd64) | ||||
CPPFLAGS="$CPPFLAGS -I$PWD/external/sdl-1.2.15/include" | CPPFLAGS="$CPPFLAGS -I$PWD/external/sdl-1.2.15/include" | ||||
@@ -239,13 +272,13 @@ configure() | |||||
CPPFLAGS="$CPPFLAGS -I$PWD/external/libcaca-0.99.beta18/include -DCACA_STATIC" | CPPFLAGS="$CPPFLAGS -I$PWD/external/libcaca-0.99.beta18/include -DCACA_STATIC" | ||||
PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" | |||||
PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" | |||||
;; | ;; | ||||
emscripten-*) | emscripten-*) | ||||
./configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}" | |||||
do_configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}" | |||||
;; | ;; | ||||
*) | *) | ||||
PATH="$PATH" ./configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" | |||||
PATH="$PATH" do_configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" | |||||
;; | ;; | ||||
esac | esac | ||||
} | } | ||||
@@ -101,26 +101,41 @@ AC_CHECK_FUNCS(getenv system tmpfile tmpnam getcwd _getcwd backtrace_symbols) | |||||
AC_CHECK_FUNCS(gettimeofday usleep) | AC_CHECK_FUNCS(gettimeofday usleep) | ||||
if test "${enable_debug}" = "yes"; then | |||||
AC_DEFINE(LOL_DEBUG, 1, Define to 1 to activate debug) | |||||
OPT_CXXFLAGS="-O" | |||||
else | |||||
OPT_CXXFLAGS="-O3 -ffast-math -fomit-frame-pointer" | |||||
OPT_LDFLAGS="-fno-strength-reduce" | |||||
dnl Build mode | |||||
ac_cv_my_build_mode="devel" | |||||
if test "x${enable_release}" = "xyes"; then | |||||
ac_cv_my_build_mode="release" | |||||
CFLAGS="" | |||||
LDFLAGS="" | |||||
CXXFLAGS="" | |||||
fi | |||||
if test "x${enable_devel}" = "xyes"; then | |||||
ac_cv_my_build_mode="devel" | |||||
CFLAGS="" | |||||
LDFLAGS="" | |||||
CXXFLAGS="" | |||||
fi | |||||
if test "x${enable_debug}" = "xyes"; then | |||||
ac_cv_my_build_mode="debug" | |||||
CFLAGS="" | |||||
LDFLAGS="" | |||||
CXXFLAGS="" | |||||
fi | fi | ||||
if test "${enable_release}" = "yes"; then | |||||
AC_DEFINE(LOL_RELEASE, 1, Define to 1 to activate final release) | |||||
REL_CXXFLAGS="" | |||||
if test "x${ac_cv_my_build_mode}" = "xdebug"; then | |||||
AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build) | |||||
BUILD_CXXFLAGS="-O -g" | |||||
elif test "x${ac_cv_my_build_mode}" = "xdevel"; then | |||||
AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build) | |||||
BUILD_CXXFLAGS="-Os -g -ffast-math" | |||||
else | else | ||||
REL_CXXFLAGS="-g" | |||||
AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release) | |||||
BUILD_CXXFLAGS="-Os -ffast-math -fomit-frame-pointer" | |||||
BUILD_LDFLAGS="-fno-strength-reduce" | |||||
fi | fi | ||||
if test "${enable_experimental}" = "yes"; then | |||||
AC_DEFINE(LOL_EXPERIMENTAL, 1, Define to 1 to activate experimental build) | |||||
fi | |||||
# Build documentation? | |||||
dnl Build documentation? | |||||
DOXYGEN="no" | DOXYGEN="no" | ||||
LATEX="no" | LATEX="no" | ||||
if test "${enable_doc}" != "no"; then | if test "${enable_doc}" != "no"; then | ||||
@@ -166,9 +181,9 @@ dnl No exceptions | |||||
LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"]) | LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"]) | ||||
LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"]) | LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"]) | ||||
dnl Optimizations | |||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${REL_CXXFLAGS} ${OPT_CXXFLAGS}" | |||||
AM_LDFLAGS="${AM_LDFLAGS} ${REL_LDFLAGS} ${OPT_LDFLAGS}" | |||||
dnl Build mode specific flags | |||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${BUILD_CXXFLAGS}" | |||||
AM_LDFLAGS="${AM_LDFLAGS} ${BUILD_LDFLAGS}" | |||||
dnl Debug symbols | dnl Debug symbols | ||||
LOL_TRY_LDFLAGS(-rdynamic, [AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"]) | LOL_TRY_LDFLAGS(-rdynamic, [AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"]) | ||||
@@ -43,7 +43,7 @@ public: | |||||
~DictData() | ~DictData() | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (nentities) | if (nentities) | ||||
Log::Error("still %i entities in dict\n", nentities); | Log::Error("still %i entities in dict\n", nentities); | ||||
#endif | #endif | ||||
@@ -139,7 +139,7 @@ void Dict::RemoveSlot(Entity *entity) | |||||
return; | return; | ||||
} | } | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("removing unregistered entity %p (%s)\n", | Log::Error("removing unregistered entity %p (%s)\n", | ||||
entity, entity->GetName()); | entity, entity->GetName()); | ||||
#endif | #endif | ||||
@@ -29,7 +29,7 @@ Entity::Entity() : | |||||
m_ref(0), | m_ref(0), | ||||
m_destroy(0) | m_destroy(0) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
m_tickstate = STATE_IDLE; | m_tickstate = STATE_IDLE; | ||||
#endif | #endif | ||||
m_gamegroup = GAMEGROUP_DEFAULT; | m_gamegroup = GAMEGROUP_DEFAULT; | ||||
@@ -39,7 +39,7 @@ Entity::Entity() : | |||||
Entity::~Entity() | Entity::~Entity() | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (!m_destroy) | if (!m_destroy) | ||||
Log::Error("entity destructor called directly\n"); | Log::Error("entity destructor called directly\n"); | ||||
#endif | #endif | ||||
@@ -53,7 +53,7 @@ char const *Entity::GetName() | |||||
void Entity::TickGame(float seconds) | void Entity::TickGame(float seconds) | ||||
{ | { | ||||
UNUSED(seconds); | UNUSED(seconds); | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (m_tickstate != STATE_PRETICK_GAME) | if (m_tickstate != STATE_PRETICK_GAME) | ||||
Log::Error("invalid entity game tick\n"); | Log::Error("invalid entity game tick\n"); | ||||
m_tickstate = STATE_POSTTICK_GAME; | m_tickstate = STATE_POSTTICK_GAME; | ||||
@@ -63,7 +63,7 @@ void Entity::TickGame(float seconds) | |||||
void Entity::TickDraw(float seconds) | void Entity::TickDraw(float seconds) | ||||
{ | { | ||||
(void)seconds; | (void)seconds; | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (m_tickstate != STATE_PRETICK_DRAW) | if (m_tickstate != STATE_PRETICK_DRAW) | ||||
Log::Error("invalid entity draw tick\n"); | Log::Error("invalid entity draw tick\n"); | ||||
m_tickstate = STATE_POSTTICK_DRAW; | m_tickstate = STATE_POSTTICK_DRAW; | ||||
@@ -76,7 +76,7 @@ protected: | |||||
static int const DRAWGROUP_BEGIN = GAMEGROUP_END; | static int const DRAWGROUP_BEGIN = GAMEGROUP_END; | ||||
static int const ALLGROUP_END = DRAWGROUP_END; | static int const ALLGROUP_END = DRAWGROUP_END; | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
enum | enum | ||||
{ | { | ||||
STATE_IDLE = 0, | STATE_IDLE = 0, | ||||
@@ -52,14 +52,14 @@ bool AndroidImageData::Open(char const *path) | |||||
jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); | jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); | ||||
if (res < 0) | if (res < 0) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("JVM environment not found, trying to attach thread\n"); | Log::Error("JVM environment not found, trying to attach thread\n"); | ||||
#endif | #endif | ||||
res = g_vm->AttachCurrentThread(&env, nullptr); | res = g_vm->AttachCurrentThread(&env, nullptr); | ||||
} | } | ||||
if (res < 0) | if (res < 0) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("JVM environment not found, cannot open image %s\n", path); | Log::Error("JVM environment not found, cannot open image %s\n", path); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -74,7 +74,7 @@ bool AndroidImageData::Open(char const *path) | |||||
env->DeleteLocalRef(name); | env->DeleteLocalRef(name); | ||||
if (!bmp) | if (!bmp) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("could not load %s\n", path); | Log::Error("could not load %s\n", path); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -111,7 +111,7 @@ bool AndroidImageData::Close() | |||||
jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); | jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); | ||||
if (res < 0) | if (res < 0) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("JVM environment not found, cannot close image\n"); | Log::Error("JVM environment not found, cannot close image\n"); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -56,7 +56,7 @@ bool GdiPlusImageData::Open(char const *path) | |||||
status = Gdiplus::GdiplusStartup(&token, &input, nullptr); | status = Gdiplus::GdiplusStartup(&token, &input, nullptr); | ||||
if (status != Gdiplus::Ok) | if (status != Gdiplus::Ok) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("error %d while initialising GDI+\n", status); | Log::Error("error %d while initialising GDI+\n", status); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -71,7 +71,7 @@ bool GdiPlusImageData::Open(char const *path) | |||||
wchar_t *wpath = new wchar_t[len + 1]; | wchar_t *wpath = new wchar_t[len + 1]; | ||||
if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1) | if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("invalid image name %s\n", pathlist[i].C()); | Log::Error("invalid image name %s\n", pathlist[i].C()); | ||||
#endif | #endif | ||||
delete[] wpath; | delete[] wpath; | ||||
@@ -86,7 +86,7 @@ bool GdiPlusImageData::Open(char const *path) | |||||
status = m_bitmap->GetLastStatus(); | status = m_bitmap->GetLastStatus(); | ||||
if (status != Gdiplus::Ok) | if (status != Gdiplus::Ok) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (status != Gdiplus::InvalidParameter) | if (status != Gdiplus::InvalidParameter) | ||||
Log::Error("error %d loading %s\n", | Log::Error("error %d loading %s\n", | ||||
status, pathlist[i].C()); | status, pathlist[i].C()); | ||||
@@ -103,7 +103,7 @@ bool GdiPlusImageData::Open(char const *path) | |||||
if (!m_bitmap) | if (!m_bitmap) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("could not load %s\n", path); | Log::Error("could not load %s\n", path); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -116,7 +116,7 @@ bool GdiPlusImageData::Open(char const *path) | |||||
if(m_bitmap->LockBits(&rect, Gdiplus::ImageLockModeRead, | if(m_bitmap->LockBits(&rect, Gdiplus::ImageLockModeRead, | ||||
PixelFormat32bppARGB, &m_bdata) != Gdiplus::Ok) | PixelFormat32bppARGB, &m_bdata) != Gdiplus::Ok) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("could not lock bits in %s\n", path); | Log::Error("could not lock bits in %s\n", path); | ||||
#endif | #endif | ||||
delete m_bitmap; | delete m_bitmap; | ||||
@@ -56,7 +56,7 @@ bool IosImageData::Open(char const *path) | |||||
UIImage *image = [[UIImage alloc] initWithData:pngdata]; | UIImage *image = [[UIImage alloc] initWithData:pngdata]; | ||||
if (!image) | if (!image) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("could not load %s\n", path); | Log::Error("could not load %s\n", path); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -67,7 +67,7 @@ bool SdlImageData::Open(char const *path) | |||||
if (!m_img) | if (!m_img) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("could not load image %s\n", path); | Log::Error("could not load image %s\n", path); | ||||
#endif | #endif | ||||
return false; | return false; | ||||
@@ -33,7 +33,7 @@ public: | |||||
todolist(0), autolist(0), | todolist(0), autolist(0), | ||||
nentities(0), | nentities(0), | ||||
frame(0), recording(0), deltatime(0), bias(0), fps(0), | frame(0), recording(0), deltatime(0), bias(0), fps(0), | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
keepalive(0), | keepalive(0), | ||||
#endif | #endif | ||||
quit(0), quitframe(0), quitdelay(20), panic(0) | quit(0), quitframe(0), quitdelay(20), panic(0) | ||||
@@ -46,7 +46,7 @@ public: | |||||
{ | { | ||||
ASSERT(nentities == 0, | ASSERT(nentities == 0, | ||||
"still %i entities in ticker\n", nentities); | "still %i entities in ticker\n", nentities); | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (autolist) | if (autolist) | ||||
{ | { | ||||
int count = 0; | int count = 0; | ||||
@@ -76,7 +76,7 @@ private: | |||||
int frame, recording; | int frame, recording; | ||||
Timer timer; | Timer timer; | ||||
float deltatime, bias, fps; | float deltatime, bias, fps; | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
float keepalive; | float keepalive; | ||||
#endif | #endif | ||||
@@ -162,7 +162,7 @@ int Ticker::Unref(Entity *entity) | |||||
#if LOL_FEATURE_THREADS | #if LOL_FEATURE_THREADS | ||||
void *TickerData::GameThreadMain(void * /* p */) | void *TickerData::GameThreadMain(void * /* p */) | ||||
{ | { | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
Log::Info("ticker game thread initialised\n"); | Log::Info("ticker game thread initialised\n"); | ||||
#endif | #endif | ||||
@@ -179,7 +179,7 @@ void *TickerData::GameThreadMain(void * /* p */) | |||||
data->drawtick.Push(0); | data->drawtick.Push(0); | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
Log::Info("ticker game thread terminated\n"); | Log::Info("ticker game thread terminated\n"); | ||||
#endif | #endif | ||||
@@ -190,7 +190,7 @@ void *TickerData::GameThreadMain(void * /* p */) | |||||
#if LOL_FEATURE_THREADS | #if LOL_FEATURE_THREADS | ||||
void *TickerData::DrawThreadMain(void * /* p */) | void *TickerData::DrawThreadMain(void * /* p */) | ||||
{ | { | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
Log::Info("ticker draw thread initialised\n"); | Log::Info("ticker draw thread initialised\n"); | ||||
#endif | #endif | ||||
@@ -205,7 +205,7 @@ void *TickerData::DrawThreadMain(void * /* p */) | |||||
data->gametick.Push(1); | data->gametick.Push(1); | ||||
} | } | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
Log::Info("ticker draw thread terminated\n"); | Log::Info("ticker draw thread terminated\n"); | ||||
#endif | #endif | ||||
@@ -268,7 +268,7 @@ void TickerData::GameThreadTick() | |||||
data->bias = 0.f; | data->bias = 0.f; | ||||
} | } | ||||
#if LOL_DEBUG | |||||
#if LOL_BUILD_DEBUG | |||||
data->keepalive += data->deltatime; | data->keepalive += data->deltatime; | ||||
if (data->keepalive > 10.f) | if (data->keepalive > 10.f) | ||||
{ | { | ||||
@@ -290,14 +290,14 @@ void TickerData::GameThreadTick() | |||||
for (Entity *e = data->list[i]; e && n < data->panic; e = e->m_gamenext) | for (Entity *e = data->list[i]; e && n < data->panic; e = e->m_gamenext) | ||||
if (e->m_ref) | if (e->m_ref) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
Log::Error("poking %s\n", e->GetName()); | Log::Error("poking %s\n", e->GetName()); | ||||
#endif | #endif | ||||
e->m_ref--; | e->m_ref--; | ||||
n++; | n++; | ||||
} | } | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (n) | if (n) | ||||
Log::Error("%i entities stuck after %i frames, poked %i\n", | Log::Error("%i entities stuck after %i frames, poked %i\n", | ||||
data->nentities, data->quitdelay, n); | data->nentities, data->quitdelay, n); | ||||
@@ -358,14 +358,14 @@ void TickerData::GameThreadTick() | |||||
for (Entity *e = data->list[i]; e; e = e->m_gamenext) | for (Entity *e = data->list[i]; e; e = e->m_gamenext) | ||||
if (!e->m_destroy) | if (!e->m_destroy) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (e->m_tickstate != Entity::STATE_IDLE) | if (e->m_tickstate != Entity::STATE_IDLE) | ||||
Log::Error("entity %s [%p] not idle for game tick\n", | Log::Error("entity %s [%p] not idle for game tick\n", | ||||
e->GetName(), e); | e->GetName(), e); | ||||
e->m_tickstate = Entity::STATE_PRETICK_GAME; | e->m_tickstate = Entity::STATE_PRETICK_GAME; | ||||
#endif | #endif | ||||
e->TickGame(data->deltatime); | e->TickGame(data->deltatime); | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (e->m_tickstate != Entity::STATE_POSTTICK_GAME) | if (e->m_tickstate != Entity::STATE_POSTTICK_GAME) | ||||
Log::Error("entity %s [%p] missed super game tick\n", | Log::Error("entity %s [%p] missed super game tick\n", | ||||
e->GetName(), e); | e->GetName(), e); | ||||
@@ -400,14 +400,14 @@ void TickerData::DrawThreadTick() | |||||
for (Entity *e = data->list[i]; e; e = e->m_drawnext) | for (Entity *e = data->list[i]; e; e = e->m_drawnext) | ||||
if (!e->m_destroy) | if (!e->m_destroy) | ||||
{ | { | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (e->m_tickstate != Entity::STATE_IDLE) | if (e->m_tickstate != Entity::STATE_IDLE) | ||||
Log::Error("entity %s [%p] not idle for draw tick\n", | Log::Error("entity %s [%p] not idle for draw tick\n", | ||||
e->GetName(), e); | e->GetName(), e); | ||||
e->m_tickstate = Entity::STATE_PRETICK_DRAW; | e->m_tickstate = Entity::STATE_PRETICK_DRAW; | ||||
#endif | #endif | ||||
e->TickDraw(data->deltatime); | e->TickDraw(data->deltatime); | ||||
#if !LOL_RELEASE | |||||
#if !LOL_BUILD_RELEASE | |||||
if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW) | if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW) | ||||
Log::Error("entity %s [%p] missed super draw tick\n", | Log::Error("entity %s [%p] missed super draw tick\n", | ||||
e->GetName(), e); | e->GetName(), e); | ||||
@@ -127,7 +127,7 @@ LOLUNIT_FIXTURE(BuildTest) | |||||
LOLUNIT_ASSERT_EQUAL(sizeof(u64mat4), 128); | LOLUNIT_ASSERT_EQUAL(sizeof(u64mat4), 128); | ||||
} | } | ||||
#if !defined LOL_DEBUG | |||||
#if !defined LOL_BUILD_DEBUG | |||||
LOLUNIT_TEST(FastMath) | LOLUNIT_TEST(FastMath) | ||||
{ | { | ||||
double x, y; | double x, y; | ||||