uojs / uodatareader

Provides an API to read MUL/UOP files using Node.js
6 stars 0 forks source link

Is the color converter compatible with UO ML? #14

Open tylers-username opened 5 years ago

tylers-username commented 5 years ago

I am using the following to test the map piece generation:

const feluccaMapData = {
    fileIndex: 0,
    mapId: 0,
    width: 6144,
    height: 4096
};
const uodatareader = require('./index')({
    maps: [
        feluccaMapData,
        //{id: 1, width: 6144, height: 4096}
    ]
});

const felucca = uodatareader.maps[feluccaMapData.mapId];
const view = felucca.getBlock(183, 205);
const art = new uodatareader.Art({
    baseDirectory: uodatareader.config.baseDirectory
});
view.forEach(mapPiece => {
    art.loadLand(mapPiece.id).png().toBuffer().then(data=>{
            console.log(`<img width="44" height="44" src="data:image/png;base64,${data.toString(
                'base64')}" />`)
    })
});

This results in: https://jsfiddle.net/cgysentr/

Is this a problem with my MUL files being incompatible or is there something that I am missing?

kevinhikaruevans commented 5 years ago

I think I only tested it with uop files and not mul files, but it's been a while since I've worked on this project. :/

tylers-username commented 5 years ago

Thanks for that bit of info. Do you recall the specific UO version that you pulled the UOP files from?