Author Topic: Compiling the code  (Read 2918 times)

0 Members and 1 Guest are viewing this topic.

Sorry if this is out of place, but this seems to be about the only place on the web still trying do things with the source code.

I'm trying to get the original source code to compile with VS.NET 2003.  I've figured out the problem is they are trying to define values to some of the function pointers in the header files.  This was fine in VS6 but it doesn't fly in .NET 2003.  As you probably know the function calls in the actual code leave out the variables that were defined in the header files.  So is it alright for me to goto each of the function calls and add the default values as they appear in the header?

For example here is a line for 2d.h:
int (*gf_tcache_set)(int bitmap_id, int bitmap_type, float *u_scale, float *v_scale, int fail_on_full, int sx, int sy, int force);

And here is a line from Gr3D3Render.cpp:
if ( !gr_tcache_set( gr_screen.current_bitmap, TCACHE_TYPE_AABITMAP, &u_scale, &v_scale ) )   

I already removed the defined values in the header but you can see the acutal function call is missing some of the arguments.

I would just compile it under VS6 and say screw it, but the only thing I have access to know is .NET 2003 and I would really like to play around with the code a bit.

 

Offline Sticks

  • 29
Somebody beam this fellow!

Go right ahead, as long as it does the trick, perhaps we will add these changes in as well if it helps.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Gloriano

  • silver dracon
  • 210
  • Oh
Quote
Originally posted by Sticks
Somebody beam this fellow!

OK! Target and open Fire
:welcome:
You must have chaos within you to give birth to a dancing star.- Nietzsche

When in despair I remember that all through history the way of truth and love has always won; there have been tyrants and murderers, and for a time they can seem invincible, but in the end they always fall.- Mahatma Gandhi

 

Offline redmenace

  • 211
2 questions
do you have the DIRECT X SDK
and
do you have the speach SDK(optional)

also if you want the most up to date code look in the thread most up to date links or something like that. and get CVS 1.2 from the list. The directions for it are at freespace.volitionwatch.com/fsscp/
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 
I could have swore I had the SDK to 9 installed on my computer, but it seems as if I don't.  Those aren't functions that are defined in the DX files are they?

Have to check out some of the updated code.

 

Offline redmenace

  • 211
well try that and see if that works.
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 
Actually I got the 'code' part of the source down to 568 errors.  And all of those errors call to those pointers to functions.  And if I manually add the extra variables to the calls the errors go away.  I was looking more into the 'code' part and it sees as if all the DirectX stuff Freespace 2 uses is already included.

Why do you need to have that CVS for the FSOpen code to work?  And if I was to compile it to run on my machine do I still have to have all the extra registry entries to run on another computer?

 

Offline redmenace

  • 211
well I think RT can help you with those registry entries. and CVS allows you to get the most recent code from the CVS repository. basically the SCP code.
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 

Offline RandomTiger

  • Senior Member
  • 211
I would advise playing around with a smaller project in .net, freespace is a beast of a learning project. Try looking in the project settings for backcompatibilty options that might mean you dont have to change the code.

If you want to run fs2_open you need to run my launcher to setup the reg. If you want to compile it you checkout a version using cvs, make sure you have directx8.1b(?) installed.

If you do continue with your quest we would be very grateful if you could write a quick report of everything you learn about moving it to .net. Just in case (I hope not) we ever decide to move fs2_open that way.

 
.NET 2003 has been a bit of a learning experience.  Some of my questionable coding practices don't work anymore.  And I guess the Freespace 2 code compiles fine with .NET 2002.  I'm far from an expert at programming but it seems that defining values when declaring pointers to functions is not compliant with ANSI C++.  .NET 2003 is a lot more strict about those kind of things then VC 6 and .NET 2002 were.  I'm in the process of manually editing all the function calls.  So the code should be 'better' (if it does compile) when I get done.  I'll post back here when I get it done and tell you if it compiles or not.

 

Offline redmenace

  • 211
