Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Invincible Countermeasure - beta 2 (January 2015)

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Invincible Countermeasure - beta 2 (January 2015)
Peter Hull
Member #1,136
March 2001

Linley: - will do.

Regarding the Linux makefile, I had some problems with Xubuntu (both it and Mint are based on Ubuntu I believe). The libraries had to come after the .o files on the command line, and also they were registered with pkg-config as allegro-5.0 etc. instead of just allegro-5

bamccaig
Member #7,536
July 2006
avatar

Thanks, Peter. Those are the exact problems that I aimed to address with the last set of patches and that pleases me because it means that I was on the right track. Upon further investigation it appears that my fixes had some bugs.

It turns out that Makefiles are sensitive to tab characters even outside of rules. The art of Makefile authoring is still coming to me, obviously. :) In particular, don't use tabs for indentation outside of rules. Or at least, so I gather. This can be somewhat accidental since it basically requires mixed indentation in Makefiles (or else no indentation outside of rules).

The second bug that I had was in my script to detect Allegro versions. For one thing, it didn't silence stderr while it queried pkg-config for different Allegro versions, which would result in ugly error output that was meant to be ignored. For another, it was attempting to capture stdout and check for content whereas it appears that the exit status is a sufficient condition.

These bugs have been fixed:

https://github.com/bambams/invincible-countermeasure/compare/bambams:084c5d53211ae86168cd95548377c06639e2231b...8020d416b21bf7b20dead4fc4cb4ae377ca85052

The whole set of fixes then becomes:

https://github.com/bambams/invincible-countermeasure/compare/bambams:3b83fcba28a61c286581650abc921d8ededca1e1...8020d416b21bf7b20dead4fc4cb4ae377ca85052

I'll update the issue and see if that helps its OP.

Peter Hull
Member #1,136
March 2001

On the subject of Makefiles, the link action should use `$^` (all prerequisites) rather than `$?` (all prerequisites newer than the target).

http://www.gnu.org/software/make/manual/make.html#Automatic-Variables

Pete

bamccaig
Member #7,536
July 2006
avatar

Peter Hull
Member #1,136
March 2001

I've put in a pull request, never done this before so hopefully it'll be right.
Pete
https://github.com/bambams/invincible-countermeasure/pull/2

bamccaig
Member #7,536
July 2006
avatar

I've put in a pull request, never done this before so hopefully it'll be right.
Pete
https://github.com/bambams/invincible-countermeasure/pull/2

"Right" is subjective. Everybody wants it done a different way (to get it "correct" in a busy environment you basically have to ask, or just try and fix it after). Ultimately, you accomplished the core mechanic that is a pull request (publish the branch somewhere, send correspondence asking upstream to merge it in). There are some changes that I'd like to make before I merge (I try to be a perfectionist), but they're mostly subjective. And with the work that you've done I might be able to figure out an install target. I'll try to work on it this weekend. Thanks!

Peter Hull
Member #1,136
March 2001

bamccaig said:

Ultimately, you accomplished the core mechanic that is a pull request

Yay!

On the code, my aim was to have a solution applicable to Windows, Mac and Linux, and to change Linley's code as little as possible.

I've run into a little snag though - when Xcode is building in development mode it puts the resources in a dir with a very long name, e.g. /Users/peterhull/Library/Developer/Xcode/DerivedData/Countermeasure-edbvuuhnycilvsaagjhpogqmjkcn/Build/Products/Debug/Countermeasure.app/Contents/Resources/data/images/fwss_font.bmp but the IC code has a hard limit of 100 chars for a path.
One option would be to go back to doing a chdir to the resource directory as you did with your launcher, but I've had problems in the past where File Open dialogs change the CWD which would mess that up. What's your opinion?

Pete

Linley Henzell
Member #3,963
October 2003

You should be able to get away with just changing FILE_PATH_LENGTH (in g_header.h) from 100 to whatever you need it to be.

 1   2 


Go to: