X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=contrib%2Fprtview%2Fprtview.cpp;h=c5ed86c91080d9b25a0a27a5167c2affffbc21dd;hp=9593e4a9bdd3d8589c6134ebe15d2eaab5e89ca6;hb=0e5bc042fe9a0b57a528ee444ca815c1a5693c72;hpb=08d558e1a4d6439b2accaee830e54e8036acdc27 diff --git a/contrib/prtview/prtview.cpp b/contrib/prtview/prtview.cpp index 9593e4a9..c5ed86c9 100644 --- a/contrib/prtview/prtview.cpp +++ b/contrib/prtview/prtview.cpp @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "PrtView.h" +#include "prtview.h" #include #include @@ -28,8 +28,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "iscenegraph.h" #include "iglrender.h" #include "iplugin.h" +#include "stream/stringstream.h" -#include "Portals.h" +#include "portals.h" #include "AboutDialog.h" #include "ConfigDialog.h" #include "LoadPortalFileDialog.h" @@ -42,7 +43,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define Q3R_CMD_SHOW_2D "Toggle portals (2D)" #define Q3R_CMD_OPTIONS "Configure Portal Viewer" -static char INIfn[PATH_MAX]; +CopiedString INIfn; ///////////////////////////////////////////////////////////////////////////// // CPrtViewApp construction @@ -68,8 +69,9 @@ static char INIfn[PATH_MAX]; 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; @@ -157,7 +159,7 @@ int INIGetInt(char *key, int def) { 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; @@ -171,7 +173,7 @@ void INISetInt(char *key, int val, char *comment /* = NULL */) 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); } @@ -230,7 +232,7 @@ void QERPlug_Dispatch(const char* p, float* vMin, float* vMax, bool bSingleBrush } 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)) @@ -320,10 +322,7 @@ SingletonPrtViewPluginModule g_PrtViewPluginModule; 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(); }