Organizing the sources and assets

Downloads

Source code
Executable (Windows 32bits)

Before you try to compile the code go to the "Projects" tab on the left menu, select the "Run" settings for your kit,
and set the "Working directory" to the path of "editor/data".

Structuring the files

As we work we will have more and more source files and datas and it will be very difficult to retrieve them if we keep them all in the same folder.
Additionnaly, we will not only have the map editor project, but also another project for the game itself. And some files will be common to the two projects.
So we will reorganize the files a little bit.

First we will have a "common" folder that will contain:
I put the cmaths.* and the cgraphics2d.* files in a "system" subfolder because these are common functions which could have their place in a more generic engine
that could be used for others types of games.

Then we will have an "editor" folder with:

In the future, there will be a 3rd folder for the game.

New functions


I added tools buttons on the right. They do not work yet, but I wanted to see how much size they would take.
From top to bottom we can see:
You can see that the functions at the end of "editor.cpp" begins to take into account that there will be several tools.

And now we can draw walls. To achieve that I had to modify drawImage() so that it can draw a rotated tile.
The image of the wall is "Wall.png" in "editor\data\tiles"