Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Source Code Project > COMPILE: Linux Port
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread   
Pages (5): [ 1   2   3   4   5   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 18-11-2003 03:23
Edit/Delete Message Reply w/Quote
#31 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by bfennema
I got the executable to build with SDL/SDL_mixer instead of mss32, and sound (at least the sfx) seem to work fine. The only thing I couldn't do a direct mapping of was cdrom volume. I couldn't find a way in SDL to adjust the cdrom volume.


SDL doesn't provide a way to control the volume, so you have to implement an OS-specific routine to do it.

Basically in linux, you do an ioctl on the cdrom device (which just happens to be the 'id' field of the SDL_CD struct) -
You can see how I did it in d2x here:
http://cvs.icculus.org/cgi-bin/view...f?r1=1.4&r2=1.5
Note that this doesn't touch the mixer of your sound card, it changes the volume internally on the drive itself.

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 18-11-2003 22:14 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#32 Report this post to a moderator
Inflate your Upload Space

quote:
Originally posted by btb
Basically in linux, you do an ioctl on the cdrom device (which just happens to be the 'id' field of the SDL_CD struct) -
You can see how I did it in d2x here:
http://cvs.icculus.org/cgi-bin/view...f?r1=1.4&r2=1.5
Note that this doesn't touch the mixer of your sound card, it changes the volume internally on the drive itself.


Thanks btb, this is great! If you're ever interested in helping out with the linux port, let me know. Right now the work is getting the .cpp files so that g++ can compile them. Stuff like correcting case, fixing decls, ....

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 19-11-2003 02:05
Edit/Delete Message Reply w/Quote
#33 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:
Originally posted by closms


Thanks btb, this is great! If you're ever interested in helping out with the linux port, let me know. Right now the work is getting the .cpp files so that g++ can compile them. Stuff like correcting case, fixing decls, ....


I'd love to. I don't see how we can really collaborate without CVS or something though. The EULA for this source code is totally fubar, but I have an idea of how we can do it legally.

-btb

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 19-11-2003 02:12 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#34 Report this post to a moderator
Full PM-box? Change here!

Activision have mentioned that we are, after all, allowed to use a CVS...

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 19-11-2003 02:31
Edit/Delete Message Reply w/Quote
#35 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Oh, okay. I just read the updated FAQ, and that's pretty much what my idea was: Put it on cvs, but in order to get to the web page which shows the password, you have to click a link confirming that you have acquired a "legal" copy of the source, and agreed to the EULA.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 19-11-2003 02:32
Edit/Delete Message Reply w/Quote
#36 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Has anybody looked into a host for the linux port? I can try to get it on icculus.org...

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 19-11-2003 04:32
Edit/Delete Message Reply w/Quote
#37 Report this post to a moderator
Get a bigger avatar today!

I am trying to compile civapp.cpp and I am getting some strange Errors:

code:
In file included from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/memory:59, from ../ui/interface/MainControlPanel.h:15, from ../ctp/civapp.cpp:74: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/bits/stl_raw_storage_iter.h:64: syntax error before `namespace' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/bits/stl_raw_storage_iter.h:79: ` _ForwardIterator' was not declared in this scope /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/bits/stl_raw_storage_iter.h:79: syntax error before `)' token /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/bits/stl_raw_storage_iter.h:79: only declarations of constructors can be `explicit' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3/bits/stl_raw_storage_iter.h:81: syntax error before `&' token


These errors are strange for several reasons:
1. I haven't managed to reproduce thes errors with test programs of my own, would be included nicely.
2. 'namespace' is the first piece of code in that file, so a syntax error bfore that doesnt make much sense...

about the cvs server: closms has already set up a temp cvs server, but i think it wouldnt hurt to have an official one.

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 19-11-2003 06:22 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#38 Report this post to a moderator
Help yourself to an AD-FREE life

quote:
Originally posted by uppi
I am trying to compile civapp.cpp and I am getting some strange Errors:



Hi uppi,

check cvs for a fix that worked for me. The problem was in netshell.h. Specifically the action callback in the DestroyAction class.

g++ can give crappy error messages sometimes.

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 20-11-2003 04:43
Edit/Delete Message Reply w/Quote
#39 Report this post to a moderator
Support Apolyton buy from Amazon

Thanks, civapp.cpp compiles finally

btw: This is what i would call a "creative and unique name for a variable":

code:
GUID GUID;


How the hell could any compiler accept this?
I changed the name of the variable to displayGUID, so if anyone finds g++ complaing about DisplayDevice::GUID change it to DisplayDevice::displayGUID .

Joss is offline Joss
Settler

Nov 2003
time: 05:31
  Old Post 21-11-2003 00:52
Edit/Delete Message Reply w/Quote
#40 Report this post to a moderator
Support Apolyton buy from Amazon

Is their now a way to get the code with the Linux specific changes

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 21-11-2003 00:55 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#41 Report this post to a moderator
Support Apolyton

quote:
Originally posted by Joss
Is their now a way to get the code with the Linux specific changes


Hi Joss,

I have setup a private CVS server with the linux code. If you have agreed to the EULA, email me and I will give you an account.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 21-11-2003 01:38
Edit/Delete Message Reply w/Quote
#42 Report this post to a moderator
Help yourself to an AD-FREE life

Have you actually got the cvs code to build under linux? I found tons of things that wouldn't compile - that GUID thing above, several function calls with the wrong # of args, stuff like that.

Plus there are so many filenames with the wrong case - I guess it doesn't matter if you have the code on a FAT partition though.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 21-11-2003 01:46
Edit/Delete Message Reply w/Quote
#43 Report this post to a moderator
Get a bigger avatar today!

So, I'd like to fix the filename case, but we need to decide on a consistent standard. I think that going with Activision's original intent is the simplest.

It looks like most of the time activision intended to use mixed case (FileName.cpp, etc), but then they got lazy.

Some modules however, it seems they intended to use lowercase only - ui/aui_*, for example.

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 21-11-2003 03:42
Edit/Delete Message Reply w/Quote
#44 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by btb
Have you actually got the cvs code to build under linux? I found tons of things that wouldn't compile - that GUID thing above, several function calls with the wrong # of args, stuff like that.

Plus there are so many filenames with the wrong case - I guess it doesn't matter if you have the code on a FAT partition though.


Well, no we havent got it to compile yet, otherwise we wouldnt be working on it

The makefiles: dbgen.mk Crater.mk fault.mk geometric.mk Plasma1.mk Plasma2.mk ctp.mk and ui.mk _will_ (well _should_) compile for now, the others, especially gfx.mk gs.mk ai.mk robot.mk and net.mk will only compile to a certain point and then exit with error messages, which need to be fixed without breaking to much.

The problem with the filenames with wrong cases was fixed rather _quick_ until now: If a file did not find an include because of case errors, the right filename would be given in that file and the include would happily keep its filename....

BTW: Does anybody know if there is a unix equivalent to "_splitpath" as this function seems to be windows only? (It basically splits up the filename to its components, like Drive, Path, Extension...). If not I guess I'll have to write some replacement code for it.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 21-11-2003 04:11
Edit/Delete Message Reply w/Quote
#45 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

bfennema said he had an executable built, with SDL for sound... perhaps he simply meant he had built it under windows, and replaced the sound code with SDL.

d2x has a splitpath function:
http://cvs.icculus.org/cgi-bin/view....viewcvs-markup
I don't know how accurate it is, but it works for d2x.

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 21-11-2003 04:20 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#46 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by btb
So, I'd like to fix the filename case, but we need to decide on a consistent standard. I think that going with Activision's original intent is the simplest.

It looks like most of the time activision intended to use mixed case (FileName.cpp, etc), but then they got lazy.

Some modules however, it seems they intended to use lowercase only - ui/aui_*, for example.


Hi Brad,

Yea, this should be fixed properly. What I have been doing is changing the filenames in code and not renaming the files on disk. So I don't have do cvs delete and cvs add the renamed file (btw, is there a better way to do this?)

I put a script in the linux dir called fixcase.sh to make this a little easier.

Although I agree that calling the filename the same as the class it defines is good style.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 21-11-2003 05:05
Edit/Delete Message Reply w/Quote
#47 Report this post to a moderator
Remove this text

I think that if you have access to the cvs repository, you can just rename the files directly, and then it'll be as if it had always been that way. It's been a long time since I tried anything like that though.

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 25-11-2003 03:10
Edit/Delete Message Reply w/Quote
#48 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Uh oh, I got a problem here...

in gfx/spritesys/Sprite.cpp there are calls of some dirty MS Function called _msize, which returns the size of the allocated memory to a pointer.

A search on the internet with "_msize" and "gcc" mainly returned things like this:

foo = _msize(bar);
/* not portable to gcc */


does anybody know how to replace that function? Or else I'll have to figure out, what memory is allocated and somehow store this in a new variable.

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 25-11-2003 04:07
Edit/Delete Message Reply w/Quote
#49 Report this post to a moderator
Support Apolyton or Terrorists Win

I saw that too. I _think_ we can get away with using the (unsupported, undocumented, unportable) function malloc_usable_size()

i.e. just do:
#ifdef __GNUC__
# define _msize malloc_usable_size
#endif

teknomage1 is offline teknomage1
Settler

Nov 2003
time: 05:31
  Old Post 26-11-2003 21:07
Edit/Delete Message Reply w/Quote
#50 Report this post to a moderator
Tired of ads?

for anyone doing some dev work in windows while trying to understand the code, http://unxutils.sourceforge.net/ has win32 ports of most of the good unix commandline tools. And there's a port of GVIM for windows also at vim.org

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 27-11-2003 03:17
Edit/Delete Message Reply w/Quote
#51 Report this post to a moderator
Lose 30 kilos (of popups)

quote:
Originally posted by teknomage1
for anyone doing some dev work in windows while trying to understand the code, http://unxutils.sourceforge.net/ has win32 ports of most of the good unix commandline tools. And there's a port of GVIM for windows also at vim.org


Erm, this is the linux port thread. Kinda hard to port a game to linux if you're working in windows...Therefore i dont think we need win32 ports of commandline tools or editors. Go post in a windows thread, they might need those tools, or post in this thread and add something constructive.

quote:

I saw that too. I _think_ we can get away with using the (unsupported, undocumented, unportable) function malloc_usable_size()

i.e. just do:
#ifdef __GNUC__
# define _msize malloc_usable_size
#endif


So were replacing a dirty win32 hack with a dirty glibc hack
Anyway, it compiles and we have to test whether this works. (I have a bad feeling, that there we will need some extensive debugging once we get a binary)

teknomage1 is offline teknomage1
Settler

Nov 2003
time: 05:31
  Old Post 27-11-2003 04:50
Edit/Delete Message Reply w/Quote
#52 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

I realize you're porting it to linux dude. I just didn't realize how far you'd gotten from what I understood it folks were still trying the grok the code...ungrateful..blah.
-----------------------------------------------------------------
posted from Gentoo Linux running 2.6.0-test10-mm4

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 27-11-2003 23:29 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#53 Report this post to a moderator
enums Support Apolyton

This is how I propose we handle enums. Just so we're all on the same page.




If you see

enum C3DIR {
C3DIR_DIRECT = -1,
...
};

change it to

typedef sint32 C3DIR;
enum C3DIR_enum {
C3DIR_DIRECT = -1,
...
};




If you see

enum C3DIR;

change it to

typedef sint32 C3DIR;




The compiler can promote C3DIR_DIRECT to a sint32 without any trouble.

Mike

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 28-11-2003 00:10 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#54 Report this post to a moderator
Re: enums Support Apolyton buy from Amazon

quote:
Originally posted by closms
This is how I propose we handle enums. Just so we're all on the same page.


Grrr.. Of course there is a problem with this already. If all enums are now sint32's then operator overloading won't work. ie

Player::FindAgreement(const PLAYER_INDEX otherParty)
Player::FindAgreement(const AGREEMENT_TYPE agreement)

used to work, but now doesn't. I'm going to chnage it to

Player::FindAgreementPI(const PLAYER_INDEX otherParty)
Player::FindAgreementAT(const AGREEMENT_TYPE agreement)

for now. Ideas??

Mike

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 28-11-2003 20:06
Edit/Delete Message Reply w/Quote
#55 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

I am suddenly missing a file "lin_compat.h". I guess somebody made that file and forgot to add it to the cvs. So if the maker could add that file I would be happy

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 02-12-2003 03:51 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#56 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

quote:
Originally posted by uppi
I am suddenly missing a file "lin_compat.h".


Done.

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 07-12-2003 10:48 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#57 Report this post to a moderator
Suffering from ads?

Anyone else notice that the networking code uses the anet library. And we have a dll but no source. I guess we can cut multiplayer support for now. Any chance we can get this source code or at least a linux .so?

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 07-12-2003 20:10 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#58 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by closms
Anyone else notice that the networking code uses the anet library. And we have a dll but no source. I guess we can cut multiplayer support for now. Any chance we can get this source code or at least a linux .so?


Probably it is the same library as used in CTP1 and as there is a linux version of CTP1 there should such a file, but I can remember that we found something about it in the internet maybe but I am not sure the source code was also there.

-Martin

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 10-12-2003 04:41 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#59 Report this post to a moderator
Get a bigger avatar today!

quote:
Originally posted by Martin Gühmann


but I can remember that we found something about it in the internet maybe but I am not sure the source code was also there.

-Martin



Yep. Here it is. Thanks Martin.

http://www.kegel.com/anet/

btb is offline btb
Settler

Nov 2003
time: 05:31
  Old Post 10-12-2003 05:46
Edit/Delete Message Reply w/Quote
#60 Report this post to a moderator
Tired of ads?

Wow, it's LGPL even. Of course, normally integration of LGPL software would not be possible, since it's incompatible with the ctp2 license... In this case, though, since it's the same library Activision used originally, we wouldn't be actually creating a "derived work".

 
Pages (5): [ 1   2   3   4   5   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:31.
Apolyton Time is 00:31.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0547 seconds (90.49% PHP - 9.51% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net