[tiled-user] Tile instance properties patches

Bjørn Lindeijer bjorn at lindeijer.nl
Sat Nov 4 10:54:10 PST 2006


Hello Christian,

I've looked over and applied the tipfix2.patch and the
propflags1.patch. Some issues should still be fixed and I hope you
want to work on this.

You already pointed out yourself that there are issues with redrawing.
This can be solved by calling MapView#repaintRegion after changing the
properties in any tile region. When this is too complex (or when you
have little time) a temporary solution of just calling MapView#repaint
would suffice.

Another issue I have with the current implementation is that it
requires MapView to reference the MapEditor just to know whether and
for which layer to draw the property flags. This is the wrong way
around. Whether the property flags should be drawn should be an option
of the MapView, and should probably be accompanied by an option saying
for which layer to draw the flags. This would then be synchronized
with the currently selected layer from the MapEditor.

In the TileInstancePropertiesDialog I've added a comment about the
null check you're performing on tiles. I think we had decided that
tile instance properties were just properties set on a certain
location. Whether a tile is null should not have anything to do with
the ability to set properties at that location. Maybe this makes
"propertiesCoordinates" unnecessary?

Finally I've changed the key used in the TileLayer from Integer to
Point. I prefer that since it avoids the calculation that was
necessary to convert x and y to one number. In the MapView#resize
method I made sure to only call the put method when the tile instance
properties are not null, since HashMap does allow null entries there
would otherwise be a lot of these null entries after a layer resize.

Well I think you're making good progress on getting this feature to a
nice state.

Kind regards,
Bjørn

On 10/26/06, Christian Henz <chrhenz at gmx.de> wrote:
> On Wed, Oct 25, 2006 at 05:35:15PM +0200, Christian Henz wrote:
> > On Wed, Oct 25, 2006 at 12:26:23AM +0200, Bjørn Lindeijer wrote:
> > > On 10/24/06, Christian Henz <chrhenz at gmx.de> wrote:
> > > > BTW, the tile instance property feature is broken in trunk. I have a
> > > > patch in the pipeline to fix it, but it is not quite finished yet.
> > >
> > > Yeah I had to break it simply because with the existing implementation
> > > Tiled was running out of memory way too fast. We discussed solving
> > > this with a hash map, is that still the intended solution?
> > >
> >
> > Yes, this is the way I implemented it. The patch is attached.
> >
> > There is still a bug present: The name of a property cannot be changed,
> > instead a new property with the changed name is inserted.
> >
>
> This is fixed now in this new version of the patch.
>
> cheers,
> Christian


More information about the tiled-user mailing list