|
|
@@ -292,7 +292,24 @@ load_plugin(const string &p3d_plugin_filename) {
|
|
|
// Successfully loaded.
|
|
|
plugin_loaded = true;
|
|
|
|
|
|
+#ifdef P3D_PLUGIN_LOGFILE2
|
|
|
string logfilename = P3D_PLUGIN_LOGFILE2;
|
|
|
+#else
|
|
|
+ string logfilename;
|
|
|
+#endif // P3D_PLUGIN_LOGFILE2
|
|
|
+
|
|
|
+ if (logfilename.empty()) {
|
|
|
+#ifdef _WIN32
|
|
|
+ static const size_t buffer_size = 4096;
|
|
|
+ char buffer[buffer_size];
|
|
|
+ if (GetTempPath(buffer_size, buffer) != 0) {
|
|
|
+ logfilename = buffer;
|
|
|
+ logfilename += "panda3d.2.log";
|
|
|
+ }
|
|
|
+#else
|
|
|
+ logfilename = "/tmp/panda3d.2.log";
|
|
|
+#endif // _WIN32
|
|
|
+ }
|
|
|
|
|
|
if (!P3D_initialize(P3D_API_VERSION, logfilename.c_str())) {
|
|
|
// Oops, failure to initialize.
|