示例#1
0
文件: Bitmap.cpp 项目: macsux/XCSoar
bool
Bitmap::Reload()
{
  assert(id != 0);
  assert(texture == NULL);

  texture = LoadResourceTexture(id);
  if (texture == NULL)
    return false;

  width = texture->get_width();
  height = texture->get_height();
  return true;
}
示例#2
0
bool
Bitmap::Reload()
{
  assert(id != 0 || !pathName.empty());
  assert(texture == NULL);

  texture = (id != 0) ? LoadResourceTexture(id) :
                        LoadFileTexture(pathName.c_str());
  if (texture == NULL)
    return false;

  size.cx = texture->GetWidth();
  size.cy = texture->GetHeight();
  return true;
}
示例#3
0
bool
Bitmap::Reload()
{
  assert(id.IsDefined() || !pathName.empty());
  assert(texture == nullptr);

  texture = id.IsDefined()
    ? LoadResourceTexture(id, type)
    : LoadFileTexture(pathName.c_str());
  if (texture == nullptr)
    return false;

  size.cx = texture->GetWidth();
  size.cy = texture->GetHeight();
  return true;
}