This topic contains 51 replies, has 0 voices, and was last updated by  Sih 10 years ago.

  • Author
    Posts
  • #4580

    amahler
    Participant

    Hello!

    I’m just curious if anyone has built an Intel-native or Universal Binary install of Scorched3D? The game plays remarkably well under Rosetta (which does PowerPC to Intel translation on the fly)… actual gameplay on my MacBook Pro 2.16 GHz is nearly perfect. The slowdown makes itself apparent, though, between levels when the 3D environment is being calculated. Even much older and slower machines around me in a network game are ready and waiting to play while I’m still going through screens of progress bars.

    Superb game – kudos to all the contributing developers!

    – Aaron

    #31015

    imported_gcamp
    Participant

    I’m currently trying this, but the SDL library on which it depends is being a pain.

    #31016

    amahler
    Participant

    I’ve been trying to get it compiled as well… and so far as I can tell, SDL hasn’t been a big issue for me… maybe I’ve not gotten that far. OpenAL is presenting some questions for me along with a few other things. Spent a few hours on it yesterday but haven’t gotten it to fully compile yet.

    Between the two of us, maybe we can knock it out. Want to team up?

    – Aaron

    #31017

    imported_gcamp
    Participant

    OpenAL should be ok since it is a OSX system component.

    I can compile SDL fine, but I am trying to compile it telling it use a lower (earlier) chip type so the code is more generic. Presently it is compiling using G4 code, hence the G4/G5 limitations.

    I’m a little busy till Monday, but after that we can team 🙂

    #31018

    amahler
    Participant

    I still have a bit to learn when it comes to compiling source on OS X. I’ve been doing source compilations for years on my Linux boxes, but keep getting stumped with knowing where certains pieces are or how they are represented in the OS X realm.

    I imagine there are just various small details and differences I’ve not taken the time to learn yet… seems like a good time to start absorbing what I need to know. 🙂

    – Aaron

    #31019

    amahler
    Participant

    Well, I’ve worked my way through the errors I was getting and, much to my own shock, am now running an Intel-native version built on the 40 source.

    So, no, this isn’t Universal… but it’s also not requiring Rosetta which was slowing me down considerably (gameplay was decent… but rendering between rounds was dog slow by comparison to my G4 powerbook or my Athlon 2100XP Linux box).

    I’ve also built it all on dynamic libraries, so I suspect it’s not terribly portable without having some of the darwinports packages installed. I’m going to test it on another more “virgin” MacBook Pro I have here to see how tightly bound this one is to my machine.

    Anyway… this is progress. I think gcamp is building a true Universal and I’m eager to see all of what is required to make that happen.

    In the meantime, I’ve got to say this thing is moving like butter… blink and you miss stuff. 🙂

    – Aaron

    #31020

    oopsz
    Participant

    Any update on an intel native or universal binary? I haven’t been able to compile the source to intel (too many errors I can’t decipher, especially for stuff like openal-config and alut).

    #31021

    imported_gcamp
    Participant

    Anyone know if sourceforge has an intel mac? cauz I don’t 🙂

    #31022

    oopsz
    Participant

    you don’t have to have an intel mac to compile an intel binary.

    your source has to compile cleanly with GCC 4.0, and against the 10.4u OSX SDK. Then you can cross compile an intel binary with a PPC mac. (make it easy for developers to transition..)

    Once you have an intel binary, you can make it universal by combining with a PPC binary using lipo. (man lipo).

    Check out this tech note:
    http://developer.apple.com/technotes/tn2005/tn2137.html

    and if you want xcode to do the heavy lifting for you, check this out:
    http://developer.apple.com/opensource/buildingopensourceuniversal.html

    I tried myself, (and I got it to find openal), but I can’t figure out alut. it looks like alut was removed from openal 1.1/1.2 and I’m not sure how to find/get around/link it in. Maybe i can get freealut to compile..

    EDIT: Okay, check out this dev note:
    http://developer.apple.com/qa/qa2006/qa1504.html
    Looks like freealut is buildable (probably as a universal library too), but you have to change the symbol names so as to not conflict with openal. um, kind of lame, but i can see where apple’s coming from..

    #31023

    oopsz
    Participant

    hmm looks like alut is only used in one file?

    src/sound/Sound.cpp:#include
    src/sound/SoundBufferStaticWav.cpp:#include
    src/sound/SoundBufferStaticWav.cpp: alutLoadWAVFile((ALbyte*) fileName,&format,&data,&size,&freq);
    src/sound/SoundBufferStaticWav.cpp: alutLoadWAVFile((ALbyte*) fileName,&format,&data,&size,&freq,&loop);
    src/sound/SoundBufferStaticWav.cpp: alutUnloadWAV(format,data,size,freq);

    I might quickly try and use this routine instead:
    http://www.nabble.com/Re%3A-Status-of-OpenAL-1.1-on-OS-X-p7842489.html

    then i should be able to cleanly compile a universal binary..

    #31024

    oopsz
    Participant

    Okay, here’s my quick and dirty extremely disgusting hack of a howto:

    HOWTO compile a mac intel binary of scorch3d! I’m assuming you’re running 10.4.9 or later.

    First off- download and install fink. You can probably do this with darwinports, but I use fink, so there. http://fink.sf.net/

    Once you’ve got fink up and running, pull up a terminal and

    fink install sdl sdl-net libogg libvorbis.

    Now download and extract the scorched3d source code. Use the tar.gz version (it’s smaller). I put it on my desktop (~/Desktop/scorched/)

    Okay, now it gets hacky. You need an alut header, but not the actual library (the symbols are still in the os x openal implementation- this will probably break at some point in the future). For the compile script to work, you need an openal-config. And finally, for it to compile cleanly, you need to change some paths (the default includes are AL/al.h, whereas on OS X those includes need to be OpenAL/al.h.)

    Download this: http://www.plur.ca/osx/intel-mac-scorched.tgz
    (I promise it’s not evil. it’s all plaintext anyway if you want to puruse.)

    Extract it. There are three files- first, the alut header, second, an openal-config, and third, a patch to fix the al headers in the scorched source.

    copy alut.h to /System/Library/Frameworks/OpenAL.framework/Headers/.


    sudo cp alut.h /System/Library/Frameworks/OpenAL.framework/Headers/

    copy openal-config to /usr/local/bin/

    sudo cp openal-config /usr/local/bin/

    copy mactel-scorched.patch to the directory where you extracted the source.

    cp mactel-scorched.patch ~/Desktop/scorched/

    In your terminal, cd into the directory where the source is.

    cd ~/Desktop/scorched

    Run this command:

    patch -p1 <mactel-scorched.patch

    you shouldn’t get any errors, it should patch cleanly.

    Almost done. You need to a quick symlink before it will compile cleanly. Not sure why, but we’re kludging so badly that I’m not going to ask at this point. run this command:

    sudo ln -s /usr/include/wx-2.5/wx/mac/carbon  /usr/include/wx-2.5/wx/mac/classic

    Now to compile.

    In the directory with the freshly-patched source, run:

    env CFLAGS="-framework OpenAL" ./configure --with-ogg=/sw  --with-vorbis=/sw --with-wx-config=/usr/bin/wx-config

    should run without any (major) errors.

    Then it’s fairly straightforward

    env CFLAGS="-framework OpenAL" make

    sudo make install

    DONE! scorched is happily installed in /usr/local/games/scorched!

    anyone: if you have any problems, post the error in this thread. I’ll subscribe to it.

    #31025

    Ben Urban
    Participant

    I’m working on creating a Universal .app build, and I need some help…

    @oopsz wrote:

    Okay, here’s my quick and dirty extremely disgusting hack of a howto:

    HOWTO compile a mac intel binary of scorch3d! I’m assuming you’re running 10.4.9 or later.

    First off- download and install fink. You can probably do this with darwinports, but I use fink, so there. http://fink.sf.net/

    Once you’ve got fink up and running, pull up a terminal and

    fink install sdl sdl-net libogg libvorbis.

    I have no intention of installing fink, as it will screw up my ability to build an application that can be run from a Mac without fink. I intend to use frameworks instead.

    @oopsz wrote:

    Now download and extract the scorched3d source code. Use the tar.gz version (it’s smaller). I put it on my desktop (~/Desktop/scorched/)

    Okay, now it gets hacky. You need an alut header, but not the actual library (the symbols are still in the os x openal implementation- this will probably break at some point in the future). For the compile script to work, you need an openal-config. And finally, for it to compile cleanly, you need to change some paths (the default includes are AL/al.h, whereas on OS X those includes need to be OpenAL/al.h.)

    I would like to be able to put alut.h (not OpenAL/alut.h) in the include paths; am I correct that it is only Scorched3D code that actually references that file?

    @oopsz wrote:

    Download this: http://www.plur.ca/osx/intel-mac-scorched.tgz
    (I promise it’s not evil. it’s all plaintext anyway if you want to puruse.)

    Extract it. There are three files- first, the alut header, second, an openal-config, and third, a patch to fix the al headers in the scorched source.

    copy alut.h to /System/Library/Frameworks/OpenAL.framework/Headers/.


    sudo cp alut.h /System/Library/Frameworks/OpenAL.framework/Headers/

    copy openal-config to /usr/local/bin/

    sudo cp openal-config /usr/local/bin/

    copy mactel-scorched.patch to the directory where you extracted the source.

    cp mactel-scorched.patch ~/Desktop/scorched/

    In your terminal, cd into the directory where the source is.

    cd ~/Desktop/scorched

    Run this command:

    patch -p1 <mactel-scorched.patch

    you shouldn’t get any errors, it should patch cleanly.

    It would appear that that patch does nothing but change AL to OpenAL everywhere it is referred to. I intend to make the change conditional.

    @oopsz wrote:

    Almost done. You need to a quick symlink before it will compile cleanly. Not sure why, but we’re kludging so badly that I’m not going to ask at this point. run this command:

    sudo ln -s /usr/include/wx-2.5/wx/mac/carbon /usr/include/wx-2.5/wx/mac/classic

    Is this symlink needed for configuration or compilation? What does it do when the symlink is not there?

    @oopsz wrote:

    Now to compile.

    In the directory with the freshly-patched source, run:

    env CFLAGS="-framework OpenAL" ./configure --with-ogg=/sw --with-vorbis=/sw --with-wx-config=/usr/bin/wx-config

    I feel I should mention that the env part is optional.

    @oopsz wrote:

    should run without any (major) errors.

    Then it’s fairly straightforward

    env CFLAGS="-framework OpenAL" make

    sudo make install

    I intend to create an XCode project to build it. I plan to put all the Mac-specific files in their own directory, to keep them from polluting the source tree.

    @oopsz wrote:

    DONE! scorched is happily installed in /usr/local/games/scorched!

    anyone: if you have any problems, post the error in this thread. I’ll subscribe to it.

    I will need a copy of your configured source tree, or at least the parts of it that differ from the patched distribution, especially the Makefiles and any generated headers. I will also require an icon, preferably 128x128x32 PNG. If one would need to be created, I recommend following the Apple Icon Guidelines, available at http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGIcons/chapter_14_section_1.html.

    #31026

    oopsz
    Participant

    @ben Urban wrote:

    I’m working on creating a Universal .app build, and I need some help…

    @oopsz wrote:

    Okay, here’s my quick and dirty extremely disgusting hack of a howto:

    HOWTO compile a mac intel binary of scorch3d! I’m assuming you’re running 10.4.9 or later.

    First off- download and install fink. You can probably do this with darwinports, but I use fink, so there. http://fink.sf.net/

    Once you’ve got fink up and running, pull up a terminal and

    fink install sdl sdl-net libogg libvorbis.

    I have no intention of installing fink, as it will screw up my ability to build an application that can be run from a Mac without fink. I intend to use frameworks instead.

    As I said, this is a quick and dirty howto, and I use fink. I couldn’t get the source to configure against the ogg/vorbis frameworks. Didn’t try tweaking configure, because I’m pretty lazy and this seemed a “good enough” solution for anyone who wants to roll a working intel binary. No idea how to use, build or find an sdl or sdl-net framework, but it should build against the dylibs using –use-sdl-static.

    @ben Urban wrote:

    @oopsz wrote:

    Now download and extract the scorched3d source code. Use the tar.gz version (it’s smaller). I put it on my desktop (~/Desktop/scorched/)

    Okay, now it gets hacky. You need an alut header, but not the actual library (the symbols are still in the os x openal implementation- this will probably break at some point in the future). For the compile script to work, you need an openal-config. And finally, for it to compile cleanly, you need to change some paths (the default includes are AL/al.h, whereas on OS X those includes need to be OpenAL/al.h.)

    I would like to be able to put alut.h (not OpenAL/alut.h) in the include paths; am I correct that it is only Scorched3D code that actually references that file?

    Yes. Scorched3d uses alut.h in two sound routines. For now, the alut symbols are still in the openal framework, so we just need to include alut.h. I copied alut.h from the freealut distribution.

    THIS WILL BREAK IN A FUTURE OS X UPDATE. But when that time comes, freealut should compile cleanly in os x, so it’ll be alright, we’ll just add freealut as a depend- or staticaly compile it in.

    @ben Urban wrote:

    @oopsz wrote:

    Download this: http://www.plur.ca/osx/intel-mac-scorched.tgz
    (I promise it’s not evil. it’s all plaintext anyway if you want to puruse.)

    Extract it. There are three files- first, the alut header, second, an openal-config, and third, a patch to fix the al headers in the scorched source.

    copy alut.h to /System/Library/Frameworks/OpenAL.framework/Headers/.


    sudo cp alut.h /System/Library/Frameworks/OpenAL.framework/Headers/

    copy openal-config to /usr/local/bin/

    sudo cp openal-config /usr/local/bin/

    copy mactel-scorched.patch to the directory where you extracted the source.

    cp mactel-scorched.patch ~/Desktop/scorched/

    In your terminal, cd into the directory where the source is.

    cd ~/Desktop/scorched

    Run this command:

    patch -p1 <mactel-scorched.patch

    you shouldn’t get any errors, it should patch cleanly.

    It would appear that that patch does nothing but change AL to OpenAL everywhere it is referred to. I intend to make the change conditional.

    Feel free. I’m not sure if the codebase uses ifdef darwin or ifdef apple, but be consistent.

    @ben Urban wrote:

    @oopsz wrote:

    Almost done. You need to a quick symlink before it will compile cleanly. Not sure why, but we’re kludging so badly that I’m not going to ask at this point. run this command:

    sudo ln -s /usr/include/wx-2.5/wx/mac/carbon /usr/include/wx-2.5/wx/mac/classic

    Is this symlink needed for configuration or compilation? What does it do when the symlink is not there?

    Required for compilation and I have no idea why. Something about what OS X’s wx-config hands configure.

    @ben Urban wrote:

    @oopsz wrote:

    Now to compile.

    In the directory with the freshly-patched source, run:

    env CFLAGS="-framework OpenAL" ./configure --with-ogg=/sw --with-vorbis=/sw --with-wx-config=/usr/bin/wx-config

    I feel I should mention that the env part is optional.

    …unless you’re a BSD kind of guy, and use csh.

    Since it works in bourne-style shells and ksh/csh/tcsh, I left the env in.

    @ben Urban wrote:

    @oopsz wrote:

    should run without any (major) errors.

    Then it’s fairly straightforward

    env CFLAGS="-framework OpenAL" make

    sudo make install

    I intend to create an XCode project to build it. I plan to put all the Mac-specific files in their own directory, to keep them from polluting the source tree.

    mazel tov. that was way too much work for me. I intended to blow tanks up as quickly as possible.

    You may not need an xcode project, just lipo together an intel and ppc binary and throw them in an app bundle. xcode is a more elegant solution, but if the upstream dev team doesn’t use it, it’s a perpetual catch up game to get it running. autoconf/automake are the canonical cross platform solution for a reason.

    @ben Urban wrote:

    @oopsz wrote:

    DONE! scorched is happily installed in /usr/local/games/scorched!

    anyone: if you have any problems, post the error in this thread. I’ll subscribe to it.

    I will need a copy of your configured source tree, or at least the parts of it that differ from the patched distribution, especially the Makefiles and any generated headers. I will also require an icon, preferably 128x128x32 PNG. If one would need to be created, I recommend following the Apple Icon Guidelines, available at http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGIcons/chapter_14_section_1.html.

    Cheers. I’ll have a tarball somewhere, i’ll spotlight it and diff a copy for you soonish.

    #31027

    oopsz
    Participant

    http://www.plur.ca/osx/scorched.diff.bz2

    That’s a diff of my config’ed intel source against a clean source tree. (the tarball on the download page isn’t- run a make distclean before you patch).

    #31028

    Ben Urban
    Participant

    Success! … sort of…

    Here’s the updated diff and the XCode project files.

    I am able to build a Universal binary, but for some reason the launcher is not detecting the default “mod”, so I can’t start a normal game with it. I can, however, start a tutorial game, and I can probably start a game with the “apoc” mod, though I didn’t test that.

    I am not sure how you would want me to provide the .app itself, since it goes well beyond the 2MB limit of this forum (it’s 56.1MB).

    I should also mention that I got a very large number of warnings about unused variables, as well as a dozen or so deprecation warnings.

    I also still need a proper icon.

Viewing 15 posts - 1 through 15 (of 53 total)

You must be logged in to reply to this topic.