Page 28 of 29

Re: Mac Binary Release

Posted: 23 Apr 2009, 08:20
by Pwnedbyryan
This is awesome. Keep up the good work, I've been waiting for a mac release for a while now.

Re: Mac Binary Release

Posted: 23 Apr 2009, 08:44
by revcompgeek
When I launch Spring, I am able to move through the menus and select the mod/map/script i want to use, but it crashes immediately afterward saying invalid map file. The exception was being thrown on line 28 of SmfMapFile.cpp so I added a printf to tell me what the values of header that were being checked are. At first I was getting a bunch of wierd numbers, but I realized that the byte swapping was probably not working for Mac. I have since tried a few solutions for that, but all of them have only given me 0 for the map header values.

Streflop is one of the easily fixable patches. Since streflop_cond.h conditionally includes either streflop.h or cmath (math.h needs to be #included also), there is no need to use streflop:: when using math functions. Also,

Code: Select all

#include "streflop_cond.h"
needs to be replaced with

Code: Select all

#include "lib/streflop/streflop_cond.h"
in the lua files (ltable.cpp, lvm.cpp, lmathlib.cpp, luaconf.h, and lapi.cpp) in order to be consistent with the rest of the project.

Is someone willing to apply those changes? My code is currently too dirty to try and make a streflop patch.

Edit: Pwnedbyryan: Thanks. What kind of Mac do you own/use?

Re: Mac Binary Release

Posted: 23 Apr 2009, 09:43
by imbaczek
make a clean git branch and push it to your fork on github, that's the easiest way to get patches into the engine.

Re: Mac Binary Release

Posted: 23 Apr 2009, 09:57
by revcompgeek
imbaczek: I am very new to git and github, can you give me a better description of what do do?

Re: Mac Binary Release

Posted: 23 Apr 2009, 10:25
by imbaczek

Re: Mac Binary Release

Posted: 24 Apr 2009, 02:37
by revcompgeek
Thank you. I have already pushed a few changes, and I will continue pushing them. My fork is here: http://github.com/revcompgeek/spring/tree/master

Re: Mac Binary Release

Posted: 10 May 2009, 10:30
by yokosou
Hello there. This is my first post here and I apologize for my Engrish in advance.

Well, a few days ago I managed to compile the latest stable release and to make a working bundle for intel Mac with a few modifications to the original source files. I attached a patch file for the latest stable souce code. I am not a serious programmer. So there may be inappropriate modifications. Please point them out, too. And I did not modificated GameVersion.cpp because I could not judge whether it should be or not.

I uploaded a (hopefully) working binary for you:
http://ike.intuitive-art.com/springmac/ ... .1m.tar.gz
Please note that the file may be deleted after a while as it is hosted by one of my friends and that its config file would be created in ~/Library/Preferences/springrc.

The following is exactly what I did.

1. Installed libraries: DevIL, Glew, Ogg, Vorbis, SDL, Boost, and all their dependencies. Though I did it manually so that I could use 10.4u SDK, you can do it with MacPorts easily. I used CMake to create makefiles, so I installed CMake too.

2. Fixed #include <foo.h>. For example, <AL/al.h> must be replaced with <OpenAL/al.h> on Mac.

3. Compiled SDLMain.m as a static library. Without compiler flag "-msse2", compiling files which include Cocoa framework seemed to cause an error. That's why I created the new library and compiled with the flag.

4. Created MacMessageBox function to make up for the missing link and added it to the library I created. This is to evade the error, too.

5. Modified pybind.cpp so that Python.h would not include math.h, using a dirty way.

6. Fixed DataDirLocater::LocateDataDirs() in DataDirLocater.cpp. I moved data directories out of the bundle. This is because Unitsync uses DataDirLocater.cpp and old implementation tries to find paths to data directories in the main bundle. So Unitsync will search the SpringLobby bundle for the data directories when it is loaded from SpringLobby. Thus I decided to put those apps which need unitsync and data directories in the same directory as Spring to make them recognize data directories. This should be replaced with some better method.

7. Modified ConfigHandler.cpp so that a config file would be created in ~/Library/Preferences/springrc.

8. Modified CMakeLists.txt. Excluded X11, added the library mentioned above, modified a install prefix.

With those modifications, Spring could be compiled, but I noticed some problems which may be specific to Mac.

1. Sound attenuation is too strong, sound effects are very quiet unless you bring the camera close to the source. I added "alSourcef(source, AL_ROLLOFF_FACTOR, 0.25f);" to OpenALSound.app as a stopgap measure.

2. Radeon X1600 on Tiger indicates that it can handle non-power-of-two textures, but it takes too long for them to render this kind of textures. This made Spring virtually unplayable. To solve this problem, non-power-of-two textures are never used regardless of the value of GLEW_ARB_texture_non_power_of_two in this binary.

3. One of my friends who is on Mac OS X 10.4.11 reported that this binary unexpectedly crashed while playing. Disabling LuaUI seemed to prevent this kind of crashes, but I cannot figure out the cause.

Anyway, Thanks for making such a great game!

yokosou (zip hosted by ike)

Re: Mac Binary Release

Posted: 10 May 2009, 10:58
by imbaczek
thanks for that.

revcompgeek, could you take a look at this patch and see how it applies to master?

yokosou, if you can, could you upload your changes to github for easier integration? some hints how to use git.

Re: Mac Binary Release

Posted: 10 May 2009, 13:40
by yokosou
hi imbaczek, thanks for the reply.
I will read those pages and try to use git if possible.

Re: Mac Binary Release

Posted: 10 May 2009, 17:45
by jackoverfull
Wow, thank you! Will try it in a few hours. :-)

