Author Topic: Freespace 2 port to GCC  (Read 19855 times)

0 Members and 1 Guest are viewing this topic.

Offline vrodic

  • 23
Freespace 2 port to GCC
Hi

I have ported Freespace 2 code
to Free Software Fundations gcc.

It compiles and works on win32 version of gcc. (MingW)

I've played a couple of campaign missions with no problems.

The goal of my project is to port it to  UNIX systems. (Linux, FreeBSD, Mac OS X.)

I'll use OpenGL for ALL drawing, including 2D.

I'm releasing it on CVS here.

Take stuff for your own porting projects, or contact me if you would like CVS write access.

In addition to dealing with compile time problems penguin mentioned, I ported the asm code needed for fs2.exe to GNU AT&T style inline asm. I avoided converting all filenames to lowercase.

The code should still compile fine under  MSVC.

 

Offline Inquisitor

Freespace 2 port to GCC
Doh, seems like someone beat us to the CVS punch :)

Great work on the GCC port, someone was just asking about compiling on things other than MSVC.

You have a changelog available from the original source?

Oh, and, how much band can your CVS handle for downloads?
« Last Edit: May 07, 2002, 04:12:21 pm by 122 »
No signature.

 

Offline vrodic

  • 23
Freespace 2 port to GCC
Heh, you can make your own repositories.

Using CVS is convenient for me even as a solo programmer.

The server where it is currently is not that stable (bandwidth
and availability wise) and I would love to put the repo on some other server eventually.

Look at the great CVS book http://cvsbook.red-bean.com/

About changes, they are documented in CHANGES file:

look at
comments containing VRODIC in source,
diary/diary for pre CVS import,
and CVS history for post CVS import.

Unix diff program is usefull for spotting changes too, but convert files to unix format before you do that.

You can send me patches in diff format too.

Off to hack code now.

 

Offline Inquisitor

Freespace 2 port to GCC
Excellent :)

Warpcore has offered CVS pending a project lead being named, so now we gotta bug sandwich to get that vote going :)
« Last Edit: June 02, 2002, 09:38:01 am by 122 »
No signature.

 

Offline Sandwich

  • Got Screen?
  • 213
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Freespace 2 port to GCC
Quote
Originally posted by Inquisitor
Excellent :)

Warpstorm has offered CVS pending a project lead being named, so now we gotta bug sandwich to get that vote going :)


I posted one last reminder for people to sign up. I'll post the poll by the weekend, including anything relevant from the VWBB in the poll, and posting a link from there to the poll here.

I'm thinking of leaving the poll open for 1 week - does that sound good?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Inquisitor

Freespace 2 port to GCC
sounds good to me :)
No signature.

 
Freespace 2 port to GCC
Sheesh, even faster than me! (Although I was waiting for project manager and all that to be set up before I did any real work anyway)

About graphics, I would strongly suggest we use SDL. It's a lot better than going core OpenGL.

 

Offline Inquisitor

Freespace 2 port to GCC
You think?

Why, out of curiousity?
No signature.

 
Freespace 2 port to GCC
It's easier to use, automates some things, is very stable, and seems to be at least equal in performance. When it doesn't work, it is also generally easier to debug, too. Plus, there's a lot of secondary libraries based around SDL, which besides telling you it's got to be pretty good, allow easy implementation of a lot of common needs, although in this particular case that's not likely as important.

 

Offline Inquisitor

Freespace 2 port to GCC
Hmm, I thought most people were using it for control.

Well, that will have to be a decision point for any port :)
No signature.

 
Freespace 2 port to GCC
That's the thing - it can easily go both ways. It's based on control, but there are functions that call some of the more commonly-used control ones at once to save the effort if you don't need the control.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Freespace 2 port to GCC
this vrodic guy seems like he'd make a good project lead
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Inquisitor

Freespace 2 port to GCC
Up to him to apply ;)

Could be he just wants to code ;)
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Re: Freespace 2 port to GCC
Quote
Originally posted by vrodic
Hi

I have ported Freespace 2 code
to Free Software Fundations gcc.

It compiles and works on win32 version of gcc. (MingW)

Nice work getting it up so fast, Vedran.  But when I pulled down the project from your CVS repository I still can't get it to compile using gcc 2.95.3 on Linux -- it's still the anonymous struct thing in pstypes.h.  You did say you were using gcc 2.95.3 as well?  Odd that the same release of gcc would behave differently across platforms., unless you're using gcc 3.0.

Quote

I'll use OpenGL for ALL drawing, including 2D.

Cool idea using OpenGL for the 2D -- much easier than dealing with all of the X toolkits, and more portable as well.

