* Android: Determine feature availability at compile time.

Since assets are baked in to the APK, we can simply check for the existence of assets at compile time using CMake.
This commit is contained in:
iProgramInCpp
2023-11-05 21:30:33 +02:00
parent eae06f0500
commit 3b60855ad0
3 changed files with 45 additions and 1 deletions

View File

@@ -397,8 +397,35 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
}
}
extern bool g_bIsMenuBackgroundAvailable; // client/gui/Screen.cpp
extern bool g_bAreCloudsAvailable; // client/renderer/LevelRenderer.cpp
extern bool g_bIsGrassColorAvailable; // world/level/GrassColor.cpp
extern bool g_bIsFoliageColorAvailable; // world/level/FoliageColor.cpp
static void CheckOptionalTextureAvailability()
{
#ifdef FEATURE_MENU_BACKGROUND
g_bIsMenuBackgroundAvailable = true;
#endif
#ifdef FEATURE_CLOUDS
g_bAreCloudsAvailable = true;
#endif
#ifdef FEATURE_GRASS_COLOR
g_bIsGrassColorAvailable = true;
#endif
#ifdef FEATURE_FOLIAGE_COLOR
g_bIsFoliageColorAvailable = true;
#endif
}
void android_main(struct android_app* state) {
struct engine engine;
CheckOptionalTextureAvailability();
memset(&engine, 0, sizeof(engine));
state->userData = &engine;