Add version argument to NativeGetAppInfo

This commit is contained in:
Henrik Rydgard 2014-12-18 22:50:17 +01:00
parent 87d2436f82
commit c958ca6b4c
3 changed files with 7 additions and 5 deletions

View file

@ -144,9 +144,9 @@ std::string GetJavaString(JNIEnv *env, jstring jstr) {
// This is now only used as a trigger for GetAppInfo as a function to all before Init.
// On Android we don't use any of the values it returns.
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_isLandscape(JNIEnv *env, jclass) {
std::string app_name, app_nice_name;
std::string app_name, app_nice_name, version;
bool landscape;
NativeGetAppInfo(&app_name, &app_nice_name, &landscape);
NativeGetAppInfo(&app_name, &app_nice_name, &landscape, &version);
return landscape;
}
@ -210,11 +210,12 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
std::string app_name;
std::string app_nice_name;
std::string version;
bool landscape;
net::Init();
NativeGetAppInfo(&app_name, &app_nice_name, &landscape);
NativeGetAppInfo(&app_name, &app_nice_name, &landscape, &version);
// If shortcut_param is not empty, pass it as additional varargs argument to NativeInit() method.

View file

@ -16,7 +16,7 @@ struct AxisInput;
// The first function to get called, just write strings to the two pointers.
// This might get called multiple times in some implementations, you must be able to handle that.
void NativeGetAppInfo(std::string *app_dir_name, std::string *app_nice_name, bool *landscape);
void NativeGetAppInfo(std::string *app_dir_name, std::string *app_nice_name, bool *landscape, std::string *version);
// Generic host->C++ messaging, used for functionality like system-native popup input boxes.
void NativeMessageReceived(const char *message, const char *value);

View file

@ -393,8 +393,9 @@ int main(int argc, char *argv[]) {
std::string app_name;
std::string app_name_nice;
std::string version;
bool landscape;
NativeGetAppInfo(&app_name, &app_name_nice, &landscape);
NativeGetAppInfo(&app_name, &app_name_nice, &landscape, &version);
net::Init();