Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Tilengine 2D Pascal Wrapper!

  1. #11
    Hi megamarc79,

    on website there are some examples but i don't found Pseudo 3D road (scaling). Can you share some example about it?

    Thanks
    Sesilla

  2. #12
    Quote Originally Posted by SesillaAndromeda View Post
    Hi megamarc79,

    on website there are some examples but i don't found Pseudo 3D road (scaling). Can you share some example about it?

    Thanks
    Sesilla
    The scaling pseudo 3d road is an unfinished sample I was working on. The still image appears ok, but the effect in motion is wrong so I didn't publish the source code. It's not a limitation of the engine, but a misunderstanding on how to implement the effect corrctly. Some real games that used this technique properly were Namco's Final Lap and Suzuka 8 hours series.

  3. #13
    Hi Pascals and Megamarc!

    I was on my break time and unable to read the post responses, sorry.

    Thanks to Megamarc for the awesome library!

    I will try to port/translate Tilengine Super Mario to Object Pascal with Tilengine Object Pascal Wrapper.

  4. #14
    v1.10 released

    • Improved animation engine with new tileset sequencer
    • Improved spriteset loader with new csv format compatible with Leshy SpriteSheet Tool
    • New blending mode: modulation
    • Many small bugfixes and improvements
    • New "SuperMarioClone" sample that showcases many of the new features

  5. #15

  6. #16
    For Delphi on Windows

    1) Change project output directory to ..\..\..\bin\
    2) In Benchmark method CreateWindow('A', CWF_NONE); instead of CreateWindow(nil, CWF_NONE);
    3) Copy everything from Tilengine-master\lib\win32 to Tilengine-master\bin
    4) Compile
    5) Open command promt to Tilengine-master\bin
    6) Run TileEngine_Benchmark.exe

    Now... that makes the benchmark work. I still have no idea what it does, some odd stuff appears on a window and the exe exits gracefully.

    C:\Users\Admin\Downloads\Tilengine-master\bin>TileEngine_Benchmark.exe
    Tilengine benchmark tool ObjectPascal
    http://www.tilengine.org
    Normal layer..........
    217194570 pixels/s.
    Scaling layer..........
    331034483 pixels/s.
    Affine layer..........
    64602961 pixels/s.
    Blend layer..........
    132780083 pixels/s.
    Scaling blend layer...
    204255319 pixels/s.
    Affine blend layer....
    54825814 pixels/s.
    Affine blend layer....
    423841060 pixels/s.
    Colliding sprites......
    228571429 pixels/s.

    C:\Users\Admin\Downloads\Tilengine-master\bin>
    CPU 12.5%

    The same project in C outputs:

    Tilengine benchmark tool
    Written by Megamarc - Jun 1 2017 19:20:44
    Library version: 1.13.0
    http://www.tilengine.org

    Syntax: benchmark format
    format : pixel format (16 or 32)
    C:\Users\Admin\Downloads\Tilengine-master\bin>

    PS. Got to love the authentic look of old CRT pixels
    Last edited by Thyandyr; 01-06-2017 at 05:32 PM.

  7. #17
    Code:
    var
      Version: Integer;
    
    Begin
    // Get version
      Version := uTileEngine.GetVersion;
      Writeln(
      'Library version: ' + ((Version shr 16) and $FF).ToString +
      '.' + ((Version shr 8 ) and $FF).ToString +
      '.' + (Version and $FF).ToString
    );
    This adds the version number in Delphi as it is the C example.

  8. #18
    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.

  9. #19
    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.

  10. #20
    I will ask megamarc and return here with answers.

Page 2 of 3 FirstFirst 123 LastLast

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
  •