09-28-2005, 08:06 PM,
|
|
abs1nth
Senior Member
   
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
mac os x port
hello alli wanted to compile a macosx binary of vdrivft, expecting that it would be more or less straightforward, since it only depends on libraries that are available on macosx too (opengl, sdl, openal, etc.).first i had big troubles using ./configure, it did not find opengl or openal, even with some tweaking...finally gave up on the autotools route and i produced an xcode (the free mac-IDE) project. to get it to compile not many changes were needed, mainly replacing outdated (not defined) opengl *_EXT_* defines with their *_ARB_* counterparts. getting the executable to do something was a bit trickier, since vdrift has some c++ initializers call opengl functions, which lead to crashes, had to move those call to places that are called later...(when opengl is initialized). after these steps i finally had an executable that would allow me to start some race, just to soon after crash in some audio related code.... what lead me to abandon my effort (for now) was looking at some errors spit out in some file-loading code (.joe files or something like that) .... and realizing that the whole file would only work on little-endian machines, and i would have to add quite some bit of byte-swapping to make it work on big-endian...i guess it's also endian issues that led to the audio crash.so if you ever want a mac (ppc), linuxppc, or sparc port you should look into making your code endian independent...if these issues are taken care of it will be easy for me to produce a macosx binary, in case there is any interest.if none of you has any big-endian machines, you could use qemu with linuxppc to do some testing without spending money...
|
|
09-29-2005, 09:25 AM,
|
|
abs1nth
Senior Member
   
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
mac os x port
Quote:I'm totally unfamiliar with writing endian-independent code (just aware of the issue). Could you point to any resources or provide any advice?
well the basic issue is that the ordering of bytes is not the same. so everytime you read or write (to a file or to the network) something thats bigger than one byte (short, int, long, float, structs..) you have to take care of that (also when doing bitshifting). practically that would mean inserting macros that do nothing on little-endian, but swap the byte ordering on big-endian. there is on article on the topic here, altough the proposed solution seems a bit overengineered:http://www.gamedev.net/reference/articles/article2091.asp Quote:Also, I'll try my best to get around to replacing the EXT opengl defines and removing any opengl calls from C++ initializers -- that's just sloppy on my part.
great! Quote:I still think it would be faster if done by someone who a) already knows his way around OS X and b) has some experience with coding for PPC.abs1nth, are you interested?
sorry i don't have the time do that, but once the endian issues are sorted out, i will take care of the remaining issues that are needed to get vdrift running on osx, and produce binaries. and just for ironing out the endian issues you really need neither OSX nor PPC expirience (or any of that available) :wink:
|
|
10-20-2005, 12:11 PM,
|
|
abs1nth
Senior Member
   
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
mac os x port
>then hopefully the next release will be ready to porti figured it would be better to try it out now so we can be sure that the next release has no port-showstoppers.so i downloaded svn trunk and started porting again *g*the problem is that model.cpp still doesn't work right on big-endian, maybe you forgot some swaps? (it hangs forever in TREES::BuildCompositeShadow())but when i turn off model-loading and specify nosound it works quite nicely and i was even able drive/drift around a bit :wink  o please apply the patch from:****(fixes various issues)and please add the contents of:****to vdrift's "tools" directory (it contains Xcode project files)you can also view a screenshot here:****EDIT: files removed now
|
|
|