本文整理汇总了C++中Surface::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Surface::Clear方法的具体用法?C++ Surface::Clear怎么用?C++ Surface::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surface
的用法示例。
在下文中一共展示了Surface::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EffectsBlit
void Surface::EffectsBlit(int x, int y, Bitmap* src, Rect src_rect,
int top_opacity, int bottom_opacity, int opacity_split,
const Tone& tone,
double zoom_x, double zoom_y, double angle,
int waver_depth, double waver_phase) {
bool rotate = angle != 0.0;
bool scale = zoom_x != 1.0 || zoom_y != 1.0;
bool waver = waver_depth != 0;
bool tone_change = tone != Tone();
bool opacity =
(opacity_split <= 0) ? (top_opacity < 255) :
(opacity_split >= src_rect.height) ? (bottom_opacity < 255) :
(top_opacity < 255 || bottom_opacity < 255);
opacity = top_opacity < 255 || bottom_opacity < 255;
Surface* draw = (Surface*) NULL;
if (tone_change) {
if (!rotate && !scale && !opacity && !waver) {
ToneBlit(x, y, src, src_rect, tone);
return;
}
bool transparent = src->GetTransparent();
draw = CreateSurface(src_rect.width, src_rect.height, transparent);
if (transparent)
draw->Clear();
draw->ToneBlit(0, 0, src, src_rect, tone);
src = draw;
src_rect.x = 0;
src_rect.y = 0;
}
if (rotate) {
Matrix fwd = Matrix::Setup(angle, zoom_x, zoom_y, src_rect.x, src_rect.y, x, y);
EffectsBlit(fwd, src, src_rect, top_opacity, bottom_opacity, opacity_split);
}
else if (scale)
EffectsBlit(x, y, src, src_rect,
top_opacity, bottom_opacity, opacity_split,
zoom_x, zoom_y,
waver_depth, waver_phase);
else
EffectsBlit(x, y, src, src_rect,
top_opacity, bottom_opacity, opacity_split,
waver_depth, waver_phase);
if (draw != NULL)
delete draw;
}