コード例 #1
0
ファイル: map.cpp プロジェクト: csellsword/planeswalker
void Map::expand(MapNode *node){
	unsigned int x, y;
	if(canSplit(node,x,y)){
		if((x>ROOM_MAX+2) && (y>ROOM_MAX+2)){
			//pick a split and do it
			if(mapRNG->getInt(0,9) > 4) splitX(node);
			else splitY(node);
		}else if(y > ROOM_MAX+2){
			splitY(node);
		}else{
			splitX(node); 
		}
	}else return;
}	
コード例 #2
0
bool ITR3DMImport::import(const char* file, ITRGeometry* geometry,
	Vector<UInt32>* volumeMasks)
{
   TPlaneF::DistancePrecision = distancePrecision;
   TPlaneF::NormalPrecision   = normalPrecision;
   char buff[256];

   //
   printf("Thred.3DM Import\n");

   PolyList polyList;
   printf("   Importing...");
   import(file,&polyList);

#if 0
	// This is now down by Zed.
   // Texture mapping
   printf("Texturing...");
   for (int i = 0; i < polyList.size(); i++)
      boxMap(polyList[i]);
#endif

   // Split polys whose textures are larger than 256x256
   printf("Splitting...");
   for (int i = 0; i < polyList.size(); i++) {
      Poly* poly = polyList[i];
      if (poly->textureSize.x > splitDist)
         splitX(poly,&polyList);
      if (poly->textureSize.y > splitDist)
         splitY(poly,&polyList);
   }

   printf("Material Sorting...");
   sortByMaterial(polyList);

   if (lowDetailInterior == false) {
      // Insert colinear vertices into polygons
      printf("SharedVertices...");
      insertVertices(polyList);
   } else {
      printf("LowDetail (Shared Vertices not inserted)...");
      geometry->setFlag(ITRGeometry::LowDetailInterior);
   }

   //
   printf("Export...");
   exportToGeometry(polyList, geometry, volumeMasks);
   geometry->highestMipLevel = maxMipLevel;
   printf("\n");

   //
   printf("   Vertices: %d\n", geometry->point3List.size());
   printf("   Surfaces: %d\n", geometry->surfaceList.size());
   printf("   Planes: %d\n",   geometry->planeList.size());
   return true;
}