Project

General

Profile

Development Guidelines

File Paths

Window’s file paths have an interesting feature - they support UNIX style forward slashes in relative paths. They have to begin with an absolute portion however. For example C:\test\dog/file.txt is understood by Windows, but /test/dog/file.txt is not. We can use this to make our code cross-platform. Since Nightshade was originally developed in Linux it makes sense to keep as many paths as possible in that convention. So the plan is to keep Window’s absolute paths only for the root directories in the SystemInfo class. Then all relative paths branching from the roots can remain in UNIX format. OsgDB’s find method returns an absolute path in the current operating system’s file path convention so we don’t have to worry about the paths returned by osg methods. This will allow us to only have to maintain a small number of directories for the Windows build, and minimize confusion about file paths in general.

  • Get root directories using the method in the SystemInfo class that returns the desired path. This will be an absolute path for your operating system.
  • Outside of the SystemInfo class all file paths should use the forward slash. For example, adding a relative path to a root directory returned from SystemInfo.
  • Avoid OsgDB’s find file methods because of performance reasons whenever possible.

Database

  • Do not create database connections from Lua scripts at initial parsing as the DB may not be set up yet. Instead create connections when needed after Nightshade is fully running.

Mercurial Repositories

  • Released code is on the “default” branch
  • Development code is in branches
    • Version branches should be lowercase, like “s20”
    • Feature branches should also be lowercase, like “layerfade”
  • Release tags should be uppercase, like “S20” to avoid conflict with branch names