Skip to content

Commit

Permalink
Allow overriding defines without modifying engine source (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
rh101 authored Feb 21, 2024
1 parent 8669e8d commit 184e0dc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/platform/PlatformMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,25 @@ Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md).
* @since v0.99.5
*/
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
# define AX_ENABLE_CACHE_TEXTURE_DATA 1
# if !defined(AX_ENABLE_CACHE_TEXTURE_DATA)
# define AX_ENABLE_CACHE_TEXTURE_DATA 1
# endif
#else
# define AX_ENABLE_CACHE_TEXTURE_DATA 0
# undef AX_ENABLE_CACHE_TEXTURE_DATA
# define AX_ENABLE_CACHE_TEXTURE_DATA 0
#endif

/** @def AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST
* Enable this if application should be restarted after the OpenGL context is lost
*
*/
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && !AX_ENABLE_CACHE_TEXTURE_DATA)
# define AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST 1
# if !defined(AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST)
# define AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST 1
# endif
#else
# define AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST 0
# undef AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST
# define AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST 0
#endif

#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32)
Expand Down

0 comments on commit 184e0dc

Please sign in to comment.