D-VXLMapPreview - Map image generator

External additional handy features.
5 posts Page 1 of 1 First unread post
rakiru
Coder
Coder
Posts: 1349
Joined: Sun Nov 11, 2012 12:26 pm


D-VXLMapPreview

Generate preview images for maps. Supports 0.x, Iceball, and 1.0 maps.

Image
Full image here

Downloads
Source on GitHub
The latest downloads will be available here if I forget/don't bother to update this post.

Usage

Generate an image with a black background
Code: Select all
d-vxlmappreview --input=mesa.vxl --output=mesa.png
Same as above, but shorter
Code: Select all
d-vxlmappreview -i mesa.vxl -o mesa.png
Generate an image with an orange background
Code: Select all
d-vxlmappreview --input=mesa.vxl --output=mesa.png --background=0xFFBB00
Generate an image with a transparent background
Code: Select all
d-vxlmappreview --input=mesa.vxl --output=mesa.png --transparent
LeCom


You switched to D :')
I noticed you have a problem with the rendering function not doing what it should/need 2 slightly different versions of that function. You can try template arguments (like void function(alias const int a)() {...} and func!1 or similar) combined with static if.
rakiru
Coder
Coder
Posts: 1349
Joined: Sun Nov 11, 2012 12:26 pm


I've been meaning to try it out for a while, so figured I'd use this as a test since it's a pretty small project and the old Python script takes like 10 seconds to run. Other than a couple minor complaints, I really like it so far.

There's only one rendering function: generatePreview. generatePreviewVXL/Icemap simply handle file-format specific things, then call generatePreview to actually do the rendering. generatePreviewVXL calls generatePreview with 0,0,0 size to indicate that it should be calculated, and generatePreviewIcemap parses the Icemap file, pulls out the VXL and size data and calls generatePreview with that. computeMapSize is used to parse the map and figure out the dimensions of a block of VXL data, since VXL files have no header and Jagex cocked them up and have different sized maps (with the dimensions stored in some other metadata files somewhere else, no doubt).

Sorry if I misunderstood, but that's how it works.
LeCom


Yeah, I agree that D is unpolished and slightly unfinished, but it's all mainly details and you clearly see in which direction it goes. It's under heavy development at the moment.
About the problem,
Figure out way to use ImageRGB8 instead of ImageRGBA8 if backgroundColour.a == 255 (waste of space in files) [...]
Can we create two versions of this function from some sort of template?
basically you can pass some compile-time variable, then check for it via static if inside your function. E.g., somewhere in your program you do the alpha channel check, then call either generatePreview!(true)(...) or generatePreview!(false)(...) correspondingly, and you declare it like SuperImage generatePreview(alias UseAlphaChannel)(...)
rakiru
Coder
Coder
Posts: 1349
Joined: Sun Nov 11, 2012 12:26 pm


Ah, I get you now! Thanks a lot, I wasn't sure that was even going to be possible.
5 posts Page 1 of 1 First unread post
Return to “Add-ons & Tools”

Who is online

Users browsing this forum: No registered users and 14 guests