当前位置: 首页>>代码示例>>C++>>正文


C++ GraphicsObject::computedAlpha方法代码示例

本文整理汇总了C++中GraphicsObject::computedAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsObject::computedAlpha方法的具体用法?C++ GraphicsObject::computedAlpha怎么用?C++ GraphicsObject::computedAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsObject的用法示例。


在下文中一共展示了GraphicsObject::computedAlpha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getRenderingAlpha

int GraphicsObjectData::getRenderingAlpha(const GraphicsObject& go,
                                          const GraphicsObject* parent) {
  if (!parent) {
    return go.computedAlpha();
  } else {
    return int((parent->computedAlpha() / 255.0f) *
               (go.computedAlpha() / 255.0f) * 255);
  }
}
开发者ID:weimingtom,项目名称:rlvm,代码行数:9,代码来源:GraphicsObjectData.cpp

示例2: render

void ColourFilterObjectData::render(const GraphicsObject& go,
                                    const GraphicsObject* parent,
                                    std::ostream* tree) {
  if (go.width() != 100 || go.height() != 100) {
    static bool printed = false;
    if (!printed) {
      printed = true;
      cerr << "We can't yet scaling colour filters." << endl;
    }
  }

  // Lazily create colour object.
  if (!colour_filer_) {
    colour_filer_.reset(graphics_system_.BuildColourFiller(screen_rect_));
  }

  RGBAColour colour = go.colour();
  colour.setAlpha(
      static_cast<int>(colour.a_float() * go.computedAlpha()));
  colour_filer_->Fill(go, colour);

  if (tree) {
    *tree << "  ColourFilterObjectData" << std::endl
          << "  Screen rect: " << screen_rect_ << std::endl
          << "  Colour: " << colour << std::endl
          << "  Properties: ";
    PrintGraphicsObjectToTree(go, tree);
    *tree << endl;
  }
}
开发者ID:Morlok8k,项目名称:rlvm,代码行数:30,代码来源:ColourFilterObjectData.cpp

示例3: render

void ColourFilterObjectData::render(const GraphicsObject& go,
                                    const GraphicsObject* parent,
                                    std::ostream* tree) {
  if (go.mono() == 0) {
    RGBAColour colour = go.colour();
    colour.setAlpha(
        static_cast<int>(colour.a_float() * go.computedAlpha()));

    graphics_system_.fillScreenArea(screen_rect_, colour);

    if (tree)
      objectInfo(*tree);
  } else {
    static bool printed = false;
    if (!printed) {
      printed = true;
      cerr << "We don't yet deal with objMono() and colour filters." << endl;
    }
  }
}
开发者ID:sd542927172,项目名称:rlvm,代码行数:20,代码来源:ColourFilterObjectData.cpp


注:本文中的GraphicsObject::computedAlpha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。