Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Issue?] Two tilesets, one palette?
#1
Hi,
I did this code : 
Code:
#include "includes/Tilengine.h"
#include <stdio.h>

int main()
{
    TLN_Tilemap tilemap = TLN_LoadTilemap("assets/floor/floor-tilemap.tmx", "floor");
    TLN_Init (400, 240, 1, 0, 0);
    TLN_SetLayerTilemap (0, tilemap);

    TLN_CreateWindow (NULL, 0);
    while (TLN_ProcessWindow()) {
        TLN_DrawFrame (0);
    }
    return 0;
}

Or the simplest Tilengine exemple you can do.

The tilemap uses 2 tilesets, each has its PNG file. But seems both tilesets use the same palette from the first tileset instead of each tileset having its own palette. Is it normal? Did I forgot to do something? Thanks for your answer!
Also please note my PNGs use indexed colors, and I also use Tilengine v2.11.3 64-bit and Tiled 1.9.2.
Reply
#2
Hi!
You are loading the tilemap before initialising the tileset, that may cause problems. TLN_Init() should go first.
Reply
#3
(10-29-2022, 01:46 AM)megamarc Wrote: Hi!
You are loading the tilemap before initialising the tileset, that may cause problems. TLN_Init() should go first.

So I need to initialise the Tilesets before the tilemap? I thought tilesets were automatically initialized while loading a tilemap
Reply
#4
No, you need to initialise the engine with TLN_Init() before anything else. You're loading a tilemap before initialising the engine.
Reply
#5
(10-29-2022, 08:38 AM)megamarc Wrote: No, you need to initialise the engine with TLN_Init() before anything else. You're loading a tilemap before initialising the engine.

I fixed that, but I still have the issue.
Reply
#6
In that case, I need to test it with the same assets you're using. With my test assets, it woks as expected. Can you upload them here?
Reply
#7
(10-29-2022, 07:21 PM)megamarc Wrote: In that case, I need to test it with the same assets you're using. With my test assets, it woks as expected. Can you upload them here?

Here are my assets with my source code.
.zip   Main (2).zip (Size: 8.61 KB / Downloads: 1)
Reply
#8
(10-29-2022, 08:12 PM)System64 Wrote:
(10-29-2022, 07:21 PM)megamarc Wrote: In that case, I need to test it with the same assets you're using. With my test assets, it woks as expected. Can you upload them here?

Here are my assets with my source code.

Okay so I made a more advanced exemple, with actual tilesets, but the colors are off (in fact, every tileset seems to use the palette of the first loaded tileset).


Attached Files
.zip   Main (3).zip (Size: 14.86 KB / Downloads: 0)
Reply
#9
Hi,
I've run your test assets with Tilengine 2.11.3, and I get expected results.
This is Tiled wiew:
   
And this is Tilengine window result:
   
What do you see in your output? Are you using latest release of Tilengine. Multi-palette issue was fixed in las github commit
Reply
#10
(10-30-2022, 04:44 PM)megamarc Wrote: Hi,
I've run your test assets with Tilengine 2.11.3, and I get expected results.
This is Tiled wiew:

And this is Tilengine window result:

What do you see in your output? Are you using latest release of Tilengine. Multi-palette issue was fixed in las github commit

Hi, this is the output I got. You can see I'm using Tilengine 2.11.3 in the console (I am on Windows)


Attached Files Thumbnail(s)
   
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)