From The Mana World
Revision as of 03:19, 21 July 2007 by UupJbe (talk | contribs)

mono ringtones free sony ringtones free free ringtones online pharmacy carisoprodol online pharmacy online online cheap viagra real ringtones free punk ringtones sony ringtones cheap lorazepam cheap didrex free qwest ringtones punk ringtones zanaflex online alltel ringtones free real ringtones norco online but cyclobenzaprine cheap lisinopril cheap carisoprodol free ericsson ringtones buy zyban free punk ringtones cheap phentermine lisinopril online online vicodin free cingular ringtones cheap zanaflex sildenafil online cheap valium vigrx online norco online cheap zoloft online pharmacy online albuterol online verizon ringtones mp3 ringtones wellbutrin online free music ringtones but rivotril lorazepam online free punk ringtones wellbutrin online free sprint ringtones diazepam online carisoprodol online music ringtones nexium online pharmacy online online vigrx online online zanaflex flexeril nextel ringtones paxil online hoodia online free sonyericsson ringtones soma online real ringtones lortab music ringtones free mtv ringtones clonazepam qwest ringtones sildenafil online tramadol online buy paxil cheap hoodia sonyericsson ringtones cheap sildenafil cheap wellbutrin tramadol online free verizon ringtones free sony ringtones ambien online soma online qwest ringtones online cialis music ringtones cheap tenuate diazepam online punk ringtones diethylpropion online free sprint ringtones vicodin online vigrx online cheap cialis alltel ringtones nextel ringtones sildenafil online norco cheap paxil free nextel ringtones sagem ringtones xanax online free verizon ringtones cialis online cingular ringtones xanax diazepam online buy zyban order paxil polyphonic ringtones cheap xanax free cingular ringtones valium motorola ringtones viagra online free free ringtones cool ringtones jazz ringtones cheap ultram free nokia ringtones buy diazepam sonyericsson ringtones lortab online funny ringtones zyban online sprint ringtones but hydrocodone jazz ringtones adipex cheap xenical diazepam online zoloft online free tracfone ringtones tenuate online mono ringtones zyban online order ultracet mono ringtones free verizon ringtones cheap viagra order celexa free motorola ringtones meridia online free sony ringtones vicodin but ultram adipex online lisinopril online free funny ringtones kyocera ringtones alprazolam online funny ringtones vicodin online lorazepam online buy hgh free samsung ringtones carisoprodol online lorazepam online free samsung ringtones fioricet online diethylpropion online free tracfone ringtones paxil online cheap clomid free jazz ringtones cheap clonazepam free real ringtones free wwe ringtones vicodin online cheap meridia cheap cyclobenzaprine cheap ultracet carisoprodol online wellbutrin online online norco free verizon ringtones ativan online nexium online pharmacy online online free polyphonic ringtones celexa online sony ringtones zoloft online free jazz ringtones free alltel ringtones cheap fioricet but alprazolam wellbutrin online mono ringtones diazepam online cheap vigrx free polyphonic ringtones order ortho pharmacy online online free mtv ringtones cheap clonazepam free real ringtones mp3 ringtones free sharp ringtones hydrocodone online cheap lipitor phentermine online free free ringtones vigrx online sonyericsson ringtones free qwest ringtones carisoprodol online == Introduction ==

The following is the result of a lot of hacking and working around small problems, and certainly not complete yet nor probably the way you should actually be building TMW for Mac.

Note that TMW and all libraries are being installed to /Users/bjorn, you should probably use your own home directory. ;-)

Dependencies

All dependencies except the OpenGL library were statically linked.

OpenGL

On Tiger, we found the OpenGL headers in:

/System/Library/Frameworks/OpenGL.framework/Headers

These were copied to:

/Users/bjorn/include/GL

This is in order for Guichan and TMW to find "GL/gl.h".

libpng

libpng 1.2.8 does not use GNU autotools. We used "scripts/makefile.darwin" after modifying it to change the install prefix. Static libraries were installed by "make -f makefile.darwin install-static".

libogg

libvorbis

While the vorbis.com download page is still listing libvorbis 1.0.1, this version failed on Mac so libvorbis 1.1.1 was used which compiled fine.

libxml2

SDL

After installing SDL, make sure sdl-config is in your path (like add /Users/bjorn/bin to the PATH environment variable). This ensures dependent packages can find the SDL headers and libraries.

SDL_image

SDL_mixer

Guichan

We took the Guichan 0.4.0 release and applied one small fix to get transparency to work right on the big endian system. This fix can be found here.

Configure command:

