FreeOrion

Forums for the FreeOrion project
It is currently Sat May 25, 2013 4:23 pm

All times are UTC




Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13  Next
Author Message
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 03, 2009 4:19 am 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
Thanks for doing this! Ok, here's my take on your GG patch. I changed some formatting-type stuff, and s/NULL/0. Do these changes work for you? If so, I'll be committing these files as they are here, including your copyright. If you approve, I'll take this as written consent to release this code under LGPL.

Now, I have a couple of questions:
Why do you start so many of your string literals with '\p' (e.g. "\pOpenGL.framework")?
Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 03, 2009 8:26 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7899
Location: Vancouver, BC
Someone posted a crash bug about the Mac OSX version on sourceforge:

https://sourceforge.net/tracker/index.p ... tid=544942


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 03, 2009 8:37 pm 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
Geoff the Medio wrote:
Your patch for freeorion doesn't appear to contain the XCode project files. Can those be bundled up in a ready-to-use way and put in SVN as well?


yes, I can arrange that

should I just include the XCode project or all the dependencies?
the whole mac SDK may be >50MBs.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 03, 2009 8:44 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7899
Location: Vancouver, BC
.Id wrote:
Geoff the Medio wrote:
Your patch for freeorion doesn't appear to contain the XCode project files. Can those be bundled up in a ready-to-use way and put in SVN as well?
yes, I can arrange that

should I just include the XCode project or all the dependencies?
the whole mac SDK may be >50MBs.

If there are a bunch of dependencies you need to build separately, then you should probably make an SDK like the Windows SDK that's already on SF as a separate download. The SDK will contain all the dependencies pre-built and a snapshot of the code and data off SVN, with subversion directories so that after downloading the SDK, the user can update from SVN to get any recent changes to the code or project files. Only the project files will go in SVN, so that they can be updated whenever files are added or removed from the build.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 03, 2009 9:18 pm 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
tzlaine wrote:
Thanks for doing this! Ok, here's my take on your GG patch. I changed some formatting-type stuff, and s/NULL/0. Do these changes work for you? If so, I'll be committing these files as they are here, including your copyright. If you approve, I'll take this as written consent to release this code under LGPL.


Anything that's copyright from me, I didn't intend to have there.

But the aglGetProcAddress files are actually apple's work:
http://developer.apple.com/qa/qa2001/qa1188.html which I should have made clear, sorry.

Quote:
Now, I have a couple of questions:
Why do you start so many of your string literals with '\p' (e.g. "\pOpenGL.framework")?

That was curious to me, too and I forgot to look into it.

Quote:
Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.


I didn't use SCons. Considering a SCons build wasn't previously supported on a mac platform, I'll take you mean the changes don't break win32 or posix. And I'm fairly certain they don't, since everything would be preprocessed out and the aglGetProcAddress files do not even need to be looked at for those platforms. Would confirming a GG SCons build with this patch on linux suffice?


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Wed Mar 04, 2009 2:22 pm 
Offline
Space Krill

Joined: Thu Dec 11, 2008 9:46 pm
Posts: 11
I think the XCode project should be in the repo, but not the SDK. The SDK is bound to not change often anyway, right?


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Wed Mar 04, 2009 6:27 pm 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
tzlaine wrote:
Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.


Glad, I checked this. There was a bug where I #ifdef instead of #if, use this patch for OgreGUI.cpp instead of what was in previous files:

Code:
Index: src/Ogre/OgreGUI.cpp
===================================================================
--- src/Ogre/OgreGUI.cpp        (revision 711)
+++ src/Ogre/OgreGUI.cpp        (working copy)
@@ -33,6 +33,10 @@
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#include <GL/gl.h>
#include <GG/glext.h>
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include "aglGetProcAddress.h"
#else
#include <GL/glx.h>
#endif
@@ -191,6 +195,10 @@
     typedef void (*BindBufferARBFn)(GLenum, GLuint);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     BindBufferARBFn glBindBufferARB = (BindBufferARBFn)wglGetProcAddress("glBindBufferARB");
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+       OSStatus err = aglInitEntryPoints (); //init bundle
+       if (err != noErr) Exit(err);
+       BindBufferARBFn glBindBufferARB = (BindBufferARBFn)aglGetProcAddress("glBindBufferARB");
#else
     BindBufferARBFn glBindBufferARB = (BindBufferARBFn)glXGetProcAddress((const GLubyte* )"glBindBufferARB");
#endif
@@ -204,6 +212,8 @@
     typedef void (*UseProgramARBFn)(GLuint);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     UseProgramARBFn glUseProgramARB = (UseProgramARBFn)wglGetProcAddress("glUseProgramARB");
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+       UseProgramARBFn glUseProgramARB = (UseProgramARBFn)aglGetProcAddress("glUseProgramARB");
#else
     UseProgramARBFn glUseProgramARB = (UseProgramARBFn)glXGetProcAddress((const GLubyte* )"glUseProgramARB");
#endif
@@ -222,6 +232,9 @@

void OgreGUI::Exit2DMode()
{
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+       aglDellocEntryPoints();
+#endif
     glPopClientAttrib();
     glPopAttrib();
}


