<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Tilengine - The 2D retro graphics engine forum - Support]]></title>
		<link>http://tilengine.org/forum/</link>
		<description><![CDATA[Tilengine - The 2D retro graphics engine forum - http://tilengine.org/forum]]></description>
		<pubDate>Tue, 12 May 2026 09:33:16 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[sqx specifications]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2311</link>
			<pubDate>Thu, 03 Apr 2025 14:23:33 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2311</guid>
			<description><![CDATA[Hi! I have some questions about the sqx format.<br />
<br />
How does it work and what are the tags I can use? Can I use seconds instead of frames? And can I set an individual delay per sequence frame?<br />
<br />
Thanks for your answer!]]></description>
			<content:encoded><![CDATA[Hi! I have some questions about the sqx format.<br />
<br />
How does it work and what are the tags I can use? Can I use seconds instead of frames? And can I set an individual delay per sequence frame?<br />
<br />
Thanks for your answer!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Layer Masking]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2310</link>
			<pubDate>Sat, 08 Mar 2025 18:59:56 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=130953">sputnikus</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2310</guid>
			<description><![CDATA[Hello!<br />
<br />
I was wondering if Tilengine has a layer masking feature similar to TLN_SetLayerClip, but where pixels would be clipped based on the assigned layer mask rather than rectangular bounds.<br />
<br />
At a high level, I was thinking that any given layer could be assigned a "layer mask," and when drawing pixels, we could test against this assigned layer mask to see if the pixel should be drawn or not.<br />
<br />
I'm working on adding shadows and overlay effects to my game, and many of the effects I'm considering would require masking parts of a layer to ensure they are drawn within the bounds of the sprites on the layer below.<br />
<br />
Here is a video recording of the effects I am working with, I would essentially like to clip all of the shadows within the chessboard's bounds:<br />
<img src="https://lh3.googleusercontent.com/d/1PvlVcwXIKldUg3FLLSfFOkFqypwaABLq=w1000?authuser=0" loading="lazy"  alt="[Image: 1PvlVcwXIKldUg3FLLSfFOkFqypwaABLq=w1000?authuser=0]" class="mycode_img" /><br />
<br />
Thank you!]]></description>
			<content:encoded><![CDATA[Hello!<br />
<br />
I was wondering if Tilengine has a layer masking feature similar to TLN_SetLayerClip, but where pixels would be clipped based on the assigned layer mask rather than rectangular bounds.<br />
<br />
At a high level, I was thinking that any given layer could be assigned a "layer mask," and when drawing pixels, we could test against this assigned layer mask to see if the pixel should be drawn or not.<br />
<br />
I'm working on adding shadows and overlay effects to my game, and many of the effects I'm considering would require masking parts of a layer to ensure they are drawn within the bounds of the sprites on the layer below.<br />
<br />
Here is a video recording of the effects I am working with, I would essentially like to clip all of the shadows within the chessboard's bounds:<br />
<img src="https://lh3.googleusercontent.com/d/1PvlVcwXIKldUg3FLLSfFOkFqypwaABLq=w1000?authuser=0" loading="lazy"  alt="[Image: 1PvlVcwXIKldUg3FLLSfFOkFqypwaABLq=w1000?authuser=0]" class="mycode_img" /><br />
<br />
Thank you!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Bug?] Disable Layer and Raster Callbacks]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2309</link>
			<pubDate>Sat, 08 Feb 2025 23:40:17 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2309</guid>
			<description><![CDATA[Hi! I maybe found a bug with layers.<br />
If I have a raster callback interacting with a layer, but I disable this layer somewhere else in the code, the layer is still enabled. Is this behavior normal? Wouldn't it cause problems if I want to keep it disabled for some reasons?<br />
Thanks for your answer!]]></description>
			<content:encoded><![CDATA[Hi! I maybe found a bug with layers.<br />
If I have a raster callback interacting with a layer, but I disable this layer somewhere else in the code, the layer is still enabled. Is this behavior normal? Wouldn't it cause problems if I want to keep it disabled for some reasons?<br />
Thanks for your answer!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Struct padding]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2308</link>
			<pubDate>Wed, 05 Feb 2025 16:55:03 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2308</guid>
			<description><![CDATA[Hi! I have a question.<br />
Are structs automatically padded during compilation? I recommend you to order your fields by size or manually padding your fields like this :<br />
<br />
Field ordering :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typedef struct<br />
{<br />
<br />
typedef struct<br />
{<br />
int x; /*!&lt; horizontal position */<br />
int y; /*!&lt; vertical position */<br />
int width; /*!&lt; horizontal size */<br />
int height; /*!&lt; vertical size */<br />
uint16_t id; /*!&lt; unique ID */<br />
uint16_t gid; /*!&lt; graphic ID (tile index) */<br />
uint16_t flags; /*!&lt; attributes (FLAG_FLIPX, FLAG_FLIPY, FLAG_PRIORITY) */<br />
uint8_t type; /*!&lt; type property */<br />
bool visible; /*!&lt; visible property */<br />
char name[64]; /*!&lt; name property */<br />
}<br />
TLN_ObjectInfo;</code></div></div><br />
Manual padding :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typedef struct<br />
{<br />
uint16_t id; /*!&lt; unique ID */<br />
uint16_t gid; /*!&lt; graphic ID (tile index) */<br />
uint16_t flags; /*!&lt; attributes (FLAG_FLIPX, FLAG_FLIPY, FLAG_PRIORITY) */<br />
uint16_t padding;<br />
int x; /*!&lt; horizontal position */<br />
int y; /*!&lt; vertical position */<br />
int width; /*!&lt; horizontal size */<br />
int height; /*!&lt; vertical size */<br />
uint8_t type; /*!&lt; type property */<br />
bool visible; /*!&lt; visible property */<br />
char name[64]; /*!&lt; name property */<br />
}<br />
TLN_ObjectInfo;</code></div></div>]]></description>
			<content:encoded><![CDATA[Hi! I have a question.<br />
Are structs automatically padded during compilation? I recommend you to order your fields by size or manually padding your fields like this :<br />
<br />
Field ordering :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typedef struct<br />
{<br />
<br />
typedef struct<br />
{<br />
int x; /*!&lt; horizontal position */<br />
int y; /*!&lt; vertical position */<br />
int width; /*!&lt; horizontal size */<br />
int height; /*!&lt; vertical size */<br />
uint16_t id; /*!&lt; unique ID */<br />
uint16_t gid; /*!&lt; graphic ID (tile index) */<br />
uint16_t flags; /*!&lt; attributes (FLAG_FLIPX, FLAG_FLIPY, FLAG_PRIORITY) */<br />
uint8_t type; /*!&lt; type property */<br />
bool visible; /*!&lt; visible property */<br />
char name[64]; /*!&lt; name property */<br />
}<br />
TLN_ObjectInfo;</code></div></div><br />
Manual padding :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>typedef struct<br />
{<br />
uint16_t id; /*!&lt; unique ID */<br />
uint16_t gid; /*!&lt; graphic ID (tile index) */<br />
uint16_t flags; /*!&lt; attributes (FLAG_FLIPX, FLAG_FLIPY, FLAG_PRIORITY) */<br />
uint16_t padding;<br />
int x; /*!&lt; horizontal position */<br />
int y; /*!&lt; vertical position */<br />
int width; /*!&lt; horizontal size */<br />
int height; /*!&lt; vertical size */<br />
uint8_t type; /*!&lt; type property */<br />
bool visible; /*!&lt; visible property */<br />
char name[64]; /*!&lt; name property */<br />
}<br />
TLN_ObjectInfo;</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Duff's devices]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2307</link>
			<pubDate>Mon, 13 Jan 2025 22:20:49 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2307</guid>
			<description><![CDATA[Hi!<br />
I watched a video about Duff's devices today. It is sadly in french but I can send you some articles about it.<br />
<a href="https://en.wikipedia.org/wiki/Duff%27s_device" target="_blank" rel="noopener" class="mycode_url">https://en.wikipedia.org/wiki/Duff%27s_device</a><br />
<a href="https://www.geeksforgeeks.org/duffs-device-work/" target="_blank" rel="noopener" class="mycode_url">https://www.geeksforgeeks.org/duffs-device-work/</a><br />
It is very interesting, and I wonder if we can use this technique to optimize Tilengine even further. Imagine being able to draw X pixels in a single row, then do a check, without needing the window width to be a multiple of X?]]></description>
			<content:encoded><![CDATA[Hi!<br />
I watched a video about Duff's devices today. It is sadly in french but I can send you some articles about it.<br />
<a href="https://en.wikipedia.org/wiki/Duff%27s_device" target="_blank" rel="noopener" class="mycode_url">https://en.wikipedia.org/wiki/Duff%27s_device</a><br />
<a href="https://www.geeksforgeeks.org/duffs-device-work/" target="_blank" rel="noopener" class="mycode_url">https://www.geeksforgeeks.org/duffs-device-work/</a><br />
It is very interesting, and I wonder if we can use this technique to optimize Tilengine even further. Imagine being able to draw X pixels in a single row, then do a check, without needing the window width to be a multiple of X?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Global palettes bugs?]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2306</link>
			<pubDate>Fri, 10 May 2024 19:22:37 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2306</guid>
			<description><![CDATA[Hi!<br />
<br />
I think I found a weird bug with the global palettes.<br />
<br />
I created 8 global palettes of size 16 and loaded the Sonic foreground tilemap. Normally, everything should be black, but here, I have some blue stuff :<br />
When I set the size to 22, I don't have any issues.<br />
<br />
<img src="https://cdn.gilcdn.com/ContentMediaGenericFiles/4aee05b80bde0edcbfa9a01443aaadf9-Full.webp" loading="lazy"  alt="[Image: 4aee05b80bde0edcbfa9a01443aaadf9-Full.webp]" class="mycode_img" /><br />
<br />
Is that normal?<br />
Edit : It would be a great idea if the user can disable the global palettes usage, or enable them again.<br />
Edit 2 : Is it possible to set NULL to a Layer's tilemap / bitmap / objectlist?]]></description>
			<content:encoded><![CDATA[Hi!<br />
<br />
I think I found a weird bug with the global palettes.<br />
<br />
I created 8 global palettes of size 16 and loaded the Sonic foreground tilemap. Normally, everything should be black, but here, I have some blue stuff :<br />
When I set the size to 22, I don't have any issues.<br />
<br />
<img src="https://cdn.gilcdn.com/ContentMediaGenericFiles/4aee05b80bde0edcbfa9a01443aaadf9-Full.webp" loading="lazy"  alt="[Image: 4aee05b80bde0edcbfa9a01443aaadf9-Full.webp]" class="mycode_img" /><br />
<br />
Is that normal?<br />
Edit : It would be a great idea if the user can disable the global palettes usage, or enable them again.<br />
Edit 2 : Is it possible to set NULL to a Layer's tilemap / bitmap / objectlist?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[CRT and set FPS bugs]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2305</link>
			<pubDate>Wed, 27 Mar 2024 21:29:03 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2305</guid>
			<description><![CDATA[Hi!<br />
<br />
I found 2 bugs in Tilengine.<br />
<br />
The first one is about the CRT filter. When I set a bitmap as background and a tilemap as layer, I have a strange glitch with the CRT enabled (nothing special if disabled) :<br />
<img src="https://cdn.gilcdn.com/ContentMediaGenericFiles/c074ae287b032a05044bcb97fe177df1-Full.webp?w=1308&amp;h=863" loading="lazy"  alt="[Image: c074ae287b032a05044bcb97fe177df1-Full.webp?w=1308&amp;h=863]" class="mycode_img" /><br />
<br />
Here is the code :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "Tilengine.h"<br />
#include &lt;SDL2/SDL.h&gt;<br />
<br />
int main(void) {<br />
    TLN_Tilemap foreground;<br />
<br />
    TLN_Init (400, 240, 1, 0, 0);<br />
<br />
    TLN_Bitmap bm = TLN_LoadBitmap("elis.bmp");<br />
    TLN_Tilemap tm = TLN_LoadTilemap("assets/sonic/Sonic_md_fg1.tmx", NULL);<br />
    TLN_SetBGBitmap(bm);<br />
    TLN_SetLayerTilemap(0, tm);<br />
    TLN_CreateWindow (NULL, CWF_S3|CWF_NOVSYNC);<br />
    int fps = 60;<br />
    TLN_SetTargetFps(10);<br />
    int average_fps = 0;<br />
    while (TLN_ProcessWindow()) {<br />
        /* adjust game logic pacing to target fps */<br />
        uint32_t begin = SDL_GetTicks();<br />
TLN_DrawFrame(0);<br />
        uint32_t end = SDL_GetTicks();<br />
        uint32_t delta = end - begin;<br />
        printf("FPS = %f&#92;n", 1000.0 / (float)delta);<br />
    }<br />
<br />
    TLN_Deinit ();<br />
}</code></div></div><br />
<br />
The second is when I change the FPS, seems the animations of the flowers are always at the same speed. Is that normal? Shouldn't it be slower (or faster if above screen refresh rate)?<br />
<br />
Thanks for your answer!]]></description>
			<content:encoded><![CDATA[Hi!<br />
<br />
I found 2 bugs in Tilengine.<br />
<br />
The first one is about the CRT filter. When I set a bitmap as background and a tilemap as layer, I have a strange glitch with the CRT enabled (nothing special if disabled) :<br />
<img src="https://cdn.gilcdn.com/ContentMediaGenericFiles/c074ae287b032a05044bcb97fe177df1-Full.webp?w=1308&amp;h=863" loading="lazy"  alt="[Image: c074ae287b032a05044bcb97fe177df1-Full.webp?w=1308&amp;h=863]" class="mycode_img" /><br />
<br />
Here is the code :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "Tilengine.h"<br />
#include &lt;SDL2/SDL.h&gt;<br />
<br />
int main(void) {<br />
    TLN_Tilemap foreground;<br />
<br />
    TLN_Init (400, 240, 1, 0, 0);<br />
<br />
    TLN_Bitmap bm = TLN_LoadBitmap("elis.bmp");<br />
    TLN_Tilemap tm = TLN_LoadTilemap("assets/sonic/Sonic_md_fg1.tmx", NULL);<br />
    TLN_SetBGBitmap(bm);<br />
    TLN_SetLayerTilemap(0, tm);<br />
    TLN_CreateWindow (NULL, CWF_S3|CWF_NOVSYNC);<br />
    int fps = 60;<br />
    TLN_SetTargetFps(10);<br />
    int average_fps = 0;<br />
    while (TLN_ProcessWindow()) {<br />
        /* adjust game logic pacing to target fps */<br />
        uint32_t begin = SDL_GetTicks();<br />
TLN_DrawFrame(0);<br />
        uint32_t end = SDL_GetTicks();<br />
        uint32_t delta = end - begin;<br />
        printf("FPS = %f&#92;n", 1000.0 / (float)delta);<br />
    }<br />
<br />
    TLN_Deinit ();<br />
}</code></div></div><br />
<br />
The second is when I change the FPS, seems the animations of the flowers are always at the same speed. Is that normal? Shouldn't it be slower (or faster if above screen refresh rate)?<br />
<br />
Thanks for your answer!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to create a framebuffer for use of external rendering]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2304</link>
			<pubDate>Thu, 29 Feb 2024 14:54:55 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=94284">raziel</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2304</guid>
			<description><![CDATA[as title suggests, I was following the "External Rendering" guide on the documentation site, however, when following it in v 2.15.2 it doesn't seem to work, owing to the provided code snippet:<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> hres = 400;</span></span></span><br />
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> vres = 240;</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> pitch = hres * <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">sizeof</span></span>(uint32_t);</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">void</span></span>* framebuffer;</span></span></span></div>
<br />
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #007899;" class="mycode_color">/* init and set framebuffer */</span></span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <a href="https://www.tilengine.org/doc/group__setup.html#ga90f3afde4b01830bbca8f2ff340e2e08" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0039e6;" class="mycode_color">TLN_Init</span></a> (hres, vres, 2, 80, 0);</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    framebuffer = malloc (pitch * vres);</span></span></span></div>
<span style="color: #4d4d4d;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font">    <a href="https://www.tilengine.org/doc/group__setup.html#ga8d1af1d3eac0710bd2e0fbd73f752c2b" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0039e6;" class="mycode_color">TLN_SetRenderTarget</span></a> (framebuffer, pitch);</span></span></span><br />
<br />
<br />
However on my end (visual studio 2022), TLN_SetRenderTarget's first argument (framebuffer) expects a uint8_t, not a void*, and changing framebuffer to that datatype causes malloc to break, as malloc returns a void*.<br />
so what is it you're actually meant to do?]]></description>
			<content:encoded><![CDATA[as title suggests, I was following the "External Rendering" guide on the documentation site, however, when following it in v 2.15.2 it doesn't seem to work, owing to the provided code snippet:<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> hres = 400;</span></span></span><br />
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> vres = 240;</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">const</span></span> <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">int</span></span> pitch = hres * <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">sizeof</span></span>(uint32_t);</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #404040;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">void</span></span>* framebuffer;</span></span></span></div>
<br />
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <span style="color: #007899;" class="mycode_color">/* init and set framebuffer */</span></span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    <a href="https://www.tilengine.org/doc/group__setup.html#ga90f3afde4b01830bbca8f2ff340e2e08" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0039e6;" class="mycode_color">TLN_Init</span></a> (hres, vres, 2, 80, 0);</span></span></span></div>
<div style="text-align: left;" class="mycode_align"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font"><span style="color: #4d4d4d;" class="mycode_color">    framebuffer = malloc (pitch * vres);</span></span></span></div>
<span style="color: #4d4d4d;" class="mycode_color"><span style="font-size: medium;" class="mycode_size"><span style="font-family: Arial;" class="mycode_font">    <a href="https://www.tilengine.org/doc/group__setup.html#ga8d1af1d3eac0710bd2e0fbd73f752c2b" target="_blank" rel="noopener" class="mycode_url"><span style="color: #0039e6;" class="mycode_color">TLN_SetRenderTarget</span></a> (framebuffer, pitch);</span></span></span><br />
<br />
<br />
However on my end (visual studio 2022), TLN_SetRenderTarget's first argument (framebuffer) expects a uint8_t, not a void*, and changing framebuffer to that datatype causes malloc to break, as malloc returns a void*.<br />
so what is it you're actually meant to do?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How blitting works]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2303</link>
			<pubDate>Wed, 21 Feb 2024 20:28:57 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=106859">vonhoff</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2303</guid>
			<description><![CDATA[Hi Marc,<br />
<br />
I'm currently learning about blitting in graphics programming and I'm trying to understand how scaling works. <br />
How does it work in Tilengine? The scaling I'm interested in is in the following snippet from Blitters.c<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* paints scanline without checking color key (always solid) with scaling */<br />
static void blitFastScaling_8_32 (uint8_t *srcpixel, TLN_Palette palette, void* dstptr, int width, int dx, int offset, uint8_t* blend)<br />
{<br />
  uint32_t* dstpixel = (uint32_t*)dstptr;<br />
  uint32_t* color = (uint32_t*)palette-&gt;data;<br />
  while (width)<br />
  {<br />
    uint32_t src = *(srcpixel + offset/(1 &lt;&lt; FIXED_BITS));<br />
    *dstpixel++ = color[src];<br />
    offset += dx;<br />
    width--;<br />
  }<br />
}</code></div></div><br />
I wonder why the offset is divided by (1 &lt;&lt; 16) or 65536. <br />
<br />
Thanks!<br />
<br />
Edit:<br />
As I understand it, the reason for dividing the offset by (1 &lt;&lt; 16) is to convert it from a fixed-point representation to an integer index in the palette array. And the fixed-point representation is used to allow for fractional increments of offset, which is necessary for smooth scaling. Is that correct?]]></description>
			<content:encoded><![CDATA[Hi Marc,<br />
<br />
I'm currently learning about blitting in graphics programming and I'm trying to understand how scaling works. <br />
How does it work in Tilengine? The scaling I'm interested in is in the following snippet from Blitters.c<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* paints scanline without checking color key (always solid) with scaling */<br />
static void blitFastScaling_8_32 (uint8_t *srcpixel, TLN_Palette palette, void* dstptr, int width, int dx, int offset, uint8_t* blend)<br />
{<br />
  uint32_t* dstpixel = (uint32_t*)dstptr;<br />
  uint32_t* color = (uint32_t*)palette-&gt;data;<br />
  while (width)<br />
  {<br />
    uint32_t src = *(srcpixel + offset/(1 &lt;&lt; FIXED_BITS));<br />
    *dstpixel++ = color[src];<br />
    offset += dx;<br />
    width--;<br />
  }<br />
}</code></div></div><br />
I wonder why the offset is divided by (1 &lt;&lt; 16) or 65536. <br />
<br />
Thanks!<br />
<br />
Edit:<br />
As I understand it, the reason for dividing the offset by (1 &lt;&lt; 16) is to convert it from a fixed-point representation to an integer index in the palette array. And the fixed-point representation is used to allow for fractional increments of offset, which is necessary for smooth scaling. Is that correct?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Collision with tiles position and sprite not aligning correctly]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2300</link>
			<pubDate>Sun, 03 Sep 2023 05:04:03 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=471">RootBeerKing</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2300</guid>
			<description><![CDATA[Hello again, I've been struggling with getting collision detection to work correctly. I'm *almost* certain I got the math/code right, however it seems there is an issue with the offset of the map and tiles not being rendered where they should be? I've linked the project, if you could check it out and see what I'm doing wrong here it would be a great help as I've been stuck on this problem for days now and I just don't know what I'm doing wrong here:<br />
 <br />
*removed link*<br />
<br />
Thank you very much.]]></description>
			<content:encoded><![CDATA[Hello again, I've been struggling with getting collision detection to work correctly. I'm *almost* certain I got the math/code right, however it seems there is an issue with the offset of the map and tiles not being rendered where they should be? I've linked the project, if you could check it out and see what I'm doing wrong here it would be a great help as I've been stuck on this problem for days now and I just don't know what I'm doing wrong here:<br />
 <br />
*removed link*<br />
<br />
Thank you very much.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Vertical callback or per pixel callback : I understand/How does Tilengine work?]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2299</link>
			<pubDate>Thu, 17 Aug 2023 15:19:01 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2299</guid>
			<description><![CDATA[Hi!<br />
<br />
I wondered why Tilengine didn't have vertical raster effects or per pixel effects while the Commodore Amiga can do stuff each 8 pixels, or less in demos.<br />
Well, I try to create my own graphics engine in Nim with not only horizontal raster effects, but also vertical and both at once.<br />
Aaaand well... It hurts performances a lot. It now makes sense why that kind of feature isn't implemented.<br />
<br />
But I wonder about another thing, how do you do to reach such high performances to draw at least a simple tilemap? I hardly go under 7ms per frame drawing for one layer and a 384x216 screen.<br />
<br />
I also read Tilengine's code to understand how rendering is done, maybe I didn't understood well, but it seems you draw each scanlines each times as the number of layers. is it that?]]></description>
			<content:encoded><![CDATA[Hi!<br />
<br />
I wondered why Tilengine didn't have vertical raster effects or per pixel effects while the Commodore Amiga can do stuff each 8 pixels, or less in demos.<br />
Well, I try to create my own graphics engine in Nim with not only horizontal raster effects, but also vertical and both at once.<br />
Aaaand well... It hurts performances a lot. It now makes sense why that kind of feature isn't implemented.<br />
<br />
But I wonder about another thing, how do you do to reach such high performances to draw at least a simple tilemap? I hardly go under 7ms per frame drawing for one layer and a 384x216 screen.<br />
<br />
I also read Tilengine's code to understand how rendering is done, maybe I didn't understood well, but it seems you draw each scanlines each times as the number of layers. is it that?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[tile_info.type returning 0?]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2298</link>
			<pubDate>Wed, 16 Aug 2023 06:01:43 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=471">RootBeerKing</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2298</guid>
			<description><![CDATA[Hello, I'm trying to get collision to work with the forest sample. I've added types to the tileset in Tiled, but when I go to get the tile type using<br />
TLN_GetLayerTile (LAYER_FOREGROUND, 11*16,12*16, &amp;tile_info);<br />
<br />
the number I entered in the tile type in Tiled doesn't show up, I only get a 0 returned when I print it using std::cout &lt;&lt; tile_info.type &lt;&lt; std::endl;<br />
<br />
Is this a bug, or did I do something wrong?<br />
<br />
This is my tileset file:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;tileset version="1.10" tiledversion="1.10.2" name="tileset" tilewidth="16" tileheight="16" tilecount="240" columns="20"&gt;<br />
&lt;image source="tileset.png" trans="ff00ff" width="320" height="192"/&gt;<br />
&lt;tile id="67" type="2"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="2"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;tile id="68"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="1"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;tile id="69"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="1"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;/tileset&gt;</code></div></div>]]></description>
			<content:encoded><![CDATA[Hello, I'm trying to get collision to work with the forest sample. I've added types to the tileset in Tiled, but when I go to get the tile type using<br />
TLN_GetLayerTile (LAYER_FOREGROUND, 11*16,12*16, &amp;tile_info);<br />
<br />
the number I entered in the tile type in Tiled doesn't show up, I only get a 0 returned when I print it using std::cout &lt;&lt; tile_info.type &lt;&lt; std::endl;<br />
<br />
Is this a bug, or did I do something wrong?<br />
<br />
This is my tileset file:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;tileset version="1.10" tiledversion="1.10.2" name="tileset" tilewidth="16" tileheight="16" tilecount="240" columns="20"&gt;<br />
&lt;image source="tileset.png" trans="ff00ff" width="320" height="192"/&gt;<br />
&lt;tile id="67" type="2"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="2"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;tile id="68"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="1"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;tile id="69"&gt;<br />
  &lt;properties&gt;<br />
  &lt;property name="type" type="int" value="1"/&gt;<br />
  &lt;/properties&gt;<br />
&lt;/tile&gt;<br />
&lt;/tileset&gt;</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Tile animation (ON/OFF switch case)]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2297</link>
			<pubDate>Sat, 05 Aug 2023 21:55:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2297</guid>
			<description><![CDATA[Hi, I have some questions about tile animations.<br />
<br />
I am trying to make an ON/OFF switch gimmick like what you can find in Super Mario Maker 2 :<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/nvZY8_jka4k" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
In my case, the state of the switch is stored in a Boolean variable.<br />
The best way to achieve this effect I think is through animations. However, I can't find a way to control animations to achieve this effect.<br />
The way I achieved the gimmick is by iterating through THE ENTIRE TILEMAP and change the index of the tiles I want to switch, so, very unoptimized.<br />
<br />
Do you know how I can achieve that?<br />
Thanks for your answer!]]></description>
			<content:encoded><![CDATA[Hi, I have some questions about tile animations.<br />
<br />
I am trying to make an ON/OFF switch gimmick like what you can find in Super Mario Maker 2 :<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/nvZY8_jka4k" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
In my case, the state of the switch is stored in a Boolean variable.<br />
The best way to achieve this effect I think is through animations. However, I can't find a way to control animations to achieve this effect.<br />
The way I achieved the gimmick is by iterating through THE ENTIRE TILEMAP and change the index of the tiles I want to switch, so, very unoptimized.<br />
<br />
Do you know how I can achieve that?<br />
Thanks for your answer!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Loading and setting palettes]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2293</link>
			<pubDate>Sat, 27 May 2023 18:17:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=106859">vonhoff</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2293</guid>
			<description><![CDATA[Hey Marc,<br />
<br />
I have a question about the TLN_Palette's first color. Why is it that TLN_SetPaletteColor always sets the first color (index 0) to 0, even though the ACT palette in /samples/assets/racer has a different RGB value: (R: 102, G: 34, B: 238)? Is there a special meaning for the zero value?<br />
<br />
Thanks!]]></description>
			<content:encoded><![CDATA[Hey Marc,<br />
<br />
I have a question about the TLN_Palette's first color. Why is it that TLN_SetPaletteColor always sets the first color (index 0) to 0, even though the ACT palette in /samples/assets/racer has a different RGB value: (R: 102, G: 34, B: 238)? Is there a special meaning for the zero value?<br />
<br />
Thanks!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Suggestion] Reziseable window on runtime, limited FPS, and shaders]]></title>
			<link>http://tilengine.org/forum/showthread.php?tid=2290</link>
			<pubDate>Fri, 31 Mar 2023 09:37:21 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://tilengine.org/forum/member.php?action=profile&uid=1831">System64</a>]]></dc:creator>
			<guid isPermaLink="false">http://tilengine.org/forum/showthread.php?tid=2290</guid>
			<description><![CDATA[Hi, I hope you're fine<br />
I have a suggestion for the engine. We can change the size of the window to 1x, 2x, 3x, 4x and 5x. But as far as I know, we cannot change the size on runtime. Is it possible to do this? If yes, it would be a nice idea to have this feature.<br />
<br />
Another suggestion is being able to limit FPS on Tilengine. VSync is nice, but the problem is some people (me for example) have a screen with an higher refresh rate (my screen is 144Hz), so, the game will run faster. I can limit the FPS manually with something like sleep(); but wouldn't the frame callback still be affected by the refresh rate?<br />
<br />
I also have another question. Is it possible to use a shader with Tilengine (since SDL2 supports shaders) or do I have to use Tilengine as a slave renderer, then use the raw pixel data generated by Tilengine as a texture?<br />
<br />
Thanks a lot for your answers!]]></description>
			<content:encoded><![CDATA[Hi, I hope you're fine<br />
I have a suggestion for the engine. We can change the size of the window to 1x, 2x, 3x, 4x and 5x. But as far as I know, we cannot change the size on runtime. Is it possible to do this? If yes, it would be a nice idea to have this feature.<br />
<br />
Another suggestion is being able to limit FPS on Tilengine. VSync is nice, but the problem is some people (me for example) have a screen with an higher refresh rate (my screen is 144Hz), so, the game will run faster. I can limit the FPS manually with something like sleep(); but wouldn't the frame callback still be affected by the refresh rate?<br />
<br />
I also have another question. Is it possible to use a shader with Tilengine (since SDL2 supports shaders) or do I have to use Tilengine as a slave renderer, then use the raw pixel data generated by Tilengine as a texture?<br />
<br />
Thanks a lot for your answers!]]></content:encoded>
		</item>
	</channel>
</rss>