By HazarD

Download the code HERE.

You only need to add a function in world.c called something like
geWorld_SetDistanceFog(geBoolean bEnable, float r, float g, float b, float distance);

Hope this helps. If you have any suggestions, feel free to mail them, or modify the code yourself if you like to extend/improve it somehow.