Announcement

Collapse
No announcement yet.

COMPILE: Linux Port

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

  • #31
    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:

    Note that this doesn't touch the mixer of your sound card, it changes the volume internally on the drive itself.

    Comment


    • #32
      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:

      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, ....

      Comment


      • #33
        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

        Comment


        • #34
          Activision have mentioned that we are, after all, allowed to use a CVS...
          Solver, WePlayCiv Co-Administrator
          Contact: solver-at-weplayciv-dot-com
          I can kill you whenever I please... but not today. - The Cigarette Smoking Man

          Comment


          • #35
            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.

            Comment


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

              Comment


              • #37
                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.

                Comment


                • #38
                  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.

                  Comment


                  • #39
                    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 .

                    Comment


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

                      Comment


                      • #41
                        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.

                        Comment


                        • #42
                          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.

                          Comment


                          • #43
                            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.

                            Comment


                            • #44
                              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.

                              Comment


                              • #45
                                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:

                                I don't know how accurate it is, but it works for d2x.

                                Comment

                                Working...
                                X