Mappy tile mapping system now available for Allegro 5
Neil Walker

I've been beavering away and have an Allegro 5 version of mappy tilemap system ( and would appreciate your perusal. I've been using mappy for a long time and I think it's really really good and more people should use it :)

- standard square tilemap
- hex based tiles
- staggered isometric maps
- parallax scrolling
- embedded graphics
- embedded animations
- supports 8, 15,16,24,32 bit map files
- 8 layers, each layer comprising 1 background and 3 foreground tiles for extra layering
- each tile can have many custom variables associated
- extendible through your own data chunks in the file
- simple interface for use
- complete editor for tilemaps with onion skinning, lua support (for scripting such as auto smoothing, GBA support), etc (this is for windows only, but works fine under wine)
- I use the allegro file handlers so should work with physfs
- conversion of pink/black/index 0 to alpha if required

- demo includes a mix of 8 and 32 bit maps in standard, hex and iso format with animated tiles and parallax. Sorry, the scrolling is a bit pants with regard smoothness, that's just my coding :)

- readme containing functions
- html documentation describing how mappy works and how to use it plus the file format, etc


1. Add the mappy_a5.c to your project
2. Add the mappy_a5.h to your project
3. Include the header in your game and compile. Note, the file must be compiled as C not C++

The demo was compiled using the allegro-5.0.2-monolith-md library and visual studio 2010 so you will need this dll handy and I don't know about the effects of a visual studio exe is on non-msvc systems.

Get it from the attachment.

Quick Usage:
Essentially, read the demo1.c, it's self-explanatory.

1. Load the map using MapLoad() passing in the file and whether you want black/pink/index 0 converting to alpha channel
2. Use MapFreeMem() when finished
3. Use MapDrawBG() to draw background and MapDrawFG() to draw foreground tile layers
4. Use MapUpdateAnims() to update animations
5. Various helper functions to get/set tiles, etc.

This is first version so there may be issues :)

Edgar Reynaldo

3. Include the header in your game and compile. Note, the file must be compiled as C not C++

If the code in the header is defined as "extern C" there shouldn't be a problem compiling as C++, right? Or is it something else?

Neil Walker

Yes, it is, but I think it's more to do with the exotic use of void pointers and non-casting :)

But it's not an issue really, if you are coding in C++, in MSVC it works by file extension (but you can just tell it to compile that file as c and mix c/c++ files), and in mingw editors you probably need to compile the .c to a .o and use that instead first.

Thread #606962. Printed from