Exemplo n.º 1
0
// Read and process NexusZone format used in Zap -- we need this for backwards compatibility
void NexusZone::processArguments_ArchaicZapFormat(S32 argc, const char **argv, F32 gridSize)
{
    Point pos;
    pos.read(argv);
    pos *= gridSize;

    Point ext(50, 50);

    if(argc == 4)
        ext.set(atoi(argv[2]), atoi(argv[3]));

    addVert(Point(pos.x - ext.x, pos.y - ext.y));   // UL corner
    addVert(Point(pos.x + ext.x, pos.y - ext.y));   // UR corner
    addVert(Point(pos.x + ext.x, pos.y + ext.y));   // LR corner
    addVert(Point(pos.x - ext.x, pos.y + ext.y));   // LL corner

    updateExtentInDatabase();
}
Exemplo n.º 2
0
// Create objects from parameters stored in level file
// LineItem <team> <width> <x> <y> ...
bool LineItem::processArguments(S32 argc, const char **argv, Level *level)
{
   if(argc < 6)
      return false;

   setTeam (atoi(argv[0]));
   setWidth(atoi(argv[1]));

   int firstCoord = 2;
   if(strcmp(argv[2], "Global") == 0)
   {
      mGlobal = true;
      firstCoord = 3;
   }
   else
      mGlobal = false;

   readGeom(argc, argv, firstCoord, level->getLegacyGridSize());

   updateExtentInDatabase();

   return true;
}
Exemplo n.º 3
0
void LineItem::onGhostAddBeforeUpdate(GhostConnection* connection)
{
   Parent::onGhostAddBeforeUpdate(connection);
   updateExtentInDatabase();
}