Quote
Originally posted by darkchrono4
.NET 2003 has been a bit of a learning experience.  Some of my questionable coding practices don't work anymore.  And I guess the Freespace 2 code compiles fine with .NET 2002.  I'm far from an expert at programming but it seems that defining values when declaring pointers to functions is not compliant with ANSI C++.  .NET 2003 is a lot more strict about those kind of things then VC 6 and .NET 2002 were.  I'm in the process of manually editing all the function calls.  So the code should be 'better' (if it does compile) when I get done.  I'll post back here when I get it done and tell you if it compiles or not.


forgive my insolence but you migght want to start altering the newer code from the CVS repository.
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Red menace makes a good point. It won't be any harder to alter the CVS code and it means that your code would actually be useful.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Guess I should just give you the full details.  I'm a member of Star Wars club called the Emperor's Hammer and specifically the TIE Corps where we fly games from the X-wing series.  Our newest game, X-wing Alliance, is like five years old now so membership has been steadily decreasing over the past couple of years.  What we need is a new flight sim and the chances of Lucas Arts doing another good one is slim at best.  So the only option we have is to do one ourself.  What we wanted to do was take Freespace 2 and put an Imperial theme to it.  We've got some people working on the craft, animations, and all the other good stuff so we don't have to include any of the actual Freespace 2 data objects.  Then we wanted to compile the game code ourselves so there is no legal problem their either.  In the end what we want to do is make another X-wing style game that will be a free download to anybody that wants to take the time.  We would like to use your version of the game because it is a major  improvement over the original.  If you didn't mind us slapping some Emperor's Hammer logos on some stuff and giving you guys full credit for the coding then I would happily modify your code instead of the original.  So if you don't care then I'll fix your code up and pass it back along.  But if you don't want us to then I'll do the original and there will be no hard feelings.

  

Offline Flaser

  • 210
  • man/fish warsie
First things first:
Check the SW conversion page - they're the people who you seek here

Second:
You can use the code, but you aren't allowed to make any profit out of it and you'll have to give credit to Volition for making the original.
If you want to use the SCP version it would be proper to also mention HLP and the people who worked on it.

Third:
No it's not us who're bickering, but those are the terms under which Volition released the code.

So: if you want to make a game out of it and put it up on the net for free download and take credit for any further development you made on your own you're welcome to do as you please.
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

 
We see it as if we do the project ourselves everything is ours and we don't have to worry about people getting attitudes.

I know what the terms are on the source code.  I just wanted to know if it was alright with you guys if we used your code as the base for our project.  Full credit will be given to everybody involved.  I don't purposefuly try and steal code and call it my own.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I'd suggest working with the Star Wars conversion people and the SCP itself rather than branching off on your own. Why have two groups doing basically the same thing?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Not to make us sound like control freaks.  We can tailor it for our needs as a club and make it available for other people.  If we get involved with a group that isn't related to our club then we have to use what they think is best.  I don't want to come across as a prick but for our purposes its much easier if we do it ourselves.

I'm steadily progressing through the code fixing it up.  Like I said before if it does compile then I'm going to pass it right back to this community.  You never know, for whatever reason the project might have to move away from the VC6 compiler.

 

Offline Sticks

  • 29
While I myself would like to see the SW conversion folks and your club work together on non-code-related things such as models and the like, you are correct in asserting that it is not feasable for your club and the SCP to work together on the code itself.

I'm sure you guys have differing goals and to have to work around our release schedules and code freezes would be a pain in the rear, to say the least. However, I am looking forward to the new features you add in and hope that they can be ported back to the SCP version in the future. If you've got any questions whatsoever, just drop us a line here and we'll do our best to help out.

People, instead of slapping restrictions and complaints, let's instead offer thier crew an SCP vote of confidence and good luck.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Aside from the Star Wars conversion bit: If you could modify the necessary header files so that the code compiles in VS .NET while also compiling in VS 6, we'd appreciate the help. :) We have a coder or two who want to join the SCP but currently can't, due to not having VS 6.

 
Correcting the headers is the first step in correcting this whole mess.  Trying to compile it tells me where all the errors that need to be fixed are .  :devil:  I got my new computer here a couple of days ago so I've been slacking off on all my stuff and playing Knights of the Old Republic.  I will be back fixing this as soon as I show Malak the true power of the Dark Side.