Friday, 23 July 2010

Open door

I'm writing a door class for Teemu derived from base object class. Abstract base class is kind of cool, but I still don't know what to do with map routines. Should objects be stored in 2D map anyway? The problem is in collision checking which is fastest when objects are in 2D map, but maybe there are other ways to do that, like a hash map.

Wednesday, 21 July 2010

New name for Stile?

It appears that there is a program called sTile. Stile is actually a dumb name anyway, so I'm planning to change it. Maybe to something that no one really has thought before. Or maybe something traditional like X Paint where X is something like.. I don't know.. Super? Super Paint. Super Mario Paint. Wait, that was already taken.

Power Paint? Taken. Fuck, this is harder than I thought.

Thursday, 15 July 2010

Smudge brush for Stile

It's a small victory: I somehow managed to add smudge brush tool in Stile. Smudge tool is quite easy to implement when you know the idea. I was surprised how nicely it works. Creating smooth edges is easier with smudge and you can do that between all colors, not just with color next to black surface (as with darkening brush). Other new features of (soon to be released) 0.82 are seam tools for scrolling the tile halfway and then working with the seam, and context sensitive F1 (currently only for icons).

Tuesday, 13 July 2010

Debug mode

Running in debug mode (F8) in DevC++ is different than just running the program. It looks like debug mode actually catches errors, because it found one that crashed the program after new tileset was made (in Stile). And gdb knew where the problem was. Way! I really need to run in debug mode more often, even gdb output can be cryptic. It's now complaining something about st_copy, I don't know why. Nothing special going on with st_copy.

Monday, 12 July 2010

Memory corruption in Stile

Trying to find a mem corruption bug from Stile. It's quite difficult with DevC++ (gcc), because gdb is not very good at catching errors. I may have to re-create a Visual C++ project for Stile to find the bug. Another option is refactor some shit and hope for the best. In worst case the bug has existed for a long time in some part of the source code. I guess it's about time to find out where it is.

The bug was a trailing zero type. strlen() returns the length without the trailing zero so you need to add it to the buffer given to strcpy which copies also the trailing zero to destination.

Thursday, 1 July 2010


The rewrite of Teemu is getting harder. The shift from one object class to derived hierarchy has really big impact on other areas of the source code. I also try to plan better ways to do things like game object creation and in that there can be moments when you don't know what to do. And, as we all know, it's the worst thing that can happen. Not knowing what to do next. How to proceed, how to solve a particular problem.