fixed compile errors

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@48 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
spog 2006-04-10 18:10:29 +00:00
parent 31af7f484e
commit 620247ad5c
2 changed files with 11 additions and 9 deletions

View file

@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "iscenegraph.h" #include "iscenegraph.h"
#include "iglrender.h" #include "iglrender.h"
#include "iplugin.h" #include "iplugin.h"
#include "stream/stringstream.h"
#include "portals.h" #include "portals.h"
#include "AboutDialog.h" #include "AboutDialog.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_SHOW_2D "Toggle portals (2D)"
#define Q3R_CMD_OPTIONS "Configure Portal Viewer" #define Q3R_CMD_OPTIONS "Configure Portal Viewer"
static char INIfn[PATH_MAX]; CopiedString INIfn;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CPrtViewApp construction // CPrtViewApp construction
@ -68,8 +69,9 @@ static char INIfn[PATH_MAX];
void PrtView_construct() void PrtView_construct()
{ {
strcpy(INIfn, GlobalRadiant().getSettingsPath()); StringOutputStream tmp(64);
strcat(INIfn, "prtview.ini"); tmp << GlobalRadiant().getSettingsPath() << "prtview.ini";
INIfn = tmp.c_str();
portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? true : false; portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? true : false;
portals.aa_2d = INIGetInt(AA_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]; char value[1024];
if (read_var (INIfn, CONFIG_SECTION, key, value)) if (read_var (INIfn.c_str(), CONFIG_SECTION, key, value))
return atoi (value); return atoi (value);
else else
return def; return def;
@ -171,7 +173,7 @@ void INISetInt(char *key, int val, char *comment /* = NULL */)
sprintf(s, "%d ; %s", val, comment); sprintf(s, "%d ; %s", val, comment);
else else
sprintf(s, "%d", val); sprintf(s, "%d", val);
save_var (INIfn, CONFIG_SECTION, key, s); save_var (INIfn.c_str(), CONFIG_SECTION, key, s);
} }

View file

@ -215,7 +215,7 @@ public:
} }
}; };
template<typename typename Thunk_> template<typename Thunk_>
class CallbackBase class CallbackBase
{ {
void* m_environment; void* m_environment;
@ -235,17 +235,17 @@ public:
} }
}; };
template<typename typename Thunk> template<typename Thunk>
inline bool operator==(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other) inline bool operator==(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other)
{ {
return self.getEnvironment() == other.getEnvironment() && self.getThunk() == other.getThunk(); return self.getEnvironment() == other.getEnvironment() && self.getThunk() == other.getThunk();
} }
template<typename typename Thunk> template<typename Thunk>
inline bool operator!=(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other) inline bool operator!=(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other)
{ {
return !(self == other); return !(self == other);
} }
template<typename typename Thunk> template<typename Thunk>
inline bool operator<(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other) inline bool operator<(const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other)
{ {
return self.getEnvironment() < other.getEnvironment() || return self.getEnvironment() < other.getEnvironment() ||