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 > Natively porting civctp/A brief summary
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    < Last Thread     Next Thread > Post New Thread     Post A Reply
ctplinuxfan is offline ctplinuxfan
Warlord

Jan 2004
time: 06:33
  Old Post 14-01-2004 18:57
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Natively porting civctp/A brief summary Support Apolyton, buy Galactic Civilizations

Hi,

i have had a brief look at the source; for porting civctp2 (I'd like to concentrate on linux and perhaps on generic portability stuff), there is quite some work to be done.

So far i read about port wishes to linux and macos x in this forum.

I sorted by complexity of the problem (most complex problem first).

1. getting rid of COM:
COM is a proprietary component framework by microsoft used heavily within the source. It is unportable to other platforms than windows and COM-based applications are known to even cause heavy problems under wine (don't run, random crashes, etc.).

If we want to keep a component based architecture, a replacement for COM has to be found. These options apply:
a) another portable component framework with compatible licence
b) reducing to some sort of contract programming (note: we'd need rtti for dynamic_casts which reduces portability heavily)
c) using no component framework at all

For a) i just have heard of XPCOM and UNO so far. Licensing would need checking.

For b), we'd need some design; clean handling of references often is a problem.

For c) and plugin handling of the mapsgen, a simple solution would be an abstract class defining a plugins interfaces, where each plugins impl has a c creation function which creates a new instance of the implementation.

I hope we don't need a component framework or somebody has an alternative we may choose.

2. porting DirectX calls:
DirectX replacement by SDL has already be discussed. On windows, still DirectX would be needed, because SDL calls the host systems native functions.

3. porting sound calls:
As discussed, the miless calls would need to be ported to sdl and maybe openal.

4. porting system specific stuff:
a) First of all, shared libraries handling can get rather complex:
Using shared libraries across platforms.

Libtool provides solutions for most of these problems; within libtool ltdl provides is an interface which abstracts accessing shared libs from within your programs (both LGPL).

That way, linux, macos x and windows shared library handling would be adressed.
For cygwin, we may need dlltool, but i'm not sure about this.

b) Other system related stuff:
For supporting other platforms than linux and windows on x86 (e.g. ppc), using autoconf/automake would ease things a lot.

Both are under GPL. Distributing source of these generators is allowed under the licence of its input, too (i.e. the EULA).

This not only allows a much simplified Makefile handling, but also eases other system dependent stuff a lot (mainly handling conditioned system programming stuff and corresponding headers), though providing a unique configuration mechanism.

I could also work on this part.

See: GPL FAQ
Distributing configure scripts
Distributing Makefile.ins

A very good point to start:
Autobook

5. Writing portable c++ code:
There are several guides, but most of my links are outdated because i learned the part i wanted to know meanwhile.

Still a good point to start is:
Writing portable c++ code.

Ok., i'm not through the source completly, perhaps there's something i missed.

So far i don't know how the linux port progressed. I hope i get access to the modifications soon, so i can start at some point.

Ciao
Holger

kaan is offline kaan
Prince
Aarhus
Mar 2001
time: 05:33
  Old Post 15-01-2004 02:05
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Nice job Holger

i didnt know half of those issues so please continue your good work

Klaus

ctplinuxfan is offline ctplinuxfan
Warlord

Jan 2004
time: 06:33
  Old Post 18-01-2004 23:50
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
update on COM usage Support Apolyton buy from Amazon

Hi,

i completed sighting the source for COM occurences (other than mm related calls to be replaced by sdl),and that's what came out:

COM is mainly used for reference handling.

The only parts where capabilities of components are tested are mapgen and wldgen.
Within all other parts, i see that references to a components implementation are held directly, and even by partly using extern references.

Now the question open is: Is COM used/needed for access through network/external applications (what i can't see in the code)?

If not, this would be a solution getting rid of COM (1.c):
The com bloated code in gs/outcom, robotcom and some minor others could be rewritten using a base class CTP2Object, disposing itself when Release() decremented its refcounter to zero.

Btw. wondering why the robotcom part is not used.


Ciao
Holger

PS: Regarding XP component frameworks/object models
I found nothing compatible with the licence (XPCOM is NPL+MPL+GPL).

ctplinuxfan is offline ctplinuxfan
Warlord

Jan 2004
time: 06:33
  Old Post 25-01-2004 23:52
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Avatar Enlargement: We've got the solution

Hi,

ok, finally the com replacement itself is implemented (for in process components/shared lib components using libtool ltdl).
The info/model is posted at the linux port thread:

Compile: Linux Port

Ciao
Holger

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:33.
Apolyton Time is 00:33.
    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.0425 seconds (86.25% PHP - 13.75% 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