Problems with loading images

Sweetness ;D

thats so funny; I mean whats the point in having a src folder when EVERYTHING is in there
you could just not have it, put everything in the root

yeah maven, ok, whatever

anyway, you can do it however you want, just if anyone is curious, here is our current folder structure (only opened content because is has MANY sub folders)

http://img844.imageshack.us/img844/7304/29974753.gif

http://img844.imageshack.us/img844/7304/29974753.gif

How messy and ugly. I still prefer Sprongie’s One True Layout:)

=D

on a serious note: even if you like fat jars, which I dont,
you seriously wouldn’t want a 800mb jar containing EVERYTHING, now would you ?
apart from being horrible you couldn’t even swap or change files anymore, without replacing the whole thing.
Remember I’m talking in big-games-terms here, not your 5 min casual games with 10 images, 5MB total.

What does project layout have to do with how you deploy things?

@ReBirth & Giovanni, perhaps your problem is you aren’t refreshing when adding new images to the source? After I save an image, either new or edited, to my /src/res/ directory… In order to see the changes I have to right click on my project name(listing on the left side of eclipse window) and choose Refresh. This will copy everything in the src/* to the bin/*. Your resources should then be available to the build, and when exported the last Refresh will be included in the jar file.

… or You could make the workspace auto-refresh (Properties -> General -> Workspace -> “Refresh automatically”)

its the same. difference is, then there are no src or bin folders, but a jar at the root
all paths remain the same, never using this weird getResource

Note: This is not how I think things have to be done, but I’m sure I don’t follow some weird java conventions here. So what you are looking at is a project structure, in which someone just does what he thinks makes sense, not following standards.

I was being a little pedantic, but my point was that this doesn’t have to be true. Note sproingie (most likely) doesn’t ship his unit tests with his actual product, yet they are contained in the source folder via src/test/**. Project layout doesn’t have to map 100% to jar contents. You can have multiple source folders, like the example above (src/main and src/test) and only ship one of them, for example. You could also put only the class files into your jar, and use getResource() to refer to any images in resources/ subfolders outside of that jar.

But like I mentioned in my earlier post, getResource() will work with both flat files and jar contents. Same “path” and everything.

@gbeebe but I don’t want copy of my res. Like Cero said if the res is 100GB of size, copy is not.

That’s why put it together with bin and src is easier for me.