Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

Building the Patch

Generating patches for Torque can be a bit tricky at first. Here is a description of the process of modifying the code, generating and testing the patch.

Patch Tools

To build the patch you'll need a command line version of CVS, which is included with the Windows version of WinCVS. You'll also need the "patch" program to test your patches. This program is part of the WinCVS 1.2 release, however Windows WinCVS 1.3 and Mac users will need to install it manually. Windows users can get "patch" as part of the GNU utilities for Win32.

The cvs and patch tools are run from the command-line so you'll have to make sure the WinCVS and the patch tool directories are added to your command line search path.

Making Your Changes

When getting ready to work on a patch, make sure you start with a clean copy of the HEAD revision. See the using CVS instructions in the engine set-up guide for information on checking out or updating to the HEAD revision. It's also a good idea to make a copy of this starting point for later testing.

Once you have a clean copy of the SDK, edit the relevent source files and make your changes.

Making the Patch

Once you've made your changes and tested everything, it's time to make the patch file. Once again, you should bring your source tree up to date and make sure that your changes still function correctly.

To generate the patch, you'll need to open up a command-line window (the DOS box), cd into the your torque parent directory and run the cvs diff command: (assuming the SDK is installed in the c:\torque directory.)

        cd c:\torque
        cvs -z3 diff -uN > ..\patchname.patch
    

This command tells cvs to run a "diff", which identifies everything that has been changed, on the entire Torque tree, and store the output of all the changed files into the file patchname.patch. The -u option tells cvs to generate the diff in the "Unified" format.

Warning

Important Note! The cvs diff command will not process any new files added as part of your change. New files must be "manually" included along with the diff when you submit your patch.

Testing the Patch

Testing the patch is the most important part of the patch process. To test the patch you'll need a copy of the SDK source at the current HEAD. If you saved a copy off before you started working on the patch, you can make a test copy of the saved SDK and update it to the HEAD revision.

Apply the patch from the command line: (assuming your test copy of the source is in the "c:\test"):

        cd c:\test
        patch -p0 < ..\patchname.patch
    

If patch complains about anything, or fails to apply part of the patch, you should fix the problems before submitting the patch. If any new files are include as part of the patch, make sure to copy them over at this point.

Next you should build and test the patched SDK. If everything looks good, you're done. Its time to send it in to GarageGames!