A downstream Linux fork of d2x-xl

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 6:22 pm

Do I have experience with the d2x-xl code? No, not really. I know that. Perhaps that's why I asked a question... Though, I would say that I'm competent in c++ and can grasp a section of even just marginally well written code pretty easily.

The question I asked had nothing to do with the osx port. The file hasn't been touched in two months, and I expect those lines for years.

Different programmers have different priorities. You like to tinker with new features. I like to see some stability and cleanup first. I'll make and keep the cleanup in my fork. You don't have to care. But is it that difficult to answer a question even if you don't care about the warning?

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 6:41 pm

Dang! i don't get it, I'm getting that ulong errors now, same as before, but you put the __macosx__ defign in the pstypes.h.
-------------

I know cmake has tools to build .app bundles, but believe it should be possible to make a bashscript to take the compiled binary, turn it to an .app package, copy the libraries, and relink them relative to the binary using apples command line tools installed with xcode. We can also automatically package it into a compressed dmg with the diskutil command.

Might be worth it. :clue:

Just In case you were curious, an app bundle is just a specific folder structure with a info.plist file naming the executable in MacOS folder, icons, and general registry stuff.

Program.app ->Contents folder -> [info.plist, Resources folder(with icons and program files), Frameworks folder (libraries in .framework), MacOS folder (with executable)]

If you wanted, you could point d2x-xl.app's Resource folder as a place for d2x-xl's files to make a fully unified app bundle. Although the user has to provide all the files and not many mac users know how to right click - open contents. (Amusingly in 30 years, apple never made a mouse that looked like it has more then 1 button, even if it does :))

[edit] just read your post Diedel, I understand, by my count for osx stuff, steel hasn't done much with the actual code, (save the added osx definition in the pstypes.h, which doesn't appear to be working? )
Last edited by darklord42 on Fri Jun 27, 2014 6:53 pm, edited 1 time in total.
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 6:52 pm

Pull the latest and try again. And pretend you didn't see that...

For the app bundle, it should be easy to reuse what's being done for the xcode project. I wouldn't want any difference in the user experience whether they build standalone xcode or a cmake generated project. I'll reference some other projects I know (fs2_open and wxlauncher) to see how they handle that step.

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 7:10 pm

Well xcode handles all that itself. Kinda have to find a scripting way to do it. But yeah, take a look at other projects.
I still like the automated dmg making script. Might do it for myself :)
----
I got a bunch of lpx related linking errors. I thought you were going to set that stuff to just linux.

Code: Select all

