SDL_isometric source code
I wrote small isometric rendering engine for SDL some time ago. It doesn't have any cool features but it can:
- render maps
- read tilesets from xml files
Screenshots:
shot1
shot2
Some day I'll rewrite it and add some cool features and stuff :)
source code (GNU GPL)
Thanks :)
Maps are constructed in the code like this:
The new version will have parser for XML maps and maybe a binary format too (or transparent compression of those XML files...).
Maps are constructed in the code like this:
testMap.getMapCell (3, 6)->addTile (translator.translate ("stone_floor")); testMap.getMapCell (4, 6)->addTile (translator.translate ("stone_floor")); testMap.getMapCell (5, 6)->addTile (translator.translate ("stone_floor")); testMap.getMapCell (6, 6)->addTile (translator.translate ("stone_floor")); testMap.getMapCell (3, 4)->addTile (translator.translate ("wood_wall01")); testMap.getMapCell (3, 5)->addTile (translator.translate ("wood_window01")); testMap.getMapCell (3, 6)->addTile (translator.translate ("wood_wall01")); testMap.getMapCell (4, 3)->addTile (translator.translate ("wood_wall01")); testMap.getMapCell (3, 3)->addTile (translator.translate ("wood_wall02"));
The new version will have parser for XML maps and maybe a binary format too (or transparent compression of those XML files...).
I think the compressed XML would be better than completely different binary format because then I whould only need to maintain one parser (of course the engine would be flexible enough to allow user to write her own binary format parser optimized for her game...).
My goal is to have some tall buildings and stuff on the screen without OpenGL (3D games locked to isometric view are a joke, really ;)
There is going to be lots of tiles on the screen so I don't want to draw them over and over again every frame. I was thinking on implementing some sort of smart rendering system which only redraws those parts of the buffer (map rendering is done on a separate buffer and the parts of this buffer are blitted to the actual screen surface) that have changed or when scrolling (buffer is bigger than the viewport so redrawing only happens when viewport hits the edges of the buffer). The point is that you would only render the whole buffer when starting the game or when the viewport moves so much that you can't reuse any part of the buffer.
My goal is to have some tall buildings and stuff on the screen without OpenGL (3D games locked to isometric view are a joke, really ;)
There is going to be lots of tiles on the screen so I don't want to draw them over and over again every frame. I was thinking on implementing some sort of smart rendering system which only redraws those parts of the buffer (map rendering is done on a separate buffer and the parts of this buffer are blitted to the actual screen surface) that have changed or when scrolling (buffer is bigger than the viewport so redrawing only happens when viewport hits the edges of the buffer). The point is that you would only render the whole buffer when starting the game or when the viewport moves so much that you can't reuse any part of the buffer.
Compressed XML is not a good solution for a non-procedural map format.
While compressing, say, a 20 MB map file, might be okay, you will still see performance issues with parsing 20 MB of map data that is in XML format.
While compressing, say, a 20 MB map file, might be okay, you will still see performance issues with parsing 20 MB of map data that is in XML format.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement