Compiling the engine

Continuing from where I left, in this blog I will give you an overview of the progress made in the first week of GSoC. As I mentioned previously even though it has only been 1 week since GSoC has started, I have been working on this for quite some time now.

The initial phase of the project involved setting up the engine inside of ScummVM. Luckily, Sev already had the skeleton engine with him. We cloned that repository inside `engines/qdengine`. The next step involved moving the project files into `engines/qdengine` along side the skeleton engine. Since the source code of the engine was open source, this was not a challenge.

  1. This is how the skeleton engine looked like at the beginning of the project.
  2. This is the commit where I add the engine source code.

Once we had the project files inside ScummVM, our first task was to compile the entire source code. This process involved one of two simple methods: either including the “qdengine/core/qd_precomp.h” header in the files and defining unknown types or methods there, or stubbing that portion of the code with the `#if 0` directive. leaving a ‘STUB’ message behind. The end goal of this phase was to minimise the amount of code that was commented out while getting the project to compile.

After adding the majority of the project, my mentor suggested that it would be a good idea to try linking the project to find any missing pieces, and eventually add them. This would prevent us from wasting effort on redundant files. The process of linking the project was straightforward. We needed to find the entry point of the application and put that in the `engine.cpp` fileā€”in my case, this was `qdengine.cpp`. When compiling the program, the compiler would run through all methods called, and if it couldn’t find something, it would give a linker error. I would then grep for the missing identifiers, add their corresponding files, and repeat the process until all errors were resolved.

After roughly 2-3 weeks of hard work, I managed to compile this massive engine. In the following weeks I will work on getting each individual component of the engine to work, and de-STUB those portions that were stubbed initially.

 


Leave a Reply

Your email address will not be published. Required fields are marked *