Skip to content

Learning the Code

Caffeinix edited this page Jun 25, 2012 · 1 revision

Once you have successfully built MCModeler, you're ready to crack it open and make some changes. By far your most helpful tool in this (apart from a text editor and compiler, obviously) is Doxygen. All of the documentation in MCModeler is designed to be compatible with Doxygen, and there's a Doxyfile pre-made for your convenience at the top level of the repository. Just run Doxygen on it, sit back for a few seconds, and you'll have your very own set of shiny new documentation for the entire codebase.

If you're just looking to get in and get out as quickly as possible, here are some pointers (well, more like references) to get you started:

Rendering

Take a look at the Renderable interface (renderable.h) and the BasicRenderable class (basic_renderable.h). Also look at GLWidget (gl_widget.h).

Adding and Removing Blocks (new tools, batch operations, etc)

The Diagram class (diagram.h) is the model for all the block data. Every modification to the world must go through it, so start there. See also the Tool interface (tool.h), though it's not widely used quite yet.

2D Drawing

The LevelWidget class (level_widget.h) is responsible for all 2D drawing.

Clone this wiki locally