Results 1 to 10 of 24

Thread: Tilengine 2D Pascal Wrapper!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Code:
    //  load layer (tileset + tilemap)
    
    //      tileset = TLN_LoadTileset ("Sonic_md_bg1.tsx");
      tileset := uTileEngine.LoadTileset('Sonic_md_bg1.tsx'); 
    
    //      tilemap = TLN_LoadTilemap ("Sonic_md_bg1.tmx", "Layer 1");
      tilemap := uTileEngine.LoadTileMap('Sonic_md_bg1.tmx', 'Layer 1');
    Commented lines are from the C example.

    Pascal header:
    function LoadTileset(filename : string) : Pointer; cdecl; external dllname name 'TLN_LoadTileset';
    function LoadTilemap(filename, layername : string) : Pointer; cdecl; external dllname name 'TLN_LoadTilemap';

    Should be:
    function LoadTileset(filename : PAnsiChar) : Pointer; cdecl; external dllname name 'TLN_LoadTileset';
    function LoadTilemap(filename, layername : PAnsiChar) : Pointer; cdecl; external dllname name 'TLN_LoadTilemap';

    and possibly for many others lines in the header...
    Last edited by Thyandyr; 01-06-2017 at 07:14 PM.

  2. #2
    How do I use this without the built-in windowing?

    SetRenderTarget sounds like it might do the trick, but how do I get pointer to a framebuffer in VCL?

    Code:
    TLNAPI void TLN_SetRenderTarget     (     
    uint8_t *      data,
    int      pitch
    )
    Sets the output surface for rendering.
    Parameters
    data Pointer to the start of the target framebuffer
    pitch Number of bytes per each scanline of the framebuffer


    I don't get this command. What sort information can be passed in 8 bit pointer? Memory address for lego computer?

    The source is not included so I cannot go look there what is done with the 'data'. Can you add a function returning the array of data created and let the users do what they want with it?

    Haaalp plz I don't understand!
    Last edited by Thyandyr; 01-06-2017 at 09:41 PM.

  3. #3
    I will ask megamarc and return here with answers.

  4. #4
    Quote Originally Posted by Thyandyr View Post
    Code:
    //  load layer (tileset + tilemap)
    
    //      tileset = TLN_LoadTileset ("Sonic_md_bg1.tsx");
      tileset := uTileEngine.LoadTileset('Sonic_md_bg1.tsx'); 
    
    //      tilemap = TLN_LoadTilemap ("Sonic_md_bg1.tmx", "Layer 1");
      tilemap := uTileEngine.LoadTileMap('Sonic_md_bg1.tmx', 'Layer 1');
    Commented lines are from the C example.

    Pascal header:
    function LoadTileset(filename : string) : Pointer; cdecl; external dllname name 'TLN_LoadTileset';
    function LoadTilemap(filename, layername : string) : Pointer; cdecl; external dllname name 'TLN_LoadTilemap';

    Should be:
    function LoadTileset(filename : PAnsiChar) : Pointer; cdecl; external dllname name 'TLN_LoadTileset';
    function LoadTilemap(filename, layername : PAnsiChar) : Pointer; cdecl; external dllname name 'TLN_LoadTilemap';

    and possibly for many others lines in the header...
    Thanks for your changes! Do a pull request in the repo

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •