[Bf-blender-cvs] [3165ec4dac6] sculpt-dev: Sculpt-dev: Add some more debug printfs for wintab

Joseph Eagar noreply at git.blender.org
Tue Jan 25 23:22:15 CET 2022


Commit: 3165ec4dac600d86e7de78fab52a31e18609fa54
Author: Joseph Eagar
Date:   Tue Jan 25 14:21:58 2022 -0800
Branches: sculpt-dev
https://developer.blender.org/rB3165ec4dac600d86e7de78fab52a31e18609fa54

Sculpt-dev: Add some more debug printfs for wintab

===================================================================

M	intern/ghost/intern/GHOST_Wintab.cpp
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/blenkernel/intern/curvemapping_cache.c

===================================================================

diff --git a/intern/ghost/intern/GHOST_Wintab.cpp b/intern/ghost/intern/GHOST_Wintab.cpp
index f5a5989f3e3..054f5e67412 100644
--- a/intern/ghost/intern/GHOST_Wintab.cpp
+++ b/intern/ghost/intern/GHOST_Wintab.cpp
@@ -23,12 +23,19 @@
 #include "GHOST_Wintab.h"
 #include <cstdio>
 
+static void wintab_load_error(const char *func)
+{
+  fprintf(stderr, "corrupted wintab32.dll; missing %s\n", func);
+}
+
 GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
 {
   /* Load Wintab library if available. */
 
   auto handle = unique_hmodule(::LoadLibrary("Wintab32.dll"), &::FreeLibrary);
   if (!handle) {
+    fprintf(stderr, "Could not find wintab32.dll\n");
+
     return nullptr;
   }
 
@@ -36,51 +43,61 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
 
   auto info = (GHOST_WIN32_WTInfo)::GetProcAddress(handle.get(), "WTInfoA");
   if (!info) {
+    wintab_load_error("WTInfoA");
     return nullptr;
   }
 
   auto open = (GHOST_WIN32_WTOpen)::GetProcAddress(handle.get(), "WTOpenA");
   if (!open) {
+    wintab_load_error("WTOpenA");
     return nullptr;
   }
 
   auto get = (GHOST_WIN32_WTGet)::GetProcAddress(handle.get(), "WTGetA");
   if (!get) {
+    wintab_load_error("WTGetA");
     return nullptr;
   }
 
   auto set = (GHOST_WIN32_WTSet)::GetProcAddress(handle.get(), "WTSetA");
   if (!set) {
+    wintab_load_error("WTSetA");
     return nullptr;
   }
 
   auto close = (GHOST_WIN32_WTClose)::GetProcAddress(handle.get(), "WTClose");
   if (!close) {
+    wintab_load_error("WTClose");
     return nullptr;
   }
 
   auto packetsGet = (GHOST_WIN32_WTPacketsGet)::GetProcAddress(handle.get(), "WTPacketsGet");
   if (!packetsGet) {
+    wintab_load_error("WTPacketGet");
     return nullptr;
   }
 
   auto queueSizeGet = (GHOST_WIN32_WTQueueSizeGet)::GetProcAddress(handle.get(), "WTQueueSizeGet");
   if (!queueSizeGet) {
+    wintab_load_error("WTQueueSizeGet");
     return nullptr;
   }
 
   auto queueSizeSet = (GHOST_WIN32_WTQueueSizeSet)::GetProcAddress(handle.get(), "WTQueueSizeSet");
   if (!queueSizeSet) {
+    wintab_load_error("WTQueueSizeSet");
     return nullptr;
   }
 
   auto enable = (GHOST_WIN32_WTEnable)::GetProcAddress(handle.get(), "WTEnable");
   if (!enable) {
+    wintab_load_error("WTEnable");
     return nullptr;
   }
 
   auto overlap = (GHOST_WIN32_WTOverlap)::GetProcAddress(handle.get(), "WTOverlap");
   if (!overlap) {
+    wintab_load_error("WTOverlap");
     return nullptr;
   }
 
@@ -88,8 +105,7 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
 
   LOGCONTEXT lc = {0};
   if (!info(WTI_DEFSYSCTX, 0, &lc)) {
-    fprintf(stderr, "Failed to load Wintab driver\n");
-    fflush(stderr);
+    fprintf(stderr, "Failed to initialize Wintab driver\n");
 
     return nullptr;
   }
@@ -102,7 +118,6 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
   auto hctx = unique_hctx(open(hwnd, &lc, FALSE), close);
   if (!hctx) {
     fprintf(stderr, "Failed to open Wintab driver\n");
-    fflush(stderr);
 
     return nullptr;
   }
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 6edd0cb5a6d..939aaac6b9b 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1308,7 +1308,6 @@ class _defs_sculpt:
 
         def get_enabled(context, idname):
             if "multires" in idname.lower() or idname.lower() == "builtin_brush.displacement heal":
-                print("IDNAME", idname)
                 have_multires = False;
                 ob = context.object
 
diff --git a/source/blender/blenkernel/intern/curvemapping_cache.c b/source/blender/blenkernel/intern/curvemapping_cache.c
index b88a8f3795c..d495363656a 100644
--- a/source/blender/blenkernel/intern/curvemapping_cache.c
+++ b/source/blender/blenkernel/intern/curvemapping_cache.c
@@ -226,15 +226,14 @@ CurveMapping *BKE_curvemapping_cache_get(CurveMappingCache *cache,
     return lookup;
   }
 
-  printf("adding curve key %d\n", BKE_curvemapping_calc_hash(curve));
-
   CurveMapping *curve2 = BKE_curvemapping_copy(curve);
 
   *key = curve2;
   *val = curve2;
 
   curve2->flag |= CUMA_PART_OF_CACHE;
-#if 1
+#if 0
+  printf("adding curve key %d\n", BKE_curvemapping_calc_hash(curve));
   printf("%d %d",
          (int)BKE_curvemapping_calc_hash(curve2),
          (int)BKE_curvemapping_equals(curve, curve2));
@@ -247,6 +246,7 @@ CurveMapping *BKE_curvemapping_cache_get(CurveMappingCache *cache,
   }
   printf("}\n");
 #endif
+
   if (free_input && !(curve->flag & CUMA_PART_OF_CACHE)) {
     BKE_curvemapping_free(curve);
   }



More information about the Bf-blender-cvs mailing list