Very peculiar - the contrasting() method’s really simple, with no obvious endianness issues that I can see. The correct result would be white, so it’s the ppc version that’s wrong… I’ll see what I can find out…
The problem isn’t in the contrasting() code, it’s in my LookAndFeel subclass.
On an Intel based machine, I can call
getLookAndFeel().drawButtonBackground()
and that will lead to my subclass’ drawing method. On PPC, however, the same code fails at runtime.
I thought I had fixed the problem by rewriting the above code as
LookAndFeel theLookAndFeel = getLookAndFeel();
theLookAndFeel.drawButtonBackground();
but then it became clear that instead of calling my subclass, the call ended up going to the default LookAndFeel parent class’ method. The address of the pointer that I use in setLookAndFeel() matches what I see when I go to getLookAndFeel(), but the pointer has lost it’s subclass-ness.
My C++ may be getting hazy. Isn’t that what virtual methods are supposed to allow me to do?
That’s exactly what virtual methods are for. Normally when I’ve had problems like that it’s because bits of the code have got out of step with each other - try doing a full rebuild.