Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// describe variables. 
void TestCube::debugListVariables(
  mgStringArray& varNames,
  mgStringArray& helpText) 
{
  // add the superclass variables
  MovementApp::debugListVariables(varNames, helpText);

  // add a variable of our own
  varNames.add("animate");
  helpText.add("set animation \"on\" or \"off\"");
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
// describe functions.  
void TestCube::debugListFunctions(
  mgStringArray& funcNames,
  mgStringArray& funcParms,
  mgStringArray& helpText) 
{
  // add the superclass functions
  MovementApp::debugListFunctions(funcNames, funcParms, helpText);

  // add a function of our own
  funcNames.add("reset");
  funcParms.add("");
  helpText.add("reset scene");
}
Ejemplo n.º 3
0
//--------------------------------------------------------------
// return list of system font directories
void mgWinServices::getFontDirectories(
  mgStringArray& fontDirs)
{
  WCHAR winDir[MAX_PATH];
  GetWindowsDirectory(winDir, MAX_PATH);

  mgString fontPath;
  fontPath.format("%ls\\Fonts\\", winDir);

  fontDirs.add(fontPath);
}
Ejemplo n.º 4
0
//--------------------------------------------------------------
// read the font list
void readFontList()
{
  char winDir[MAX_PATH];
  GetWindowsDirectory(winDir, sizeof(winDir));

  mgString fontPath;
  fontPath.format("%s\\Fonts\\", winDir);
  mgDebug("windows font dir is %s", (const char*) fontPath);

  m_fontDirs.add(fontPath);
  m_fontList = new mgFontList("docs\\fonts.xml");
}
Ejemplo n.º 5
0
//--------------------------------------------------------------
// scan directory for font files
void mgScriptPlatform::scanFontDir(
  mgStringArray& fontDirs,
  const char* dirName)
{
  // list contents of directory
  DIR* directory = opendir(dirName);
  if (directory == NULL)
    return;

  // for each item in directory
  BOOL foundFont = false;
  while (true)
  {
    struct dirent* entry = readdir(directory);
    if (entry == NULL)
      break;
    if (entry->d_type == DT_DIR)
    {
      mgString fileName;
      fileName.format("%s/%s", dirName, entry->d_name);
      // scan subdirectory
      if (entry->d_name[0] != '.')
        scanFontDir(fontDirs, fileName);
    }
    else if (!foundFont)
    {
      // if a font file found, add directory to list
      char* dot = strrchr(entry->d_name, '.');
      if (dot != NULL && strcmp(dot, ".ttf") == 0)
      {
        mgString saveName(dirName);
        if (!saveName.endsWith("/"))
          saveName += "/";
        fontDirs.add(saveName);
        foundFont = true;
      }
    }
  }
  closedir(directory);
}
Ejemplo n.º 6
0
//--------------------------------------------------------------
// return list of system font directories
void mgOSXServices::getFontDirectories(
  mgStringArray& fontDirs)
{
  fontDirs.add("/Library/Fonts/");
}
Ejemplo n.º 7
0
//-----------------------------------------------------------------------------
// describe variables. 
void SeaOfMemes::debugListVariables(
  mgStringArray& varNames,
  mgStringArray& helpText) 
{
  varNames.add("eyePt.x");
  helpText.add("Eye x coordinate");

  varNames.add("eyePt.y");
  helpText.add("Eye y coordinate");

  varNames.add("eyePt.z");
  helpText.add("Eye z coordinate");

  varNames.add("planetDayLen");
  helpText.add("Planet rotation time (seconds)");

  varNames.add("moonDayLen");
  helpText.add("Moon rotation time (seconds)");

  varNames.add("ringDayLen");
  helpText.add("Ringworld rotation time (seconds)");

  varNames.add("moonMonthLen");
  helpText.add("Moon orbit time (seconds)");

  varNames.add("beltMonthLen");
  helpText.add("Belt orbit time (seconds)");
}