Announcement

Collapse
No announcement yet.

COMPILE: Linux Port

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How complete/stable is the Linux port, and how dependent is on the base system being "Linux"?

    I use and develop for BeOS, and as I'm currently off work for reasons beyond my control and getting slowly insane, and have effectively "finished" the commercial Civ:CTP port for BeOS about thirty times, I've decided to look in to hacking this over. However theres not much point if the core Linux port isn't up to it...

    Effectively, what graphics/sound/input systems is it using? I've got the source checking out now, but BeOS is -exceptionally- slow at SVN compared to other OS's so it'll be "a while".

    Comment


    • SDL is used for graphics and audio. I'm still poking around at the source and going 'hmmm' a lot.

      I think that after this weekend is over I'm going to start again with the current trunk branch, and use the Linux branch as a guide for reapplying the necessary code to get it to play nicely with Linux. I think that way will be much easier than the other way round...
      Tea: there is nothing it cannot fix.

      Comment


      • Righty, I'll still give one quick stab at the current one... from looking over some of the posts here, seems I might have trouble getting the CD stuff working though - or does it use SDL's CDROM interface? I think that works on BeOS..

        For the OS SDL was developed for it has patchy support of a lot of 1.2 features!

        Comment


        • I haven't got that far into my study of the code

          It's going to take me a few weeks to get things back in sync, so using the existing branch is probably a very good idea.
          Tea: there is nothing it cannot fix.

          Comment


          • goo d luck guys. Also try contacting this guy:



            since he posted recently and seemed interested
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • Originally posted by RichardH
              [...] it might be easier (again, as discussed above) to start again with the trunk and re-apply all the linux specific changes to it to recreate the linux branch...
              Considering the number of changes on both, it certainly will be much less work to reapply the linux changes to the trunk.

              Hopefully, you don't even have to redo everything, as we have merged (shamelessly stolen ) some of the work from the linux branch back into the trunk. Don't be surprised when a couple of changes in revisions 671 and 672 look very familiar.

              Comment


              • It does indeed use the SDL CD-ROM interface.

                Comment


                • Hallo!

                  I incidentally stumbled over this ctp2 linux port project. First I couldn't belief that I never had heard of it before but when reading through the thread I noticed it's quite challenging still.
                  Well putting all bits and pieces of info together I managed to compile ctp2 and now I'm getting to the point where the map is generated but then it segfaults. From gdb:

                  [New Thread -1247597648 (LWP 2516)]

                  Program received signal SIGSEGV, Segmentation fault.
                  [Switching to Thread -1217202512 (LWP 2510)]
                  0x080abecf in aui_BitmapFont::SetPointSize (this=0x0, pointSize=9) at ui/aui_common/aui_bitmapfont.cpp:342
                  342 if (pointSize > 0 && m_pointSize == pointSize)
                  (gdb) continue
                  Continuing.
                  [Thread -1247597648 (zombie) exited]
                  PeepEvents failed:
                  [Thread -1227928656 (zombie) exited]
                  PeepEvents failed:
                  PeepEvents failed:
                  PeepEvents failed:
                  PeepEvents failed:

                  Program received signal SIGSEGV, Segmentation fault.
                  0x080abecf in aui_BitmapFont::SetPointSize (this=0x0, pointSize=9) at ui/aui_common/aui_bitmapfont.cpp:342
                  342 if (pointSize > 0 && m_pointSize == pointSize)
                  (gdb)

                  I had a look in that file and only thing I found strange is that it accepts just one arg and gdb has two this=0x0 and pointSize, if I'm not mistaken. Can anybody give me an intro how to go on with gdb debugging?
                  Special about my install is that it is patched together with the instructions in doc/README.linux and those in this thread. Just modifing userprofile.txt to have "RuleSets=../../ctp2_data/;/windows/C/Programme/Activision/CTP2/ctp2_data/" didn't work:

                  lynx@drago:~/sda1/ctp2/ctp2_code/ctp$ ../ctp2 nointromovie
                  Invalid argument: Invalid argument
                  Messagebox(Paths Error): 'ancient.ldl' not found in asset tree.

                  Continue?
                  /media/sda1/home/lynx/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:47: syntax error
                  Messagebox(LDL Error): /media/sda1/home/lynx/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:47: syntax error

                  Continue?
                  Segmentation fault
                  lynx@drago:~/sda1/ctp2/ctp2_code/ctp$ find ~/sda1/ctp2/ -name ancient.ldl
                  /home/lynx/sda1/ctp2/ctp2_data/italian/uidata/layouts/ancient.ldl
                  /home/lynx/sda1/ctp2/ctp2_data/spanish/uidata/layouts/ancient.ldl
                  /home/lynx/sda1/ctp2/ctp2_data/german/uidata/layouts/ancient.ldl

                  Is it necessary to change the map .dll extentions to .so, too?
                  Finally: What should I use of svn trunk/ or branch/linux/?
                  Is there a way to get civlang.ctp in English? The CD I got off eBay sadly is in German and sounds awful:-(

                  Thanks for any help.
                  Lynx

                  Comment


                  • Back already.
                    I found the cause of "'ancient.ldl' not found in asset tree."
                    In civpaths.txt english has to be changed to german for a German CD. Otherwise it wont look in ctp2_data/german/ and there is no ancient.ldl in english or default.

                    Comment


                    • Originally posted by lynx_abraxas
                      I incidentally stumbled over this ctp2 linux port project. First I couldn't belief that I never had heard of it before but when reading through the thread I noticed it's quite challenging still.
                      Well putting all bits and pieces of info together I managed to compile ctp2 and now I'm getting to the point where the map is generated but then it segfaults. From gdb:

                      [New Thread -1247597648 (LWP 2516)]

                      Program received signal SIGSEGV, Segmentation fault.
                      [Switching to Thread -1217202512 (LWP 2510)]
                      0x080abecf in aui_BitmapFont::SetPointSize (this=0x0, pointSize=9) at ui/aui_common/aui_bitmapfont.cpp:342
                      This function should not be called with this=0x0; when gdb catches the segfault, you can go up the stack (with the 'up' command) and see where it was being called from. Probably this method is being called on a NULL pointer, which it shouldn't be.

                      Comment


                      • OK, got it. arialbd.ttf is needed here. So one needs at least arial.ttf arialbd.ttf times.ttf timesbd.ttf in ctp2_data/default/uidata/fonts/

                        Comment


                        • Got further. There is a lacking NULL-pointer check I introduced and now I can play along. All managers work except the science one, saving game, game settings and realoding works as well, setteling, building units and tile improvements are no problem, music plays nicely.
                          I noticed the tiles not in fog of war have this black shadow. What's it ment doing? The Cities have a second number, is that saying something? The unit sprites are not always visible. Is there a reason the window is 800x600?

                          Comment


                          • Last report this night:
                            If map is zoomed out to show more tiles the terrain blending works everywhere.
                            My problem is now:

                            ScienceManagementDialog.cpp L546: item1->GetUserData() 7

                            Program received signal SIGSEGV, Segmentation fault.
                            [Switching to Thread -1217038672 (LWP 17624)]
                            0x08268d8c in ScienceManagementDialog::CompareAdvance (item1=0x9f3efa8, item2=0x9f4bd60, column=0)
                            at ui/interface/ScienceManagementDialog.cpp:548
                            548 *reinterpret_cast(item1->GetUserData()));


                            I have put a line in ScienceManagementDialog.cpp before 548:
                            printf("ScienceManagementDialog.cpp L546: item1->GetUserData() %d\n", (item1->GetUserData()));
                            Wich works well as long as I don't put *reinterpret_cast before (item1->GetUserData()).
                            Any ideas? I haven't seen a construct like this before. How can I find the definition of it in the code? It seems to work a few lines above in that file on (cookie).

                            Good night

                            Comment


                            • Can you tell us which (base line) revision you are using? Line numbers in files do not mean very much without this information. And you may have to hand-edit your post to prevent text between < and > to become interpreted as html commands. Without this, we have to guess what you are reinterpret-casting to.

                              IIRC, this was a problem with an attempt to make the code compile under linux. The original code stores - in this case the database index of an advance - a plain int (cast to a void *) in the user data when creating the list items. After retrieving it with GetUserData, it is not a particularly good idea to dereference this index (after reinterpret_cast) as a pointer.

                              Comment


                              • Thanks for the answer. Kind of solved it. I just removed the two '*' in *reinterpret_cast<sint32 *>(item1->GetUserData()). If "a plain int (cast to a void *)" is returned by GetUserData() this should be just casted to int, not to a pointer of int and then dereferenced. I'm not absolutle happy with this as I can't say I truely understood this. I got stuck going backwards in the calling sequences that lead to ScienceManagementDialog::CompareAdvance. I got as far as ui/aui_ctp2/ctp2_listbox.cpp. There is the function ctp2_ListBox::SortByColumn which uses m_pane in an initialised state. But it is not initialised in the ctp2_listbox.cpp itself. I assume it must be initialised by the constructors of the parent classes.
                                Do You know a trick to step back quicker to the point where I would have seen that the void* actually is an int?
                                I also wonder: Isn't it dangerouse to do the cast in first place because sizeof(int) must not equal sizeof(void*)???
                                I'm working on:

                                svn info
                                Path: .
                                URL: http://ctp2.darkdust.net/anonsvn/branches/linux
                                Repository Root: http://ctp2.darkdust.net/anonsvn
                                Repository UUID: 34d2fc0c-33df-0310-8a34-85f8040ba873
                                Revision: 704
                                Node Kind: directory
                                Schedule: normal
                                Last Changed Author: richardh
                                Last Changed Rev: 670
                                Last Changed Date: 2007-01-07 19:22:40 +0100 (So, 07 Jan 2007)
                                Properties Last Updated: 2007-03-01 09:51:01 +0100 (Do, 01 Mär 2007)

                                So base line would 670, or 704???

                                Comment

                                Working...
                                X