Silly me. MapPointData in IMapPointData has a z component. I'm going to rename it to MapPointData3Originally posted by closms
Anyone know why struct MapPointData and struct TileUtility are defined twice?
Mike

Anyone know why struct MapPointData and struct TileUtility are defined twice? Once in gs/outcom/IMapPointData.h and once in gs/world/MapPoint.h
The only difference is the size of the map points. 16 bits in IMapPointData.h (plus padding).
Mike

Silly me. MapPointData in IMapPointData has a z component. I'm going to rename it to MapPointData3Originally posted by closms
Anyone know why struct MapPointData and struct TileUtility are defined twice?
Mike

The one with a z component is probably a leftover of CTP1, where it was used for the space layer.

Glad to see you around closms
BTW, could you email me with the CVS server address and an active account so I can log in?

Hi,
i'd also to help out with the linux port, although my time is quite limited until end of march...
Here comes a short description about me as on sign up thread:
SECTION: programming, coder, linux port
COMPILER: gcc 3.3.2
BACKGROUND: about 6 years experience in c++, 4 years using gnu tools (e.g. autoconf, automake, libtool, make, etc.)
AVAILABILITY: pending, quite limited until end of march (a few hours per weekend until then)
areas of interest: native linux port
Well, another dreaming would be keeping the codebase of the windows and linux port in sync, forming a multiplatform build.
By having same codebase, we could ensure compability for savegames and multiplayer code (e.g. by common use of sdl, openal, and anet and using #ifdef conditionals for the hopefully rare cases where os dependent code needs to be used).
Well, a few questions are open, though:
What tools are intended for use despite make, gcc, sdl, anet and openal (those i found mentioned within the threads)?
Are there any coding guidelines (e.g. style, naming, etc.)?
Is e.g. the use of autoconf/automake/libtool planned, or do we kiss by using plain gnu Makefiles and selecting simplicity over portability/configurability?
Well, i'd be happy if i got a cvs account to introduce myself to the current source changes, but i'd even be glad if we get it running on linux...
Ciao
Holger

Hi,
with strict aliasing, type punning (sharing one adress among different typed references) gives warnings when using gcc 3.3. This applies also e.g. to (void **)
casts of references to references of any non-void type.
Together with -Werror, compile of anet fails.
Additionally, gcc3.3 does not like strings which do not end in the same line.
The patch below fixes those problems:
- typeref changed to voidref, where typeref was not needed
- where typeref is needed, voidref was introduced as a temporary and the reference to that voidref was passed
- strings were corrected to end in the same line
Ciao
Holger

Hi Keygen,Originally posted by Keygen
BTW, could you email me with the CVS server address and an active account so I can log in?
I sent you the info to get on the cvs server a while back. Haven't heard anything, just want to make sure that you got it.
Mike

closms, I haven't received anything yet.
Try marc13@otenet.gr if not already.

e-mail me the cvs server address.

Hi killertux. I'm glad to see more interest in the linux port.Originally posted by killertux
e-mail me the cvs server address.You need to download the original source distribution (the .exe file) and use wine to unpack it so you can agree to the EULA. After you've done that send me an email (closson@cs.ualberta.ca) and I'll set you up with an account.
Mike

Hi,
i have done some tests on the mm-concept i wrote and implemented a few test classes. After it was ready i noticed a big issue:
If you pass the pointer of a superclass of a class to a method, it does AddRef() and Release correctly. But when it comes to destruction of the object, only the destructor of the superclass and its superclasses is called. I realized it when i finally got the plugin system working, using a superclass CTP2Plugin for returning loaded plugin instances.![]()
So i restarted implementation with a similar scheme (abstract classes as interfaces, statically compiled in type ids).
Here is a test program which shows how interfaces can be used (similar to com or any other object model):
There will be a global factory pointer theC2PluginFactory, which can be used to create instances of registered classes, mainly plugins. It will replace the C2Factory without notice; C2PluginFactory will also be able to load classes from plugins. It will be initialized when main() is entered and destroyed when the program terminates.Code:#include "ctp2_config.h" #include "ctp2_os_types.h" #include "IC2Interface.hpp" #include "IC2Test.hpp" #include "C2Factory.hpp" #includeint main(int argc, char **argv) { IC2Factory *factory = new C2Factory(); IC2Interface *iface = 0; C2FactoryStatus fst = factory->createInstance(C2CID_C2Test, &iface); if (factory_OK == fst) { void *obj = 0; C2IQueryStatus ist = iface->QueryInterface(C2IID_IC2Test, &obj); if (qst_OK == ist) { IC2Test *test = (IC2Test *) obj; test->test(); iface->Release(); } iface->Release(); } std::cout << "Test" << std::endl; delete factory; factory = 0; return 0; }
A plugin will contain the following C functions and must have a corresponding C2ClassId with creation code statically implemented within C2PluginFactory::createInstance().
The following picture contains a prerelease of the corresponding interface design (hope it is in sync with its implementation so far),Code:IC2Interface ctp2plugin_create_instance(IC2PluginFactory *caller, void *data); void ctp2plugin_delete_instance(IC2Interface *instance); const C2ClassID ctp2plugin_get_classid(); const char *ctp2plugin_get_upn();
including the first interfaces (mapgen plugins) to implement next.
Not interfaced classes (i.e. classes not derived from abstract classes) will use a simple new/delete mechanism as suggested by Fromafar. When the plugin loading mechanism is reimplemented, too, i'll commit the changes to cvs, and start with adapting mapgen to that and getting things to compile.
Ciao
Holger
PS: Image is a zipped png, upload failed due to image size (916x647).

Hi Holger, this looks great!Originally posted by ctplinuxfan
Hi,
i have done some tests on the mm-concept i wrote and implemented a few test classes. .....Please keep in mind that we would like to merge the windows version and the linux version someday, so anything to make that easier is encouraged.
I'm not a COM expert, so I trust you know what you're doing.
Mike

Hi,
the basics of the com replacement are implemented, i named it c2om...
The replacement supports components linked to the executable and components as shared libraries.
The changes made in branch com_rewrite_alpha so far:
* Added base/* (factory + id constants headers + stub plugin header)
* Added config/* autoconf related stuff
* Added include/* common headers for os related stuff
* Added test/base/* test cases for c2om
I needed to rename ctpdb.y to ctpdb_yacc.y and ctpdb.l to ctpdb_lex.l to resolve naming conflicts within autoconf. Perhaps the same needs to be done for the slic parser.
Beyond that, the following parts are autoconfed and compile:
* base
* mapgen
* gs/dbgen
* test/base
So theoretically, we have working map plugins. The rest needs to be autoconfd, too.
One ugly thing is the build dependency tree: You cannot simply make a whole subdir, but have to jump back and forth.
For now i thought of removing the SUBDIRS entry within Makefile.am and running make -C dir for the needed targets, if dir does not fit into a sequential run through all subdirectories.
Ciao
Holger
PS: Ah, making under linux: first change to ctp2_code, then run:
config/bootstrap && ./configure && make
Plugin mechanism changed (forgot the argument parameters).
Function prototypes are in base/ctp2plugin_prototype.h
I made smaller changes to the base framework (changing most arguments to const references, because calls then need no stack copies and code runs faster).Code:const C2FactoryStatus ctp2plugin_create_instance( class IC2Interface **iface, class IC2PluginFactory *pf, const uint32 argc, void **argv); void ctp2plugin_delete_instance(class IC2Interface *iface); const C2ClassID ctp2plugin_get_classid(); const char * ctp2plugin_get_upn();
The IC2Factory derives from IC2Interface now (because a plugin containing multiple components needs to pass a creation factory with ctp2plugin_createInstance(...)).
Attached the changes to the base interfaces.

Hi,
i just added sdl sound implementation to civctp, leaving cdrom volume open (on linux possibly an ioctl SOUND_MIXER_WRITE_CD, on windows: don't know).
So SDL sound and music (cdrom) works under windows and the sound stuff compiles at least under linux...
Ciao
Holger
PS: Changes to the related files between activision code, linux code and the sdl addition got already merged into cvs.
I might be busy for a moment; as soon as i can spend some time i'll merge the plugin replacement into HEAD (hope i need not to merge between 4 revisions like it was the case for sdl implementation)

Hello All,
Well, I guess you could say that the first milestone has been reached. All the code now compiles!
I'm working on getting a binary built, as far as a know, these are the issues relating to that.
1. For calls to windows specific code, do we reimplement, or use wine.
2. You can't pass non-pod (Plain Old Data) data types to a variable length argument list function. So I guess the most straight forward way is to pass a pointer to the object.
3. SDL classes for graphics and sound (thanks to Holger!)
btw, gcc v3.0 _cannot_ compile some of the stl code in ctp2. I'm using gcc 3.2.2.
Also, Johannes Sixt has been working by himself on porting this to linux as well. He can start the game, create cities, etc. Excellent work! We sent me a patch against the original source. I will drop the patch into cvs (I probably won't apply it). Soto Johannes!
Mike

Hello All,
The department has put up a firewall, port 2401, the cvspserver port, is blocked. However, the ssh port (22) is still open. So to access the cvs server use the following CVSROOT
my CVSROOT would be
CVSROOT=':ext:mike@setup23a.cs.ualberta.ca:/home/cvsroot'
CVS_RSH=ssh
export CVSROOT CVS_RSH
You will have to send me a ssh public key for this to work.
Mike

Hi,
How can i get cvs access (read only) to take a look at the actual status of the port.
Cu

Let's make a sourceforge acct for this.
There will be webspace.. CVS.. an infrastructure all in place, all for free.

Sourceforge only allows projects using the GPL, so you can't do that.

It allows any open source-type licenses.
You just have to specify which, or upload your own.

Yes, you're right - I misremembered. Still, I'm fairly sure our license is incompatible with any open source license (although nothing in the OSI definition is obviously in conflict with it, certainly the Activision license is strongly against the spirit of open source).

The CtP2 source code is not open-source (for one thing, the license does not allow for the completely free and unrestrictred distribution of code or derived products), hence SourceForge is not an option.

Has anyone made some contacts to get an updated license? The Jagged Alliance 2 source was recently released, and they had a *much* more reasonable redistribution license (not a EULA) -- non-commercial purposes only, and a clause that entitles the copyright holders to any modifications that you distribute. Neither of those are show-stoppers for a commercial game's source release. The CTP2 license, OTOH, has numerous showstoppers that make spending any time improving the code an undesirable proposal for a number of people.
It really doesn't matter that Activision has said "Oh, we really didn't mean *that*", because it is likely that they will change their interpretation at some point in the future as soon as somebody does something that they happen not to like. If they really mean it (regarding CVS and porting to linux, etc), then they need to publish the necessary exceptions/updates to the license in writing.
http://lists.debian.org/debian-legal.../msg00335.html

Can anybody tell me how do you get g++ version 3.3 I think to compile the tech_wllist.h, I just put the file into a test.cpp and I get this error message:
I hoped to get with g++ a more usable error message then with .NET, it looks like M$ started to respect the standart.Code:$ c++ test.cpp -o test In file included from test.cpp:1: tech_wllist.h:233: warning: `tech_WLList::Link' is implicitly a typename tech_wllist.h:233: warning: implicit typename is deprecated, please see the documentation for details tech_wllist.h: In member function `long unsigned int tech_WLList ::RemoveDuplicates()': tech_wllist.h:495: error: parse error before `=' token tech_wllist.h:502: error: parse error before `=' token
The offending code is:
Link is defined as nested struct in tech_Whilst and looks like this:Code:template< class T > tech_WLList< T >::Link *tech_WLList< T >::NewLink( Link *pPrevLink, Link *pNextLink ) { Link *pNewLink = m_memory->New(); if ( pNewLink ) { pNewLink->pPrev = pPrevLink; pNewLink->pNext = pNextLink; m_length++; } return pNewLink; }
T is a template argument of the tech_Wllist struct:Code:protected: struct Link { Link *pPrev; Link *pNext; T element; }; Link *NewLink( Link *pPrevLink, Link *pNextLink );
-MartinCode:template< class T > class tech_WLList {
Civ2 military advisor: "No complaints, Sir!"

Hi Martin,Originally posted by Martin Gühmann
Can anybody tell me how do you get g++ version 3.3 I think to compile the tech_wllist.h, I just put the file into a test.cpp and I get this error message:
Try this
Code:template< class T > typename tech_WLList< T >::Link *tech_WLList< T >::NewLink( Link *pPrevLink, Link *pNextLink ) { Link *pNewLink = m_memory->New(); if ( pNewLink ) { pNewLink->pPrev = pPrevLink; pNewLink->pNext = pNextLink; m_length++; } return pNewLink; }
Mike

Thanks Mike this works.
-Martin
Civ2 military advisor: "No complaints, Sir!"

So, can I, as a completely dumb Linux user, have some hints on this one? Is there a current zip with files that need to be changed in order for this to compile under Linux? Also, I don't think that you compiled the files one by one using gcc, right, there must be a better way?
Solver, WePlayCiv Co-Administrator
Contact: solver-at-weplayciv-dot-com
I can kill you whenever I please... but not today. - The Cigarette Smoking Man

For now, the somehow playable version is just the patch by Johannes Sixt; however, the original-cd check has not been ported, yet.Originally posted by Solver
So, can I, as a completely dumb Linux user, have some hints on this one? Is there a current zip with files that need to be changed in order for this to compile under Linux?
For this reaason i think the patch hasn't been posted yet, but i could post the sources with the patch applied, if you wish so.
There are quite some things left which do not work, though playing with the mouse is possible.
Due to / as a file seperator, the configuration files also need to be fixed.
As CTP2 doesn't use uniquely cased filenames, easiest way to get it running is to copy an installation of CTP2 onto a fat32 partition (alternative: rename all files in installation which could not be found to correct cased filename).
I will set up a few subversion repositories soon, to begin merging the sources.
Unfortunately i do not have all files of the Altered source files thread, so most commits to the apolyton branch will be based on an ALL patch file. Once the apolyton branch is on sync with the latest posts, i will start merging the cvs repository to the apolyton branch and provide merged files for reintegration to the Apolyton code line. The merges will also be commited to cvs.
Perhaps now/some day apolyton runs/will run apache2 for the forums; then its possible to integrate the subversion repository on the apolyton site.
You can use make and a Makefile to automate build process, or use autoconf/automake for a more portable build system, first is used in cvs, second in johannes sixt's patch.Also, I don't think that you compiled the files one by one using gcc, right, there must be a better way?
Below is a screenshot of the current version, at the beginning of a game (zip file, because forum doesn't like images bigger than 800x0) ...

Screenie looks good. I'll guess that most of us will have to wait for some good patch posted, or indeed a nice repository.
In the meanwhile, I would do good to read up on Linux programming a bit...
Solver, WePlayCiv Co-Administrator
Contact: solver-at-weplayciv-dot-com
I can kill you whenever I please... but not today. - The Cigarette Smoking Man

Hi,
Im wonder if anyone is still working on a linux port, and where to get the few pathes for it. I would be happy to contribute to a linux port.
Cya
Bookmarks