This is where I’ve been having issues. I’ve saved the exported file with no compression to avoid adding complexity to my test code. Chunks are basically small images 32x32 tiles with a position that can be rendered and merged together at runtime. It’s an array of maps in other words with an x,y position.
Chunks are stitched together at runtime. Minecraft is a great example of this but chunks are three-dimensional versus two.
chunks[b].toObject() //returns the chunk object, includes x,y,witdh,length and data of that chunk
I’ve gone through QT’s documentation on QByteArray but no creator or cast allows me to define a QByteArray from a QString, the result of reading the object of chunk[b].toObject()
fromBase64 is parsed from a QByteArray.
Since the Base64 string imported for that chunk is uncompressed, I should be able to simply decode it through QByteArray I believe. This is where I have no success. Is it that QByteArray cannot decode the base64 encoded data? base64 is a standard thus I have to be missing something.
For reference, this is an output of one of the test chunks that I’m attempting to decode
I’m stuck with this at the moment, the rest of the implementation including stitching rendered grids I’ve done a few times
EDIT: As mentioned, I want to avoid using CSV, and plan to compress the data in the future, this as specified is easy to decompress with QT’s built in functions. Though I need to parse decompressed data first
As an added reference, Tiled is based off of QT, so the fact QByteArray isn’t acting as I’m trying to use it, i.e from utf8, frombase64, etc, has got me stuck…
@eishiya If i comprehend your last statement, since the data is already not compressed, i still need to convert it to unsigned ints? Is this why my base64 unencoded data from QByteArray remains the same?
Thank you very much for your answer earlier, trying to get my head around base64 encoding.