Пример #1
0
void AppWarmux::DisplayLoadingPicture()
{
  Config *config = Config::GetInstance();

  std::string txt_version =
    _("Version") + std::string(" ") + Constants::WARMUX_VERSION;
  std::string filename = config->GetDataDir() + "menu" PATH_SEPARATOR "background_loading.jpg";

  Surface surfaceLoading(filename.c_str());
  Sprite loading_image(surfaceLoading);

  loading_image.ScaleSize(video->window.GetSize());
  loading_image.Blit(video->window, 0, 0);

  GameTime::GetInstance()->Reset();

  Text text1(_("Warmux launching..."), white_color,
             Font::FONT_HUGE, Font::FONT_BOLD, true);
  Text text2(txt_version, white_color, Font::FONT_HUGE, Font::FONT_BOLD,
             true);

  Point2i windowCenter = video->window.GetSize() / 2;

  text1.DrawCenter(windowCenter);
  text2.DrawCenter(windowCenter
                   + Point2i(0, Font::GetInstance(Font::FONT_HUGE, Font::FONT_BOLD)->GetHeight() + 20));

  video->window.Flip();
}
Пример #2
0
std::string GameMode::GetObjectsFilename() const
{
  Config * config = Config::GetInstance();
  std::string filename = std::string("game_mode" PATH_SEPARATOR)
                       + m_current + std::string("_objects.xml");

  std::string fullname = config->GetPersonalDataDir() + filename;

  if (!DoesFileExist(fullname))
    fullname = config->GetDataDir() + filename;

  if (!DoesFileExist(fullname)) {
    std::cerr << "Game mode: File " << fullname
      << " does not exist, use the default one instead." << std::endl;
  }

  fullname = config->GetDataDir() + GetDefaultObjectsFilename();
  if (!DoesFileExist(fullname)) {
    Error(Format("Can not find file %s", fullname.c_str()));
  }

  return fullname;
}
Пример #3
0
std::string GameMode::GetFilename() const
{
  Config * config = Config::GetInstance();
  std::string filename = std::string("game_mode" PATH_SEPARATOR)
                       + m_current + std::string(".xml");

  std::string fullname = config->GetPersonalDataDir() + filename;

  if (!DoesFileExist(fullname))
    fullname = config->GetDataDir() + filename;

  if (!DoesFileExist(fullname)) {
    Error(Format("Can not find file %s", fullname.c_str()));
  }

  return fullname;
}