ZILtoid1991 / pixelperfectengine

2D graphics engine written in D
Boost Software License 1.0
93 stars 2 forks source link

Dub Dependencies #3

Closed MggMuggins closed 3 years ago

MggMuggins commented 7 years ago

This is a stupid question, but what should a dub.json look like for a project built with this engine? Dub isn't running. I'm getting: Root package <projectname> reference derelict-sdl2 >=3.0.0-alpha.3 <3.1.0 cannot be satisfied. Thanks.

ZILtoid1991 commented 7 years ago

I use IDEs when I can, so either there's a problem in your project's dub.json (the project itself requires version 2.1.0), or something on my side.

If the latter, then at this weekend I'll release the 0.9.1-rc2 version, which has some minor speed improvements after I unified and further optimized the rendering algorithms (which will make the porting easier, even ending up on systems like the Raspberry Pi), fixed a few minor issues (there was a rendering bug on the TileLayer), and otherwise solidifies the layout for the future 1.0.0 version.

In the meanwhile, feel free to import your graphics with the included editor (there's a compiled version for Windows, has zero exception handling, but works, only you need freeimage.dll and sdl2.dll).

MggMuggins commented 7 years ago

2.1.0 of derelict-sdl2? Dub will automatically update me on that one then, right? Also, I'm running on Linux...

ZILtoid1991 commented 7 years ago

Currently working on a CSV parser, then I'll publish the next version. If you're running Linux, you might want that as I implemented a few changes for better portability between platforms (directory separation is now done differently), I would like to have your input on how it runs on non-Windows platforms.

MggMuggins commented 7 years ago

Right now I'm more interested in getting dub running, although I'm, willing to help out once I've accomplished that. I changed derelict-sdl and derelict-util to their appropriate versions. Just running dub gives me the same error, so I'm inclined to think that it's not on your end.

ZILtoid1991 commented 7 years ago

Currently I'm getting problems when I try to use dub to make a testrun with the compiling. Seems like an error on my side.

Once its resolved, I'm uploading the new version with the fixed dub.json.

ZILtoid1991 commented 7 years ago

Pushed a newer version. Download the source and try to compile it from that, I'm having version related issues (dub forces the newest alpha version from DerelictSDL2, which doesn't work with the engine without doing some minor modifications). Later on I'm going to release it with some binaries.

MggMuggins commented 7 years ago

These issues are for using this engine as a dub dependency, not building the engine from source. I may compile it anyway, but I'd like to let dub handle everything I need for most other stuff.

ZILtoid1991 commented 7 years ago

I issued some fixes to the dub.json as I got advises from the dlang forum. It should be working now.

You'll still need the editor to make your own *.xmp files as the engine uses its own custom format (needed for the advanced palette support) and by default only the editor can import certain files.

MggMuggins commented 7 years ago

Alright, my only dependency in dub,json is pixelperfect 0.9.1-rc2. It's now throwing this error: ../../.dub/packages/pixelperfectengine-0.9.1-rc2/pixelperfectengine/source/PixelPerfectEditor/app.d(15,8): Error: module sdl is in file 'derelict/sdl2/sdl.d' which cannot be read My guess is that it's not collecting the dependencies for some reason. Any idea why?

ZILtoid1991 commented 7 years ago

How's your dependency is written? It should be pixelperfectengine:pixelperfectengine

MggMuggins commented 7 years ago

Both of these result in error: "pixelperfectengine": "pixelperfectengine", "pixelperfectengine:pixelperfectengine" What is the complete content of the line, including grammar marks?

Btw, I appreciate the support.

MggMuggins commented 7 years ago

This works. I have no idea why, but it does. I'll open another PR with more easily understood documentation.

{
    "name": "testgame",
    "authors": [
        "SamwiseFilmore"
    ],
    "dependencies": {
                "derelict-sdl2": "~>2.1.0",
        "derelict-fi": "~>2.0.3",
        "pixelperfectengine:pixelperfectengine": "*"
    },
    "description": "Test game for learning to use this engine",
    "copyright": "Copyright © 2017, SamwiseFilmore",
    "license": "MPL-2.0"
}
MggMuggins commented 7 years ago

Really shouldn't have closed this. What I had was only building without running any actual stuff. My guess is that if I tried to actually use anything from the engine, it would fail, since there isn't actually anything there.

MggMuggins commented 7 years ago

Problem persists in v0.9.1 (of course, you didn't change anything).

ZILtoid1991 commented 7 years ago

Instead of the asterisk, try "==0.9.1".

MggMuggins commented 7 years ago

Same. My feeling is something is wrong on this end, but I really have no way of knowing.