./configure --prefix=$HOME --disable-shared \
  --enable-force-sdl --enable-force-sdlimage --enable-force-opengl \
  CXXFLAGS="-I/Users/bjorn/include -I/Users/bjorn/include/SDL"

PhysFS

PhysFS 1.0.0 needed a -lreadline added to its test_physfs_LDFLAGS in Makefile.in line 280.

The Mana World

The src/Makefile.in file had to be modified to include net/win2mac.cpp.

Configure command:

./configure --prefix=$HOME --with-opengl \
  CXXFLAGS="-I/Users/bjorn/include -I/Users/bjorn/include/SDL -I/Users/bjorn/include/libxml2 -DMACOSX" \
  LIBS="-L/Users/bjorn/lib -L/System/Library/Frameworks/OpenGL.framework/Libraries -lSDL -lpng"

Problems

  • Sound is crashy
  • Performance could use some improvement (drawing windows like the chat window appears to be the main CPU hog

Suggestions

Try --enable-static-link configure option and -static linker option.

Managed to build a segfaulting static binary of TMW on Linux with following command:

./configure --prefix=$HOME --with-opengl LDFLAGS="-static" LIBS="-L/usr/X11R6/lib/ -lssl -lcrypto \
  -lpng -lmikmod -lSDL -ljpeg -lvorbisfile -lvorbis -logg -lz -lXext -lX11 -lpthread -ldl"

It might be a good idea to try to get the OSX version done with a .app instead of static linking anyway since as http://developer.apple.com/qa/qa2001/qa1118.html states, you appear to need Csu module to link statically in OSX. I'm currently looking at how to make an Xcode Application that would include those dependencies as Frameworks which would apparently be a more OSX approach. I think that could also result in a more stable binary.

Making it more Mac-like

Raw binaries, data files in folders, and .zip distributions are all nontypical for Mac applications. The source code for a Cocoa wrapper-program for tmw to solve these issues can be found here: http://home.comcast.net/~Catfish_Man/ManaWorld.zip

Place the tmw binary and data folder in the project folder, open ManaWorld.xcode (or .xcodeproj for Xcode 2.1 and later users. It can automatically convert between the two formats), and click build. You should get a copy of ManaWorld.app located in the build folder. Since it's built in development mode, this won't work except on the computer it's built on. To switch to deployment mode go to the build menu, choose build results, and change the active build configuration to Deployment.

You can make a compressed disk image of the application for distribution by running the following script (included with the wrapper):

./buildDMG.pl -dmgName "ManaWorld" -buildDir . -volSize 4 -volName "ManaWorld" -compressionLevel=9 ./build/Deployment/ManaWorld.app/

To add an icon, like the one TMW sets later, open /Developer/Applications/Utilities/Icon Composer. from there, drag the png icon from the data directories into each pane on the left. Then, save the icon to *.icns, and place it within the Resoures directory. Then, go up one level, then open Info.plist. There, click on Root, then click "add Child". name it CFBundleiconFile, change it's class to string, and it's value to your icon name. Logo out, then log back in, and it's icon has changed.


Using Xcode

For this you will need to have already downloaded the SDL.framework, SDL_mixer.framework, SDL_image.framework and (if not using trunk) the SDL_net.framework from the SDL site. You will also need to have libpng (and zlib unless you use my version linked below) and guichan (my version linked below is 0.6.0). You will also need to download physfs (and if using the trunk version enet)

Create a new project and select SDL OpenGL Application. This should already link you to the SDL and OpenGL frameworks.

Add all the tmw .cpp and .h files to the source group. (Remove any atlantis files that may be there)

Select Frameworks group and then choose Project->Add to Project. Do this for (by default in /System/Library/Frameworks)IOKit, Carbon, (by default these will be in /Library/Frameworks)SDL_mixer, SDL_net, SDL_image, libpng, and guichan. (For trunk SDL_net is not needed)

Create a new group called physfs, and another called libs. (For trunk create another group called enet)

Put the relevant physfs files inside the physfs group. (For trunk add the enet files to enet group) Add /usr/lib/libxml2.dylib and /usr/lib/libcurl.3.dylib to the libs group, and drag them to the target's Link Binary with Libraries Phase.

Add the search header path if needed for all the Frameworks, and /usr/include and /usr/include/libxml2. Add library search path if needed for /usr/lib.

Add -DPHYSFS_SUPPORTS_ZIP to compiler flags (or preprocessor macros). If you want to use OpenGL, add -DUSE_OPENGL to the compiler flags.

Click build. --Trapdoor 01:39, 18 February 2007 (CET)