You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
768 B

10 months ago
#include "init.hpp"
#include "mpq/mpq_reader.hpp"
#include <jni.h>
namespace devilution {
namespace {
bool AreExtraFontsOutOfDateForMpqPath(const char *mpqPath)
{
int32_t error = 0;
std::optional<MpqArchive> archive = MpqArchive::Open(mpqPath, error);
return error == 0 && archive && AreExtraFontsOutOfDate(*archive);
}
} // namespace
} // namespace devilution
extern "C" {
JNIEXPORT jboolean JNICALL Java_org_diasurgical_devilutionx_DevilutionXSDLActivity_areFontsOutOfDate(JNIEnv *env, jclass cls, jstring fonts_mpq)
{
const char *mpqPath = env->GetStringUTFChars(fonts_mpq, nullptr);
bool outOfDate = devilution::AreExtraFontsOutOfDateForMpqPath(mpqPath);
env->ReleaseStringUTFChars(fonts_mpq, mpqPath);
return outOfDate;
}
}