The sound attenuation problem is a problem that was already present in older mac builds.

Re: Mac Binary Release

Posted: 10 May 2009, 22:38
by el_matarife
A working OSX Intel .79 or .80 or whatever the next Spring version will be could be a BIG DEAL since we could promote it. I personally know 3 or 4 people who quit Spring when they switched to Macs since they hated to bootcamp into Windows / Linux to play, and Spring doesn't work in VMWare Fusion or Parallels since Spring uses OpenGL.

Re: Mac Binary Release

Posted: 10 May 2009, 23:26
by jackoverfull
works fine for me. :-)

I only have a problem: in older releases i could create unit groups using ctrl-number, now that doesn't seem to work anymore.

Does fork for anyone? I'm asking because I had problems with that in the past (something about my keyboard configuration, i guess), but i could not solve the problem this time yet.

Re: Mac Binary Release

Posted: 11 May 2009, 00:06
by el_matarife
Do you sync in multiplayer games?

Re: Mac Binary Release

Posted: 21 May 2009, 12:21
by yokosou
I'm sorry I could not reply for a long. I'm still learning how to use git.

jackoverfull, thank you for testing. On my iMac with Leopard, ctrl-numbers were used by spaces and japanese input method by default. After removing these settings, ctrl-numbers worked fine.

el_matarife, multiplayer with spring 0.78.2.0 on Ubuntu worked fine. But, this may meaningless as 0.79 is already out...

Re: Mac Binary Release

Posted: 29 May 2009, 10:32
by el_matarife
Have you tried porting .79.0.2 or the current SVN trunk? Sefidel and I have been discussing the possibility of making OSX 10.4 and 10.5 on the Intel platform a "first class" Spring release soon. He's going to start writing a Cocoa / Obj-C lobby client soon that will be basic but functional. If you've got a syncing SVN trunk, once 79.1 is release if you build a binary and a DMG we could be good to go.

Re: Mac Binary Release

Posted: 01 Jun 2009, 17:11
by andre
Why do you want to reinvent the wheel? I already got springlobby to compile and run with OS X on zeuchs Intel Imac some months ago, so the lobby shouldn't be a big problem..

Re: Mac Binary Release

Posted: 01 Jun 2009, 17:26
by AF
A crossplatform and not an OS X only lobby would be far better

Re: Mac Binary Release

Posted: 03 Jun 2009, 12:16
by clericvash
AF wrote:A crossplatform and not an OS X only lobby would be far better
Agreed you should help the spring lobby guys make it work fully on mac! Don't re-invent the wheel!

Re: Mac Binary Release

Posted: 03 Jun 2009, 13:04
by el_matarife
Mac users tend to be bigots about crossplatform applications and really prefer native Cocoa interfaces. Also, I don't believe anyone on the SpringLobby team has a Mac, but I guess if Sefidel joined them that wouldn't be as much of a roadblock. I think Sefidel is going to use the Mac lobby as a "learning" project to pick up some Obj-C and Cocoa skills, but he'd have to confirm that.

Re: Mac Binary Release

Posted: 03 Jun 2009, 13:27
by koshi
el_matarife wrote:Mac users tend to be bigots about crossplatform applications and really prefer native Cocoa interfaces.
Like this or this? cross-plattform != not using native api for UI