ultraq / redhorizon

Recreating the original 2D Command & Conquer games
Apache License 2.0
6 stars 4 forks source link

a few fixes to make it compile again #5

Closed philippkeller closed 7 years ago

philippkeller commented 7 years ago

fixed:

it still does not build on my machine (I assume you just build on the top level with gradle build, no?), but it's certainly closer to success

ultraq commented 7 years ago

point build.gradle to current .gradle file (better would be to decouple those two projects)

If GitHub didn't change it's URLs to raw resources... shakes fist 😛

Anyway, I'll take a look at this some time and see if I can get this thing building again.

ultraq commented 7 years ago

Heya, I'm gonna close this PR since it contains edits that look like they're mainly for your fork (eg: edits to the readme about your use of the fork). I'll still work on trying to get this repo to build though.

philippkeller commented 7 years ago

fair enough, I continued to try and fix it. I think the code is based on JDK7. I fixed a bunch of "catch IOException" problems and pushed the results into this branch (if this is of any value): https://github.com/philippkeller/redhorizon/tree/ioexception

Now I'm stuck with this error:

[ant:iajc] /Users/philipp/oss/redhorizon/Projects/Red Horizon - Launcher/Java/redhorizon/launcher/ErrorMessage.java:66 [error] nz.net.ultraq.gui cannot be resolved to a type
[ant:iajc] ErrorMessage errormessage = new nz.net.ultraq.gui.swt.SWTErrorMessage();
[ant:iajc]                                 ^^^^^^^^^^^^^^
[ant:iajc] [error] can't determine superclass of missing type redhorizon.launcher.Launcher$1
[ant:iajc] when resolving types defined in compilation unit /Users/philipp/oss/redhorizon/Projects/Red Horizon - Launcher/Java/redhorizon/launcher/Launcher.ja

Where do I get nz.net.ultraq.gui from?

ultraq commented 7 years ago

I don't think that exists. The master branch was just everything I had at the time I pushed it, and that didn't mean the entire project would run - just bits of it.

I also found this project was a Java 7 one as the version of AspectJ being used to compile it didn't work w/ Java 8 (I don't have 7 on my machine any more) until I updated that too.

I'm wondering now if I should just concentrate my efforts towards finishing this other branch that I have where I'm trying to get everything to be a JAR that can be deployed to Maven so that people can just pull in whatever parts (that I have completed like all the filetypes) they need.

philippkeller commented 7 years ago

I got the Filetypes project to compile in the branch I referred to. Anyways: however you decide: why I want to compile it is that I am facing an issue when converting a SHP file into png. The resulting png is a transparent one layer png without any pixels.

Here's what I run (the files I used are attached here: dune2.tar.gz and here is the resulting png: b.png):

06:51 $ java -classpath *:Libraries/* redhorizon.utilities.converter.ConverterCommandLine shp.ShpFileDune2 png.PngFile PIECES.SHP b.png BENE.PAL
Loading input file/s...
PIECES.SHP (Dune 2 SHP file)
  Number of images: 28
  Image width: 88
  Image height: 60
  Colour depth: 8-bit

Saving output file...
b.png (PNG file)
  Image width: 968
  Image height: 180
  Colour depth: 8-bit (using internal palette)

Done.
ultraq commented 7 years ago

Hmm, not sure what might be missing 😕 I've tried running a really old version of the file converter utilities that used to be available for download via the Red Alert forums I used to frequent back when I was working on this. It seems to give me much better results, although maybe still the wrong palette, not sure.

Here's the ZIP file I had for a "version 0.28a" from June 2008, which seems to be the last binary version I had: RedHorizon_Utilities_dev028a.zip

The scripts were all for Windows only, so will need a bit of translation to Mac/Unix OS', but it seems to give something better than that blank image you got.

philippkeller commented 7 years ago

thanks, with this version, when running this:

java -classpath redhorizon-utilities.jar:Localizations:Libraries/aspectjrt.jar redhorizon.utilities.converter.Converter shp.ShpFileDune2 png.PngFile unpacked/UNITS1.SHP units1.png unpacked/BENE.PAL

the result is this: which looks pretty good!

Thanks for the help. Maybe you can put this zip file in github under releases?

ultraq commented 7 years ago

Definitely a good idea 👍 Issue created: #9