Undefined symbols for architecture x86_64:
  "IpxReadUserFile(char const*)", referenced from:
      IpxSetDriver(int)  in netmenu.cpp.o
  "ArchIpxSetDriver(int)", referenced from:
      IpxSetDriver(int)  in netmenu.cpp.o
      NetworkGetIpAddr(bool, bool) in netmenu.cpp.o
  "IpxGetPacketData(unsigned char*)", referenced from:
      NetworkFlush() [clone .part.5] in network.cpp.o
      NetworkListen()     in network.cpp.o
      NetworkWaitForPlayerInfo() [clone .part.10] in network_sync.cpp.o
      NetworkDoBigWait(int)  in network_sync.cpp.o
  "IPXSendPacketData(unsigned char*, int, unsigned char*, unsigned char*, unsigned char*)", referenced from:
      NetworkDoFrame(int, int) in network.cpp.o
      NetworkPing(unsigned char, unsigned char) in network.cpp.o
      NetworkSendPing(unsigned char) in network.cpp.o
      NetworkSendRejoinSync(int, tNetworkSyncData*)  in network_send.cpp.o
      NetworkSendEndLevelSub(int)  in network_send.cpp.o
      NetworkSendEndLevelShortSub(int, int) in network_send.cpp.o
      NetworkSendNetGameUpdate()     in network_send.cpp.o
      ...
  "IpxGetLocalTarget(unsigned char*, unsigned char*, unsigned char*)", referenced from:
      NetworkNewPlayer(tSequencePacket*)      in network_join.cpp.o
      NetworkWelcomePlayer(tSequencePacket*)      in network_join.cpp.o
      NetworkProcessSyncPacket(CNetGameInfo*, int)  in network_read.cpp.o
  "IpxSendGamePacket(unsigned char*, int)", referenced from:
      NetworkDoFrame(int, int) in network.cpp.o
  "IpxHandleLeaveGame()", referenced from:
      AbortPlayerSelection(int)  in netplayerbrowser.cpp.o
      NetworkSelectPlayers(int)  in netplayerbrowser.cpp.o
      NetworkLeaveGame(bool) in network.cpp.o
  "IpxReadNetworkFile(char const*)", referenced from:
      IpxSetDriver(int)  in netmenu.cpp.o
  "IPXSendBroadcastData(unsigned char*, int)", referenced from:
      DownloadPoll(CMenu&, int&, int, int) in autodl.cpp.o
      CDownloadManager::SendRequest(unsigned char, unsigned char, CDownloadManager::tClient*) in autodl.cpp.o
      CDownloadManager::RequestUpload()       in autodl.cpp.o
      CDownloadManager::Poll(CMenu&, int&, int) in autodl.cpp.o
      NetworkSendGameListRequest(int)  in network_send.cpp.o
      NetworkSendAllInfoRequest(char, int) in network_send.cpp.o
      NetworkSendExtraGameInfo(tSequencePacket*)      in network_send.cpp.o
      ...
  "IpxGetMyLocalAddress()", referenced from:
      NetworkInit()     in network_init.cpp.o
      NetworkSendGameListRequest(int)  in network_send.cpp.o
      NetworkSendAllInfoRequest(char, int) in network_send.cpp.o
      NetworkWaitForSync()     in network_sync.cpp.o
  "IPXGeneralPacketReady(ipx_socket_struct*)", referenced from:
      _ipx_udp in udp_interface.cpp.o
  "IpxGetMyServerAddress()", referenced from:
      NetworkInit()     in network_init.cpp.o
      NetworkSendGameListRequest(int)  in network_send.cpp.o
      NetworkSendAllInfoRequest(char, int) in network_send.cpp.o
      NetworkWaitForSync()     in network_sync.cpp.o
  "IpxInitNetGameAuxData(unsigned char*)", referenced from:
      NetworkStartGame()     in network.cpp.o
  "IpxChangeDefaultSocket(unsigned short, int)", referenced from:
      NetworkJoinPoll(CMenu&, int&, int, int) [clone .part.11] in netgamebrowser.cpp.o
      NetworkBrowseGames()     in netgamebrowser.cpp.o
      NetworkMoreGameOptions()     in netmenu.cpp.o
      NetworkGetGameParams(int)  in netmenu.cpp.o
  "IpxHandleNetGameAuxData(unsigned char const*)", referenced from:
      NetworkBrowseGames()     in netgamebrowser.cpp.o
  "IPXSendInternetPacketData(unsigned char*, int, unsigned char*, unsigned char*)", referenced from:
      DownloadPoll(CMenu&, int&, int, int) in autodl.cpp.o
      CDownloadManager::SendRequest(unsigned char, unsigned char, CDownloadManager::tClient*) in autodl.cpp.o
      CDownloadManager::RequestUpload()       in autodl.cpp.o
      CDownloadManager::RequestDownload(CDownloadManager::tClient*) in autodl.cpp.o
      CDownloadManager::ConnectToClient(CDownloadManager::tClient&) in autodl.cpp.o
      CDownloadManager::Poll(CMenu&, int&, int) in autodl.cpp.o
      NetworkWelcomePlayer(tSequencePacket*)      in network_join.cpp.o
      ...
  "IpxInit(int)", referenced from:
      IpxSetDriver(int)  in netmenu.cpp.o
      NetworkGetIpAddr(bool, bool) in netmenu.cpp.o
  "IpxClose()", referenced from:
      MainMenu()    in mainmenu.cpp.o
      IpxSetDriver(int)  in netmenu.cpp.o
      NetworkGetIpAddr(bool, bool) in netmenu.cpp.o
      ExecMultiMenuOption(CMenu&, int) in newgamemenu.cpp.o
  "_ipx_MyAddress", referenced from:
      BuildGameParamsMenu(CMenu&, char*, char*, char*, char*, char*, int) in netmenu.cpp.o
      GameParamsMenu(CMenu&, int&, int&, char*, char*, char*, char*, int&) in netmenu.cpp.o
      UDPGetMyAddress()     in udp_interface.cpp.o
      UDPOpenSocket(ipx_socket_struct*, int)   in udp_interface.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [d2x-xl_8d2f97c] Error 1
make[1]: *** [CMakeFiles/d2x-xl_8d2f97c.dir/all] Error 2
make: *** [all] Error 2
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 7:22 pm

Well, fun. That's not a couple second glance and fix. Doesn't seem all the ipx stuff is ifdefed out. I'll take a look later and see if it can be wrapped in the ipx ifdefs. But most likely, this will have to wait on the xcode person to finish. I'm wondering if that compiles right now. If it does, I'll have to do some digging in that project file to find out how...

For the bundle, I was referring to the icon files and plist and such. Seems they're already there. Just need pulled by a script that generates the bundle.

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 7:27 pm

Oh I see, yup. It would best to see what the state of the code is once everything is finished. Better work :)

odd how it's an ancient, dead and unused network protocol that is giving us all this trouble...
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 8:00 pm

The ipx code is not included in the Linux build. Just omit it.
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 8:04 pm