Any ideas about performance? (not like it matters much on 2D -- the only timing-related things would be ani's and maybe loadout).  I had heard that OpenGL 2D was not optimized much, but I imagine this is dependent on the drivers and hardware.

Quote

In addition to dealing with compile time problems penguin mentioned, I ported the asm code needed for fs2.exe to GNU AT&T style inline asm.

Very cool.  Did you use a tool, or was this hand-converted?
your source code slave

 
Freespace 2 port to GCC
Quote
Originally posted by Mysterial
It's easier to use, automates some things, is very stable, and seems to be at least equal in performance. When it doesn't work, it is also generally easier to debug, too. Plus, there's a lot of secondary libraries based around SDL, which besides telling you it's got to be pretty good, allow easy implementation of a lot of common needs, although in this particular case that's not likely as important.


I think I'll throw in some more specific things that SDL is good for:

  • Full-screen OpenGL with all the riggings. Choosing full-screen or windowed is a piece of cake -- just turn the bit 'SDL_FULLSCREEN' on or off when passing the video flags to SDL_SetVideoMode. Switching video modes or fullscreen/windowed mode in-game is also a piece of cake -- just call SDL_SetVideoMode again, with different parameters.
  • Interface to input devices (keyboard, mouse, joystick). Serves the same purpose as DirectInput.
  • Interface to audio devices. Serves the same purpose as DirectSound. Doesn't do 3D sound, though. (Use OpenAL for that.)
  • Portable to Windows, *ix, etc. Should make porting FS2 to these systems much easier.


I should also point out that the D1X and D2X projects can use SDL. Both games play awesome on my Linux box when using this configuration.

 

Offline vrodic

  • 23
Re: Re: Freespace 2 port to GCC
Quote
Originally posted by penguin

Nice work getting it up so fast, Vedran.  But when I pulled down the project
from your CVS repository I still can't get it to compile using gcc 2.95.3 on
Linux -- it's still the anonymous struct thing in pstypes.h.  You did say
you were using gcc 2.95.3 as well?  Odd that the same release of gcc would
behave differently across platforms., unless you're using gcc 3.0.


Yeah, it behaves differently since it is not _exactly_ the same release. MingW gcc has some patches to make some win32 things work. gcc 3 should have been the release that has all MingW patches included, but for one reason or another, it doesn't.

I personaly have no problem with using gcc 3 for Linux port, but I don't object to changes to make it compile under 2.95 either.

Please feel free to send patches to make it compile on 2.95.3 :) That would of course mean that you are willing to start of with my code base. I'm sorry, I just wasn't patient enough to wait for you...

Quote


Cool idea using OpenGL for the 2D -- much easier than dealing with all of
the X toolkits, and more portable as well.

Any ideas about performance? (not like it matters much on 2D -- the only timing-related things would be ani's and maybe loadout). I had heard that OpenGL 2D was not optimized much, but I imagine this is dependent on the drivers and hardware.


It would still be 2D code, capable to be ported to any 2D drawing backend.
I was planning on using 3D OpenGL code for 2D stuff (like Evas does).  There is even a cool glSDL code for SDL 2D with OpenGL, but I didn't look at that yet. I don't think that there'll be performance problems with 3D using 2D implementation, but there may be misc bugs. If the bugs or performance problems come up on my DRI Radeon drivers, I can try fixing them myself :)

Quote
Originally posted by Mysterial

About graphics, I would strongly suggest we use SDL. It's a lot better than going core OpenGL.


I like SDL too, and maybe I'll use it for input and OpenGL setup, but I'm not sure will if it will do it for the sound.  I'll probably check out OpenAL when I get there.




Quote
Originally posted by Inquisitor


Up to him to apply :)

Could be he just wants to code :)


If I did apply, this would be my first position as project coordinator of a community project. Though I would  love to do that, I would prefer spending my free time coding.

I'm supporting the candidature of Mike Harris (penguin) for this role. I also support  Inquisitor. I would just like to get off this forum and start doing some group programming ASAP :) Warpcore CVS seems to be the ideal place for the code, and warpcore mailing list at  http://www.descent-freespace.com/lists/fdl/ seems to be the ideal place for discussion.

Right now I'm still working on spotting and isolating win32 specific code. Removing dependany on MS ADPCM is the first next step...

The only thing I did since yesterday is the removal of AudioStreamServices class which doesn't seem to do anything useful.
« Last Edit: May 08, 2002, 08:13:58 am by 749 »

 

Offline Inquisitor

Freespace 2 port to GCC
I have to say I was SHOCKED when I got an FDL mail last week.

Completely forgot about that list :) I'm in favor of it for no other reason than the nostalgia value :)
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Re: Freespace 2 port to GCC
Quote
Originally posted by vrodic
I'm sorry, I just wasn't patient enough to wait for you...
NP, I hear that all the time :doh:
Quote
I'm supporting the candidature of Mike Harris (penguin) for this role....
Thanks for the vote of confidence, but I don't know if I have enough hours in the day to coordinate and test all the new features that people want to add.  Plus, my Windows development environment is awful -- my game machine doesn't have a C compiler, and my development box has a crappy video card that can't run FS, and they're 30km from each other.  So it's hard for me to test anything in the Windows world in a reasonable timeframe.  

I'm still mostly interested in getting a portable fs2 going.  After that, I could contribute :nod:
your source code slave

 

Offline Inquisitor

Freespace 2 port to GCC
Testing is easy to arrange :)
No signature.

 

Offline vrodic

  • 23
Re: Re: Freespace 2 port to GCC
Quote
Originally posted by penguin

Very cool.  Did you use a tool, or was this hand-converted?


Forgot to answer this one.

It was hand-converted.