And given that it's in GG source, I think it's more appropriate to check for __APPLE__ instead of FREEORION_MACOSX here?

Code:
Index: GG/Ogre/OgreGUI.h
===================================================================
--- GG/Ogre/OgreGUI.h   (revision 711)
+++ GG/Ogre/OgreGUI.h   (working copy)
@@ -29,6 +29,21 @@
#ifndef _GG_OgreGUI_h_
#define _GG_OgreGUI_h_

+#ifdef __APPLE__
+/* prevents OpenTransportProviders.h (a system header in Mac SDKs)
+    from trying to enum what's already defined by includeing it elsewhere */
+#undef TCP_NODELAY
+#undef TCP_MAXSEG
+#undef TCP_NOTIFY_THRESHOLD
+#undef TCP_ABORT_THRESHOLD
+#undef TCP_CONN_NOTIFY_THRESHOLD
+#undef TCP_CONN_ABORT_THRESHOLD
+#undef TCP_OOBINLINE
+#undef TCP_URGENT_PTR_TYPE
+#undef TCP_KEEPALIVE
+#include <Carbon/Carbon.h>
+#endif
+
#include <OgreDataStream.h>
#include <OgreRenderTargetListener.h>
#include <OgreSharedPtr.h>


These compile with SCons on linux and still in Xcode.

I can rewrite that code to get OpenGL entry points if you'd like.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Wed Mar 04, 2009 6:28 pm 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
Naesbye wrote:
I think the XCode project should be in the repo, but not the SDK. The SDK is bound to not change often anyway, right?


Right. Not as frequent as the Xcode project.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 10, 2009 1:49 am 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
Patch to add the Xcode project is attached.

Universal Binary: FreeOrion 0.3.12 rev 2913
I redid some things with boost dependency; maybe it will play nice with PPC. There's one obvious bug that I haven't fixed, just worked around so far. See the bug.zip attachment for details. I'd really appreciate any suggestions or help in fixing it.
Run the "unpack-FO" shell script after downloading everything.

Mac SDK: rev 2913 included
An SDK for Mac that includes all dependencies and svn revision 2913 of the code.
Run the "unpack-sdk" shell script after downloading everything.


Attachments:
File comment: Crash on clicking "Exit" seems isolated to the Mac build.
bug.zip [2.52 KiB]
Downloaded 39 times
File comment: Patch to add Xcode project to svn.
FO-Xcode-patch.zip [25.51 KiB]
Downloaded 39 times
Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Tue Mar 10, 2009 5:09 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
.Id wrote:
Run the "unpack-FO" shell script after downloading everything.


err, how do you do that?

"run" doesn't seem to be the necessary command.

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Wed Mar 11, 2009 3:00 pm 
Offline
Space Krill

Joined: Thu Dec 11, 2008 9:46 pm
Posts: 11
'\p' is a relic from the days of old, when the Mac Toolbox was in ROM and Pascal-based :-P

It denotes that the string is a Pascal string, and gets substituted with a length count (to indicate the length of the string), as opposed to a C string which ends when a 0x00 (zero) is encountered.

If I remember correctly. But those Pascal strings should die a horrible death, if possible.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Thu Mar 12, 2009 2:21 am 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
eleazar wrote:
.Id wrote:
Run the "unpack-FO" shell script after downloading everything.


err, how do you do that?

"run" doesn't seem to be the necessary command.


Double clicking from the Finder should (hopefully) work.

Inside a terminal, just typing the full path of the script would work, or change directory to it and do `./unpack-FO`
This is all provided that the execute permission is set on that script: `chmod u+x unpack-FO`


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Thu Mar 12, 2009 2:41 am 
Offline
Space Squid
User avatar

Joined: Fri Feb 06, 2009 6:54 pm
Posts: 76
Thanks for the hint about Pascal strings.
I doubt they're necessary for the purposes of that particular code. It was mostly appearing in error/debug strings except 1 place.
So I'll review it and probably rewrite it sometime for practice/fun, but feel free to beat me to it and we can compare notes.


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Thu Mar 12, 2009 2:52 am 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
thanks that worked

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: MacOsX Version issues
PostPosted: Mon Mar 30, 2009 2:19 am 
Offline
Space Krill

Joined: Mon Mar 30, 2009 2:12 am
Posts: 2
Have any of you guys bumped into this lib error yet?

dyld: Library not loaded: /usr/lib/libexpat.1.dylib
Referenced from: /Users/.../Desktop/FreeOrion.app/Contents/MacOs/../SharedSupport/libgvc_builtins.dylib
Reason: image not found
Trace/BPT trap


I downloaded the FreeOrion 0.3.11 UB from sourceforge, and I started to get library errors. So I installed X11, and now i'm getting this expat.1.dylib error. I found a libexpat.1.0.dylib on my computer, but i couldn't find 1.0. Anybody mind pointing me to it, or perhaps giving me a hint?

Oh, btw, I'm running an old MBP, first hardware iteration with 10.4.

Update: Just downloaded the last version of the SDK you posted. Couldn't find any libexpat in it. Am I looking in the wrong place, or is this just a lib i should already have had?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group