Results 1 to 8 of 8

Thread: 2D tileset generator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    This is great idea and it is already on To-Do list for my program. But as I sad before you probably don't wanna wait for me as my program probably won't be finished soon.

  2. #2
    Yep, i won't wait You can track progress here if want:
    http://code.google.com/p/nxpascal/so...ools%2Ftilegen

    It is much more complicated structure than one could imagine at first glance. I'm still working out some details, but i believe that after (propably) finishing "Tile styles"-dialog today, it cleared up alot. Also found and reported a Lazarus bug in the process... everybody benefits, lol.

    Also experimented temporarily with class default properties with record array as type, it failed. I won't need it now, but is it even possible to get such working? Something like (simplified):
    Code:
    type
      TTileStyle = record
        name: string;
        ...
      end;
    
      TTileStyles = class
      private
        FStyle: array of TTileStyle;
        function GetStyle(index: integer): TTileStyle;
        procedure SetStyle(index: integer; value: TTileStyle);
      public
        property style[index: integer]: TTileStyle read GetStyle write SetStyle; default;
      end;
    ...
    function TTileStyles.GetStyle(index: integer): TTileStyle;
    begin
      result:=FStyle[index];
    end;
    
    procedure TTileStyles.SetStyle(index: integer; value: TTileStyle);
    begin
      FStyle[index]:=value;
    end;
    I tried above'ish code, it compiles and all. But when i changed value from some record, it didn't change. Reading propably worked. I have a guess that it should've been pointer to record, so writing would work.
    Also another problem with "name" clashing with propably some internal "name" related to default parameter.

  3. #3
    A quick glympse at your code shows that you are using dynamical array but have no mechanizm for modifying array size. You can't save any data into array if it doesn't have any elemets as newly created dynamica arrays have.

  4. #4
    I am using SetLength(). See function TTileStyles.Add() or Delete():
    http://code.google.com/p/nxpascal/so...leUnit.pas#164

    You don't even need to have variable to track array size. Length() and High() ( = Length()-1 ) can be used to retrieve that information.

  5. #5
    Oh, as you saw in other thread, i took an entirely different approach for tile blending. Making of this tool was cancelled for few other reasons aswell... to put it with simple words: it was complicated, and no clear purpose.

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
  •