Game Development Community

Llmozlib Mac

by Jeremy Alessi · in Torque Game Engine · 04/16/2008 (11:43 pm) · 24 replies

Has anyone ported llmozlib for Torque on the Mac platform? I've got everything hooked in and built but when Torque attempts to initialize llmozlib it crashes inside the init call of llembededbrowser.cpp at the first error check (0X1000 or 4096). At first glance it appears to be a problem with the path being fed to the init call but I've checked the path a million ways with different file structures (more like Windows) to no avail.

I'm using llmozlib from January 2007 which is the closest Mac library to the Windows library Josh Ritter referenced initially (i.e. the calls seem to coincide whereas the newer builds require different parameters). I don't need full browser functionality just yet. So long as people can point and click it's all good. Any help would be greatly appreciated.

The source is available at the bottom of this page for several versions of llmozlib:

http://wiki.secondlife.com/wiki/Source_downloads
Page «Previous 1 2
#1
04/17/2008 (2:35 pm)
Anyone?
#2
04/17/2008 (3:24 pm)
You will get a much better response from the forums at Mozilla.
#3
04/17/2008 (3:34 pm)
Mozilla built just fine. It's the information Torque's sending that's out of whack. This is specific to the GuiBrowser mod Josh Ritter did up.
#4
04/24/2008 (6:43 am)
Where did you place the chrome/components/etc... folders?
#5
04/24/2008 (12:08 pm)
I put them in

"myGame.app/Contents/MacOS"
#6
04/24/2008 (12:38 pm)
When you call LLMozLib's init function, you're passing that in as the component directory right?

What are you passing as the profile Dir?
#7
04/24/2008 (1:51 pm)
"MyProfile"
#8
04/24/2008 (1:52 pm)
I also tried hardcoding the path to MacOS I think ... I'll have to go back and double check. Which llmozlib did you use? The one from January 2007?
#9
04/24/2008 (2:58 pm)
Here's what I'm calling:

// create a profile
   std::string profileBaseDir = std::string( folder );
   std::cout << "Profile Base Dir: " << profileBaseDir << std::endl;
   std::string profileName( profile );
   
   
   std::string replacee = "\Resources";
   profileBaseDir.erase( profileBaseDir.find( replacee ) );
   std::cout << "Profile Base Dir Now: " << profileBaseDir << std::endl;

   std::string appDir = profileBaseDir + "\MacOS";
   std::string comDir = profileBaseDir + "\MacOS";
   std::string proDir = profileBaseDir + "\MacOS";
  
   LLMozLib::getInstance()->init( appDir, comDir, proDir, platState.appWindow );

   AssertISV(!LLMozLib::getInstance()->getLastError(),avar("Error initializing embedded browser %i",LLMozLib::getInstance()->getLastError()));

It's dying on the Assert at the bottom there seemingly because the path isn't picking up what it wants. This is using the latest version of llmozlib released 12-21-2007.
#10
04/24/2008 (6:40 pm)
I'm actually using a modified LLMozlib.

I am also hard coding my app name into the the component dir.

My appDir and comDir are the same, and my proDir points to MyProfile. So basically, I have this:

appDir = profileBaseDir + "/MYAPP.app/Contents/MacOS";
comDir = appDir;
proDir = profileBaseDir + "/MyProfile";

Hope this helps.
#11
04/24/2008 (8:03 pm)
Were you using platState.appWindow? I read somewhere about there being 2 distinct window handles or something but within Torque platState.appWindow seemed to be the only parallel to winState.appWindow.
#12
04/25/2008 (6:06 am)
I actually don't pass the native window handle into the LLMozLib init function, it gets passed into the createBrowserWindow function.

Also I'm not using platState.appWindow - I'm passing in a Carbon WindowRef (created using NewCWindow)
#13
04/25/2008 (7:55 am)
I read somewhere about passing in a 'dummy' Carbon window is that what you're doing or is it actually linked to Torque somehow?
#14
04/25/2008 (7:57 am)
It's actually just a dummy Carbon window. Mozilla doesn't really use it, but it still asks for one.
#15
04/25/2008 (8:10 am)
Cool, thanks for the info. I'll have to test that method. I think I skipped over that because I thought that passing the Torque window was somehow important or better resembled the Windows port.
#16
04/25/2008 (3:25 pm)
Perhaps I'm having trouble with the profile directory. What exactly is that supposed to be pointing too. I've got the other directories lined up right and I'm using a dummy carbon window but I'm getting the same results.
#17
04/25/2008 (4:26 pm)
If you're init function is failing on the first call:
nsresult result = NS_NewNativeLocalFile( nsCString( appBaseDir.c_str() ), PR_FALSE, getter_AddRefs( applicationDirNative ) );

Then it means your appBaseDir isn't setup correctly. Make sure your path is correct.
Can you print what you're passing in as the appDir?
#18
04/25/2008 (4:45 pm)
It should be:

\Users\jeremyalessi\Desktop\MyDocuments\MyFullContactDebateOSXDevelopment\TorqueGameEngine1.5.2SDK\TorqueSDK\example\FullContactDebateGuiBrowser.app\Contents\MacOS
#19
04/28/2008 (6:15 am)
Your app directory looks good.

Is your profile directory set to this: ?
\Users\jeremyalessi\Desktop\MyDocuments\MyFullContactDebateOSXDevelopment\TorqueGameEngine1.5.2SDK\TorqueSDK\example\MyProfile
#20
04/28/2008 (6:26 am)
Ahh ... I'll give that a try this afternoon thanks!
Page «Previous 1 2