diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 647291382efc..eb2eec1a7f79 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -47,6 +47,10 @@ void BKE_blender_globals_clear(void); void BKE_blender_version_string( char *version_str, size_t maxncpy, short version, short subversion, bool v_prefix, bool include_subversion); +void BKE_upbge_version_string( + char *version_str, size_t maxncpy, + short version, short subversion, bool v_prefix, bool include_subversion); + void BKE_blender_userdef_data_swap(struct UserDef *userdef_dst, struct UserDef *userdef_src); void BKE_blender_userdef_data_set(struct UserDef *userdef); diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 66e42d6133a0..729e7d57e374 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -43,5 +43,6 @@ #define BLENDER_VERSION_CYCLE alpha extern char versionstr[]; /* from blender.c */ +extern char upbge_versionstr[]; /* from blender.c */ #endif /* __BKE_BLENDER_VERSION_H__ */ diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 68bca5d11b93..58638ca060a5 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -73,6 +73,7 @@ Global G; UserDef U; char versionstr[48] = ""; +char upbge_versionstr[48] = ""; /* ********** free ********** */ @@ -117,6 +118,18 @@ void BKE_blender_version_string(char *version_str, size_t maxncpy, short version } } +void BKE_upbge_version_string(char *version_str, size_t maxncpy, short version, short subversion, bool v_prefix, bool include_subversion) +{ + const char *prefix = v_prefix ? "v" : ""; + + if (include_subversion) { + BLI_snprintf(version_str, maxncpy, "%s0.%d.%d", prefix, version, subversion); + } + else { + BLI_snprintf(version_str, maxncpy, "%s0.%d", prefix, version); + } +} + void BKE_blender_globals_init(void) { memset(&G, 0, sizeof(Global)); @@ -128,6 +141,7 @@ void BKE_blender_globals_init(void) strcpy(G.ima, "//"); BKE_blender_version_string(versionstr, sizeof(versionstr), BLENDER_VERSION, BLENDER_SUBVERSION, true, true); + BKE_upbge_version_string(upbge_versionstr, sizeof(versionstr), UPBGE_VERSION, UPBGE_SUBVERSION, true, true); #ifndef WITH_PYTHON_SECURITY /* default */ G.f |= G_SCRIPT_AUTOEXEC; diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index b00cb1fc5855..270de4ad193e 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -445,7 +445,7 @@ static void stats_string(Scene *scene) s = stats->infostr; ofs = 0; - ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s | ", versionstr); + ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s (based on Blender %s) | ", upbge_versionstr, versionstr); if (scene->obedit) { if (BKE_keyblock_from_object(scene->obedit))