#include "iscenegraph.h"
#include "iglrender.h"
#include "iplugin.h"
+#include "stream/stringstream.h"
#include "portals.h"
#include "AboutDialog.h"
#define Q3R_CMD_SHOW_2D "Toggle portals (2D)"
#define Q3R_CMD_OPTIONS "Configure Portal Viewer"
-static char INIfn[PATH_MAX];
+CopiedString INIfn;
/////////////////////////////////////////////////////////////////////////////
// CPrtViewApp construction
void PrtView_construct()
{
- strcpy(INIfn, GlobalRadiant().getSettingsPath());
- strcat(INIfn, "prtview.ini");
+ StringOutputStream tmp(64);
+ tmp << GlobalRadiant().getSettingsPath() << "prtview.ini";
+ INIfn = tmp.c_str();
portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? true : false;
portals.aa_2d = INIGetInt(AA_2D, FALSE) ? true : false;
{
char value[1024];
- if (read_var (INIfn, CONFIG_SECTION, key, value))
+ if (read_var (INIfn.c_str(), CONFIG_SECTION, key, value))
return atoi (value);
else
return def;
sprintf(s, "%d ; %s", val, comment);
else
sprintf(s, "%d", val);
- save_var (INIfn, CONFIG_SECTION, key, s);
+ save_var (INIfn.c_str(), CONFIG_SECTION, key, s);
}
}
else
{
- globalOutputStream() << MSG_PREFIX "Portal file load aborted.\n", portals.fn;
+ globalOutputStream() << MSG_PREFIX "Portal file load aborted.\n";
}
}
else if (!strcmp(p,Q3R_CMD_RELEASE))
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
- GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
- GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
- GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
- GlobalModuleServer::instance().set(server);
+ initialiseModule(server);
g_PrtViewPluginModule.selfRegister();
}