浏览代码

accept ./ as icon filename prefix

David Rose 17 年之前
父节点
当前提交
f5bb5b420f
共有 2 个文件被更改,包括 18 次插入8 次删除
  1. 9 4
      panda/src/osxdisplay/osxGraphicsWindow.mm
  2. 9 4
      panda/src/windisplay/winGraphicsWindow.cxx

+ 9 - 4
panda/src/osxdisplay/osxGraphicsWindow.mm

@@ -736,10 +736,15 @@ bool osxGraphicsWindow::set_icon_filename(const Filename &icon_filename)
 
   Filename icon_pathname = icon_filename;
   if (!vfs->resolve_filename(icon_pathname, get_model_path())) {
-    // The filename doesn't exist.
-    osxdisplay_cat.warning()
-      << "Could not find icon filename " << icon_filename << "\n";
-    return false;
+    // The filename doesn't exist along the search path.
+    if (icon_pathname.is_fully_qualified() && vfs->exists(icon_pathname)) {
+      // But it does exist locally, so accept it.
+
+    } else {
+      osxdisplay_cat.warning()
+        << "Could not find icon filename " << icon_filename << "\n";
+      return false;
+    }
   }
 
 

+ 9 - 4
panda/src/windisplay/winGraphicsWindow.cxx

@@ -2280,10 +2280,15 @@ get_icon(const Filename &filename) {
   // virtual file system.
   Filename resolved = filename;
   if (!resolved.resolve_filename(get_model_path())) {
-    // The filename doesn't exist.
-    windisplay_cat.warning()
-      << "Could not find icon filename " << filename << "\n";
-    return 0;
+    // The filename doesn't exist along the search path.
+    if (resolved.is_fully_qualified() && resolved.exists()) {
+      // But it does exist locally, so accept it.
+
+    } else {
+      windisplay_cat.warning()
+        << "Could not find icon filename " << filename << "\n";
+      return 0;
+    }
   }
   fi = _icon_filenames.find(resolved);
   if (fi != _icon_filenames.end()) {