It will be the battle of the PRs then! Did you use a common function for saving data to the mission file and loading the background bitmap? Because I realized that the same common function used for loading from the mission file could be applied to the other two cases:
void CFred_mission_save::save_custom_bitmap(const char *expected_string_640, const char *expected_string_1024, const char *string_field_640, const char *string_field_1024)
{
if (Format_fs2_open != FSO_FORMAT_RETAIL)
{
if (*string_field_640 != '\0')
{
fout("\n%s %s", expected_string_640, string_field_640);
}
if (*string_field_640 != '\0')
{
fout("\n%s %s", expected_string_1024, string_field_1024);
}
}
}
// Try to load background bitmaps as appropriate
int mission_ui_background_load(const char *custom_background, const char *single_background, const char *multi_background)
{
int background_bitmap = -1;
if (*custom_background != '\0')
{
background_bitmap = bm_load(custom_background);
if (background_bitmap < 0)
mprintf(("Failed to load custom background bitmap %s!\n", custom_background));
}
// if special background failed to load, or if no special background was supplied, load the standard bitmap
if (background_bitmap < 0)
{
if (Game_mode & GM_MULTIPLAYER)
background_bitmap = bm_load(multi_background);
else
background_bitmap = bm_load(single_background);
}
// return what we've got
return background_bitmap;
}
With these functions, the code across all background bitmaps is the same, with only minimal work to link them together.