How? Without the ipx network source files, netmenu and others throw undefined reference errors like in darklord42's post. I'll look at the make files again and see if I missed something.

@darklord42: I just pushed a change. Try that. May error again, but should be on the right track.

Steel01

Edit: looking at the make files and the xcode project, ipx_bsd is the only one not referenced. I'll experiment with pulling it of my branch completely.

Edit 2: So, the native_ipx flag threw me off. I presumed the flag meant the os had ipx support and if it wasn't set, it would use internal code to do ipx. Now, I don't know what it meant. Without that set, is ipx available at all? There's enough other files with those three letters in them.
Darklord42, I updated my fork again. I have better confidence it will compile now.
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 9:38 pm

Well it compiled! Congrats
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 9:55 pm

Great! Now the question is if it is usable... Can you shove the bin into an official app bundle and see what it does? Also, were there any warnings? If so, pastebin the output and I'll clean up my fork.

Okay... Next is the bundle. I might be able to make time tonight. Then again, I might not even want to think about it. Been a long week.

In other news, I'm starting to try and get the project compiling on mingw. I don't think I'll be able to finish it fully on my own, though. Fedora doesn't have mingw SDL_net in the repos. The rest doesn't seem too bad. Just some assumptions in the code that win32 is visual c. Easily fixed in the defines.

Steel01
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 11:51 pm

I am asking myself whether you are blind or something.

The OS X version is not done, and you have no idea about its state of development and what still needs to be done to make it fully work!

This is something I am currently working out with the OS X dev.
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Sat Jun 28, 2014 12:20 am

Is curiousity evil or wrong? Chill, I'm not expecting it to work perfectly. I'm a old school hacker, I tinker with stuff and ask questions. And as y'all fix stuff, I'll continue to merge it in.

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Sat Jun 28, 2014 12:46 am

Diedel no one is blind. I know this all cmake for osx seems needlessly redundant to you, but allow me to put some benefits into a list:

1. Xcode now days can only use Apple's version of Clang which does not yet support OpenMP. And you can not plug in your own compiler. GCC, which can be installed separately, does.
2. Due to Apple's self-imposed limitations, Xcode flatly will not compile for anything older then OS 10.8! You can't hack it to do so. (i've tried) The version old enough to compile for 10.6 will not install on my computer, and if I were to force it, it would render OSX 10.9 unbootable. In reality, we could potentially support intel 64bit 10.6, and all is needed is the 10.6 sdk and a couple compiler flags.
3. A working cmake file able to compile an .app bundle would be in your best interest. Once the groundwork is laid out, it should always continue to work as you work on d2x-xl. It's just a text file and you would always have access to it. Unlike the xcode project which puts you at the mercy of someone else to maintain.
____

@steel01 I don't think the binary is actually usable, It seems to be missing some of the key OSX related code, which we will just have to wait for when they are done. :)

It "starts up" but doesn't do anything i.e. nothing renders, it doesn't put up any errors. I do see a comment in the console about ignoring a fullscreen call because there is no window. The normal popup error when missing data files didn't appear. Plus I doubt it would be able to look for data files in the folder outside the app bundle.

As for putting it into an app bundle, that may be easier said then done. To launch it as part of the cocoa app yields:
Application Specific Information:
abort() called
*** error for object 0x6000001d5188: pointer being realloc'd was not allocated.

to do the bundle bit will take a bit of work. I think what we will have to do in the script is, create the bundle, then compile it into the bundle using @executable_path/../Frameworks as the directory for the libraries. Take a look at how other projects do it. For cmake there is apparently something called BundleUtilities that will do it, but I read it needs the .app setup to already be in place, so that will have to be done by script in the make file or something. [1]
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Sat Jun 28, 2014 1:00 am

Okay, not terribly surprised. I wonder what the last working OSX version was. I think I remember it working at one time, but I didn't care, so didn't pay attention.

wxLauncher for Freespace 2 seems to have the correct idea for the app bundle. Their cmake list file is here (packaging script here). Just need to know which frameworks are being used and I can script it to copy them in. Do you have fs2, darklord42? I'm curious if that wxLauncher dmg works the way this one should. If so, this'll be quite simple.

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Sat Jun 28, 2014 1:14 am

The last working d2x-xl version was the last 1.16 version. I did it through the old xcode file which was in dire need of someone with a professional touch (my setup was amateurish). But Diedel and I got it to work again. :) The code has changed quite a bit since then, not being a coder myself, I have no idea what it would entail to get back to snuff, so I'm really glad someone is on the case.

I don't have fs2o installed right now, I only just got this laptop 4 years old and used. The graphics card is crap as you can see ;) But I can tell you the wxlauncher works just fine. It will be a great model.
Last edited by darklord42 on Sat Jun 28, 2014 1:29 am, edited 2 times in total.
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest