Jason (jcreed) wrote,
Jason
jcreed

Fighting generalized bitrot today again by seeing if I could get sketchup working on my desktop machine. This is in principle harder than getting fontforge working again because (a) it's not open-source, and (b) there is no linux version at all.

So I tried running it under wine. Somewhat impressively, it worked, and pretty acceptably fast, even though I have no hardware GL acceleration on this machine under linux.

...except around every cursor there is an ugly white box, obscuring what you are trying to work on.

Obviously then I dug into the wine source and determined that the following patch suffices to fix the problem:
*** wine-1.1.33/dlls/winex11.drv/mouse.c
--- wine-1.1.33/dlls/winex11.drv/mouse.c
***************
*** 518,527 ****
              {
                  case 32:
                      /* BGRA, 8 bits each */
!                     *pixel_ptr = *xor_ptr++;
!                     *pixel_ptr |= *xor_ptr++ << 8;
!                     *pixel_ptr |= *xor_ptr++ << 16;
!                     *pixel_ptr |= *xor_ptr++ << 24;
                      break;

                  case 24:
--- 521,540 ----
              {
                  case 32:
                      /* BGRA, 8 bits each */
!                 {
!                 char red = *xor_ptr++;
!                 char green = *xor_ptr++;
!                 char blue = *xor_ptr++;
!                 char alpha = *xor_ptr++;
!
!                 if (alpha == 0 && !alpha_zero) {
!                   red = 0;
!                   green = 0;
!                   blue = 0;
!                 }
!
!                 *pixel_ptr = (alpha << 24) + (blue << 16) + (green << 8) + red;
!                 }
                  break;

                  case 24:

though I'm still slightly confused which piece of software is to blame for the problem. It seems like the Xcursor library thinks that "white with alpha 0x00" means "ha ha just kidding completely opaque white" and so what the patch is doing is just forcibly rewriting "transparent white" to "transparent black" which Xcursor will honor as transparent. But I have this sneaking suspicion that maybe a "add brightness" or "screen" sort of transfer mode got invoked somewhere, as that would explain some of the other mysterious experimental results I got on fully transparent colors other than white.

Oh, and the other broken thing is COLLADA export. It spews some errors at me about XML libraries not being found, and hell if I know how to fix that on the windows-side of things. In the meantime I found a Ruby script to be run inside sketchup itself which seems to export DXF okay, but I tried getting Blender to import it and it just choked and gave me silent failcess.

---

Turns out: blender just doesn't accept DXF files without a proper header. Easy enough to add that.
Tags: sketchup
Subscribe

  • (no subject)

    Guy from Seattle team we've been working with showed up today at work; no matter how much I'm generally comfortable working with remote teams (and I…

  • (no subject)

    Didn't sleep well. Long day of work. Dinner with akiva at hanamichi.

  • (no subject)

    Sean's back in town --- good fun working with nonremote teammates.

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 7 comments