Game Development Community

Tgb and mac osx 10.5 leopard

by Mark Bryce · in General Discussion · 11/03/2007 (12:12 am) · 14 replies

I was wondering if anyone had managed to get tgb running with mac osx 10.5 leopard? I have installed Leopard on a pre-intel mac but .... Tgb 1.5.1 launches, then loads the tgb products web site, briefly shows the tgb application then quits itself.

Anyone have any luck and if not, is there a planned compatibility update in the wings?

Mark

#1
11/03/2007 (12:28 am)
I have no problem with the TGB 1.5.1 in Leopard. I am working on Mac Mini G4. Everything works just fine.

Have you checked the log file?
#2
11/04/2007 (7:00 pm)
I had the same problem where it launched the web site and quit the app. Seemed to be a licensing problem. I ran the uninstaller, then reinstalled, re-entering the serial number and it launched okay.

I now have a bizarre problem when running TGB that mouse clicks seem to register a few inches off. For instance, I try to click on the Play Level button and my mouse jumps a couple inches away. Makes it hard to do anything. Anyone have this issue?
#3
11/05/2007 (2:29 am)
It is amazing that you two have been so helpful. Kostya, I did check the log file and there seemed to be a problem with a file in the behaviour playground. I deleted the behaviour playground and all is ok....... sort of.

TGB runs fine but I too have the same bizarre mouse click problem. Click the mouse and it jumps about 100 pixels down to the right. Impossible to get anything done as Alexander mentioned. Alexander helped by confirming that I wasn't going crazy and that the strange problem was being experienced by someone else.

Ill try reinstalling tgb and see what happens.
#4
11/05/2007 (2:55 am)
Mark:

I have to sorry, because TGB isn't runs too well on my computer. I have the same problem with the mouse - I can't close the "RSS" window because of that :( I'll try to check the sources to find the problem, but I have to say that my Mac experience is very low, I am the Windows programmer. So I can't promise any results soon.
#5
11/05/2007 (3:13 am)
I was able to get rid of the rss window with a little trial and error - clicking left and up a bit estimating where the cursor would end up. hardly a long term plan though. Im a long term mac user and an enforced pc user (work admin pcs), I'm still waiting for a good peecee experience ;-)

While i wait i will try that reinstall.
#6
11/05/2007 (6:23 am)
Ok, I just recompiled the TGB 1.5.1 under XCode 3.0. It was a matter of 2 slight changes in the sources. And the biggest disadvantage is that XCode 3.0 doesn't support MacOS 10.3.9 PPC, so the minimum requirements is MacOS 10.4 now :( (the problem is possibly can be solved by recompiling it on XCode 2.5, but I didn't download it yet).

So, I am now looking through sources to find the mouse bug. I'll post here if I'll find the solution.
#7
11/05/2007 (9:21 am)
I have fixed the bug. And it seems that all TGB games that are not running in fullscreen mode should have it :(

Here is how to fix it.

In XCode, open the file macCarbEvents.cc

And find the following lines:

// get and update the mouse position
// this event comes in in global coords, so it seems, but only after we
// create an NSWindow from our WindowRef. Apple bug ?

Point where;
GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint,
NULL, sizeof(Point), NULL, &where);
Canvas->setCursorPos(Point2I(where.h,where.v));
break;

Make these lines looks like this:

// get and update the mouse position
// this event comes in in global coords, so it seems, but only after we
// create an NSWindow from our WindowRef. Apple bug ?

SInt32 sys;
Gestalt(gestaltSystemVersion, &sys);
if(sys < 0x1050) {
Point where;
GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint,
NULL, sizeof(Point), NULL, &where);
Canvas->setCursorPos(Point2I(where.h,where.v));
}
break;

And recompile the TGB.

Looks like the Apple have finally fixed the old bug, and it causes a problem with TGB. :(
#8
11/05/2007 (6:55 pm)
@Kostaya: Thanks for posting a fix! Unfortunately that fix doesn't fix every case. Leopard's event flow differs from Tiger's a little bit, and that has revealed a bug or two in Torque, and in Apple's code.

The kEventWindowClickActivation Carbon event handler needs to work around some bugs in MacOS 10.4's Cocoa-Carbon integration. We need to listen to that event because Torque's mouse click events do not take a position argument, so we have to update the mouse position when that activation click comes in, or the activation click will register in the wrong place. The tangly problem is that the Cocoa-Carbon integration layer behaves erratically sometimes. The click-activation event can come in multiple times, sometimes with global mouse coords, sometimes with local. Sometimes every single mouse click results in a click-activation event. The value we return from the click-activation event handler tells the OS what we want to do when click-activated. Our requested behavior is sometimes respected, and sometimes not: a fast click will ignore our request, a slow click will honor it. We have to hack around stuff like this a little bit to get reliable behavior in our application.

Generally, games and most apps will want to ignore the activating click, so that if you click a window that's in the background, you don't accidentally hit any buttons in that window that you don't want to hit. I had to move a few things around to get the correct behavior.

The upshot is: fixes are coming in TGB 1.5.2 .
If anyone needs to ship a game before 1.5.2 is released, ping me and I'll send you a fixed' up macCarbEvents.cc file.
#9
11/05/2007 (9:06 pm)
@Paul:

Wow! Sounds like a real mess in the mouse events handlings! :) The bug have gone after I've made such fixes in my copy of TGB, so I thought its a leopard-specific "feature".

Why not to post the fixed macCarbEvents.cc here? Even if some people may not need to ship their games now, its impossible to develop a game without a proper fix because the mouse cursor is jumping every time you click on the window.

Besides, as the developer, I would like to see the correct code that fix this error.

ps. As you may have noticed, I disabled that code only for MacOS 10.5. It seems it worked perfectly in MacOS 10.4, but causes a problem in Leopard. Which means, I guess, the changes in the Leopard API and the different message handling.
#10
11/06/2007 (4:29 am)
I'm trying to install TGB 1.5.1 but the installer crashes when I try to run it. I just downloaded it again to see if it was a bad download, but the same thing happens - I double-click, it starts to open, and then stops with an error message (an OS X error message, not from TGB).

I'm running Leopard and TGB 1.3.x still runs, but I can't get 1.5.1 going.

Anyone else have this problem?

Thanks.

Jay Jennings
#11
11/06/2007 (7:50 am)
@Jay, yes same problem with the bitrock installer. I posted in another thread and was told that GG is working on it already. Donnow that's all i've got.
#12
11/18/2007 (5:38 pm)
Hi - in the meantime, any chance someone could email of upload a fixed up macCarbEvents.cc
events file for me to use?

please please please?

Mark
markbryce@mac.com
#13
12/04/2007 (11:26 am)
Any ETA on a fix for us in leopard - or on intel macs... which ever the real problem is?

Want to get back to using TGB on my mac - hate my vista machine lol. :)
#14
12/04/2007 (11:35 am)
We are really close guys. Thanks for waiting!