Prevent crash in the patch inspector when type changes happen but no valid

patch is selected.
This commit is contained in:
Marco Cawthorne 2021-06-06 23:21:14 +02:00
parent 81774d40f0
commit 34d21fcc05
6 changed files with 28 additions and 48 deletions

View File

@ -442,7 +442,7 @@ void DoAbout()
"Developed by Vera Visions LLC.\n"
"Programming by Marco Hladik\n"
"Licensed by id software\n\n"
"Copyright (C) 2015-2020";
"Copyright (C) 2015-2021";
auto label = ui::Label(label_text);

View File

@ -312,8 +312,6 @@ struct EnginePath {
}
};
bool g_disableEnginePath = false;
void Paths_constructPreferences(PreferencesPage &page)
{
page.appendPathEntry("Nuclide Path", true, make_property<EnginePath>(g_strEnginePath));
@ -3088,11 +3086,13 @@ void GlobalGL_sharedContextCreated()
GLFont *g_font = NULL;
// report OpenGL information
#if 0
globalOutputStream() << "GL_VENDOR: " << reinterpret_cast<const char *>( glGetString(GL_VENDOR)) << "\n";
globalOutputStream() << "GL_RENDERER: " << reinterpret_cast<const char *>( glGetString(GL_RENDERER)) << "\n";
globalOutputStream() << "GL_VERSION: " << reinterpret_cast<const char *>( glGetString(GL_VERSION)) << "\n";
const auto extensions = reinterpret_cast<const char *>( glGetString(GL_EXTENSIONS));
globalOutputStream() << "GL_EXTENSIONS: " << (extensions ? extensions : "") << "\n";
#endif
QGL_sharedContextCreated(GlobalOpenGL());
@ -3345,8 +3345,6 @@ void MainFrame_Construct()
GlobalPreferenceSystem().registerPreference("EnginePath", make_property_string(g_strEnginePath));
GlobalPreferenceSystem().registerPreference("DisableEnginePath", make_property_string(g_disableEnginePath));
g_Layout_enablePluginToolbar.useLatched();
Layout_registerPreferencesPage();

View File

@ -1647,11 +1647,6 @@ bool Map_ImportFile(const char *filename)
output.push_string(EnginePath_get());
output.push_string("\"");
// extra switches
if (g_disableEnginePath) {
output.push_string(" -fs_nobasepath ");
}
output.push_string(" -fs_game ");
output.push_string(gamename_get());
output.push_string(" -convert -format ");

View File

@ -426,6 +426,8 @@ static void OnSelchangeComboColRow(ui::Widget widget, gpointer data)
g_PatchInspector.UpdateRowColInfo();
// now reflect our changes
g_PatchInspector.importData();
if (g_PatchInspector.m_Patch)
g_PatchInspector.m_Patch->controlPointsChanged();
}

View File

@ -81,26 +81,20 @@ void QE_InitVFS()
const char *gamename = gamename_get();
const char *basegame = basegame_get();
const char *userRoot = g_qeglobals.m_userEnginePath.c_str();
const char *globalRoot = EnginePath_get();
// if we have a mod dir
if (!string_equal(gamename, basegame)) {
// <fs_basepath>/<fs_game>
if (!g_disableEnginePath) {
StringOutputStream globalGamePath(256);
globalGamePath << globalRoot << gamename << '/';
GlobalFileSystem().initDirectory(globalGamePath.c_str());
}
}
// <fs_basepath>/<fs_main>
if (!g_disableEnginePath) {
StringOutputStream globalBasePath(256);
globalBasePath << globalRoot << basegame << '/';
GlobalFileSystem().initDirectory(globalBasePath.c_str());
}
}
int g_numbrushes = 0;
int g_numentities = 0;
@ -158,15 +152,6 @@ void bsp_init()
build_set_variable("MonitorAddress", (g_WatchBSP_Enabled) ? "127.0.0.1:39000" : "");
build_set_variable("GameName", gamename_get());
StringBuffer ExtraQ3map2Args;
// extra switches
if (g_disableEnginePath) {
ExtraQ3map2Args.push_string(" -fs_nobasepath ");
}
build_set_variable("ExtraQ3map2Args", ExtraQ3map2Args.c_str());
const char *mapname = Map_Name(g_map);
StringOutputStream name(256);
name << StringRange(mapname, path_get_filename_base_end(mapname)) << ".bsp";