Example #1
0
Granary::Granary()
{
   setType(B_GRANARY);
   setMaxWorkers(5);
   setWorkers(0);

   _size = 3;
   setPicture(PicLoader::instance().get_picture( rcCommerceGroup, 140));
   _fgPictures.resize(6);  // 1 upper level + 4 windows + animation
   int maxQty = 2400;
   _goodStore.setMaxQty(maxQty);
   _goodStore.setMaxQty(G_WHEAT, maxQty);
   _goodStore.setMaxQty(G_MEAT, maxQty);
   _goodStore.setMaxQty(G_FISH, maxQty);
   _goodStore.setMaxQty(G_FRUIT, maxQty);
   _goodStore.setMaxQty(G_VEGETABLE, maxQty);

   _goodStore.setCurrentQty(G_WHEAT, 300);

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, rcCommerceGroup, 146, 7);
   // do the animation in reverse
   animLoader.fill_animation_reverse(_animation, rcCommerceGroup, 151, 6);
   PicLoader& ldr = PicLoader::instance();

   _fgPictures[0] = &ldr.get_picture( rcCommerceGroup, 141);
   _fgPictures[5] = _animation.get_current_picture();
   computePictures();
}
Example #2
0
Baths::Baths() : ServiceBuilding(S_BATHS)
{
   setType(B_BATHS);
   _size = 2;
   setPicture(PicLoader::instance().get_picture("security", 21));

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "security", 22, 10);
   animLoader.change_offset(_animation, 23, 25);
   _fgPictures.resize(2);
}
Example #3
0
TempleOracle::TempleOracle() : ServiceBuilding(S_TEMPLE_ORACLE)
{
   setType(B_TEMPLE_ORACLE);
   _size = 2;
   setPicture(PicLoader::instance().get_picture("security", 55));
   
  AnimLoader animLoader(PicLoader::instance());
  animLoader.fill_animation(_animation, "security", 56, 6);
  animLoader.change_offset(_animation, 9, 30);
  _fgPictures.resize(1);   
}
Example #4
0
BuildingCollosseum::BuildingCollosseum() : EntertainmentBuilding(S_COLLOSSEUM)
{
   setType(B_COLLOSSEUM);
   _size = 5;
   setPicture(PicLoader::instance().get_picture("entertainment", 36));

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "entertainment", 37, 13);
   animLoader.change_offset(_animation, 122, 81);
   _fgPictures.resize(2);
   _fgPictures[0] = &PicLoader::instance().get_picture("entertainment", 50);
}
Example #5
0
BuildingAmphiTheater::BuildingAmphiTheater() : EntertainmentBuilding(S_AMPHITHEATER)
{
   setType(B_AMPHITHEATER);
   _size = 3;
   setPicture(PicLoader::instance().get_picture("entertainment", 1));

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "entertainment", 2, 10);
   animLoader.change_offset(_animation, 100, 49);
   _fgPictures.resize(2);
   _fgPictures[0] = &PicLoader::instance().get_picture("entertainment", 12);
}
Example #6
0
BuildingTheater::BuildingTheater() : EntertainmentBuilding(S_THEATER)
{
   setType(B_THEATER);
   _size = 2;
   setPicture(PicLoader::instance().get_picture("entertainment", 13));

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "entertainment", 14, 21);
   animLoader.change_offset(_animation, 60, 36);
   _fgPictures.resize(2);
   _fgPictures[0] = &PicLoader::instance().get_picture("entertainment", 35);
}
Example #7
0
TriumphalArch::TriumphalArch()
{
  setType(B_TRIUMPHAL_ARCH);
  _size = 3;
  setPicture(PicLoader::instance().get_picture("land3a", 43));
  getPicture().set_offset(0,116);
  AnimLoader animLoader(PicLoader::instance());
  animLoader.fill_animation(_animation, "land3a", 44, 1);
  animLoader.change_offset(_animation, 63, 97);
  _fgPictures.resize(1);
  _fgPictures.at(0) = _animation.get_current_picture(); 
}
Example #8
0
Dock::Dock()
{
  setType(B_DOCK);
  _size = 2;
  setPicture(PicLoader::instance().get_picture("transport", 5));  

  AnimLoader animLoader(PicLoader::instance());
  animLoader.fill_animation(_animation, "transport", 6, 11);
  // now fill in reverse order
  animLoader.fill_animation_reverse(_animation, "transport", 15, 10);
  
  animLoader.change_offset(_animation, 107, 61);
  _fgPictures.resize(1);  
}
Example #9
0
Reservoir::Reservoir()
{
  setType(B_RESERVOIR);
  setPicture( PicLoader::instance().get_picture( rcUtilityGroup, 34) );
  _size = 3;
  
  // utilitya 34      - emptry reservoir
  // utilitya 35 ~ 42 - full reservoir animation
 
  AnimLoader animLoader(PicLoader::instance());
  animLoader.fill_animation(_animation, rcUtilityGroup, 35, 8);
  animLoader.fill_animation_reverse(_animation, rcUtilityGroup, 42, 7);
  animLoader.change_offset(_animation, 47, 63);
  _fgPictures.resize(1);
  //_fgPictures[0]=;
}
Example #10
0
Market::Market() : ServiceBuilding(S_MARKET)
{
   setType(B_MARKET);
   setMaxWorkers(5);
   setWorkers(0);

   _marketBuyer = NULL;
   _buyerDelay = 10;
   _size = 2;
   // _name = _("Marche");
   setPicture(PicLoader::instance().get_picture("commerce", 1));
   _fgPictures.resize(1);  // animation

   _goodStore.setMaxQty(5000);
   _goodStore.setMaxQty(G_WHEAT, 400);
   _goodStore.setMaxQty(G_POTTERY, 300);
   _goodStore.setCurrentQty(G_WHEAT, 200);

   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "commerce", 2, 10);
}
Example #11
0
void akBLoader::loadFile(const utString &filename, bool sortByMat, bool openglVertexColor)
{
	fbtBlend fp;

	if (fp.parse(filename.c_str(), fbtFile::PM_COMPRESSED) != fbtFile::FS_OK)
	{
		return;
	}
	
	// current scne
	Blender::Scene* bscene = fp.m_fg->curscene;
	
	//animations
	akAnimationLoader animLoader(m_demo);
	animLoader.convertActions(fp.m_action, fp.getVersion() <= 249, bscene->r.frs_sec);
	
	//convert camera
	convertCameraObject(bscene->camera);
	
	//objects of the active scene
	for (Blender::Base* base = (Blender::Base*)bscene->base.first; base; base = base->next)
	{
		if (!base->object)
			continue;

		Blender::Object* bobj = base->object;

		// test for usable object type
		if(bobj->type == OB_MESH)
		{
			convertObjectMesh(bobj);
			
			akEntity* entity = m_demo->getEntity(AKB_IDNAME(bobj));
			animLoader.convertObject(entity, bobj, fp.getVersion() <= 249, bscene->r.frs_sec);
		}
	}
}
Example #12
0
BuildingFountain::BuildingFountain() : ServiceBuilding(S_FOUNTAIN)
{
   setType(B_FOUNTAIN);
   _size = 1;
   
   int id;
   
   std::srand(std::time(NULL));
   
   id = std::rand() % 4;
   
   std::cout << id << std::endl;
   
   setPicture(PicLoader::instance().get_picture("utilitya", 26));
   AnimLoader animLoader(PicLoader::instance());
   animLoader.fill_animation(_animation, "utilitya", 27, 7);
   //animLoader.fill_animation_reverse(_animation, "utilitya", 25, 7);
   animLoader.change_offset(_animation, 14, 26);
  _fgPictures.resize(1);
   
  //2 10 18 26
  // utilitya 10      - empty 
  // utilitya 11 - 17 - working fontain
   
  // the first fountain's (10) ofsets ~ 11, 23 
  /*AnimLoader animLoader(PicLoader::instance());
  animLoader.fill_animation(_animation, "utilitya", 11, 7); 
  animLoader.change_offset(_animation, 11, 23);
  _fgPictures.resize(1);*/
  
  // the second (2)    ~ 8, 42
  // the third (18)    ~ 8, 24
  // the 4rd   (26)    ~14, 26
   
   
}