浏览代码

Fix "... is not a Multifile" error in pdeployed executables

rdb 10 年之前
父节点
当前提交
e1d7c737cf
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 5 5
      direct/src/plugin_standalone/panda3dBase.cxx
  2. 2 2
      direct/src/plugin_standalone/panda3dBase.h

+ 5 - 5
direct/src/plugin_standalone/panda3dBase.cxx

@@ -342,7 +342,7 @@ make_parent_window() {
 ////////////////////////////////////////////////////////////////////
 P3D_instance *Panda3DBase::
 create_instance(const string &p3d, bool start_instance,
-                char **args, int num_args, const int &p3d_offset) {
+                char **args, int num_args, int p3d_offset) {
   // Check to see if the p3d filename we were given is a URL, or a
   // local file.
   Filename p3d_filename = Filename::from_os_specific(p3d);
@@ -356,9 +356,9 @@ create_instance(const string &p3d, bool start_instance,
 
     p3d_filename.make_absolute();
     os_p3d_filename = p3d_filename.to_os_specific();
-  } 
+  }
   if (is_local) {
-    read_p3d_info(p3d_filename);
+    read_p3d_info(p3d_filename, p3d_offset);
   }
 
   // Build up the token list.
@@ -454,9 +454,9 @@ delete_instance(P3D_instance *inst) {
 //               parameters (like width and height).
 ////////////////////////////////////////////////////////////////////
 bool Panda3DBase::
-read_p3d_info(const Filename &p3d_filename) {
+read_p3d_info(const Filename &p3d_filename, int p3d_offset) {
   PT(Multifile) mf = new Multifile;
-  if (!mf->open_read(p3d_filename)) {
+  if (!mf->open_read(p3d_filename, p3d_offset)) {
     return false;
   }
   int si = mf->find_subfile("p3d_info.xml");

+ 2 - 2
direct/src/plugin_standalone/panda3dBase.h

@@ -49,10 +49,10 @@ protected:
 
   P3D_instance *
   create_instance(const string &p3d, bool start_instance,
-                  char **args, int num_args, const int &p3d_offset = 0);
+                  char **args, int num_args, int p3d_offset = 0);
   void delete_instance(P3D_instance *instance);
 
-  bool read_p3d_info(const Filename &p3d_filename);
+  bool read_p3d_info(const Filename &p3d_filename, int p3d_offset = 0);
   bool parse_token(const char *arg);
   bool parse_int_pair(const char *arg, int &x, int &y);
   string lookup_token(const string &keyword) const;