Browse Source

Fix p3dembed bug with incorrect multifile payload offset, and remove some debug info

rdb 16 years ago
parent
commit
81cc08c096
1 changed files with 4 additions and 2 deletions
  1. 4 2
      direct/src/plugin_standalone/panda3dBase.cxx

+ 4 - 2
direct/src/plugin_standalone/panda3dBase.cxx

@@ -116,7 +116,6 @@ run_embedded(int read_offset, int argc, char *argv[]) {
         } else if (keyword == "height") {
         } else if (keyword == "height") {
           _win_height = atoi(value.c_str());
           _win_height = atoi(value.c_str());
         }
         }
-        cerr << _win_width << "-" << _win_height << "\n";
       }
       }
       curstr = "";
       curstr = "";
       havenull = true;
       havenull = true;
@@ -129,6 +128,9 @@ run_embedded(int read_offset, int argc, char *argv[]) {
       havenull = false;
       havenull = false;
     }
     }
   }
   }
+  // Update the offset to the current read pointer.
+  // This is where the multifile really starts.
+  read_offset = read.tellg();
   read.close();
   read.close();
   
   
   // Initialize the plugin
   // Initialize the plugin
@@ -145,7 +147,7 @@ run_embedded(int read_offset, int argc, char *argv[]) {
   P3D_instance *inst = create_instance
   P3D_instance *inst = create_instance
     (ExecutionEnvironment::get_binary_name(), true, 
     (ExecutionEnvironment::get_binary_name(), true, 
      _win_x, _win_y, _win_width, _win_height,
      _win_x, _win_y, _win_width, _win_height,
-     argv, argc, read.tellg());
+     argv, argc, read_offset);
   _instances.insert(inst);
   _instances.insert(inst);
   
   
   run_main_loop();
   run_main_loop();