本文整理汇总了C++中Blitter::CopyFromBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ Blitter::CopyFromBuffer方法的具体用法?C++ Blitter::CopyFromBuffer怎么用?C++ Blitter::CopyFromBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blitter
的用法示例。
在下文中一共展示了Blitter::CopyFromBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NetworkUndrawChatMessage
/** Hide the chatbox */
void NetworkUndrawChatMessage()
{
/* Sometimes we also need to hide the cursor
* This is because both textmessage and the cursor take a shot of the
* screen before drawing.
* Now the textmessage takes his shot and paints his data before the cursor
* does, so in the shot of the cursor is the screen-data of the textmessage
* included when the cursor hangs somewhere over the textmessage. To
* avoid wrong repaints, we undraw the cursor in that case, and everything
* looks nicely ;)
* (and now hope this story above makes sense to you ;))
*/
if (_cursor.visible &&
_cursor.draw_pos.x + _cursor.draw_size.x >= _chatmsg_box.x &&
_cursor.draw_pos.x <= _chatmsg_box.x + _chatmsg_box.width &&
_cursor.draw_pos.y + _cursor.draw_size.y >= _screen.height - _chatmsg_box.y - _chatmsg_box.height &&
_cursor.draw_pos.y <= _screen.height - _chatmsg_box.y) {
UndrawMouseCursor();
}
if (_chatmessage_visible) {
Blitter *blitter = BlitterFactory::GetCurrentBlitter();
int x = _chatmsg_box.x;
int y = _screen.height - _chatmsg_box.y - _chatmsg_box.height;
int width = _chatmsg_box.width;
int height = _chatmsg_box.height;
if (y < 0) {
height = max(height + y, min(_chatmsg_box.height, _screen.height));
y = 0;
}
if (x + width >= _screen.width) {
width = _screen.width - x;
}
if (width <= 0 || height <= 0) return;
_chatmessage_visible = false;
/* Put our 'shot' back to the screen */
blitter->CopyFromBuffer(blitter->MoveTo(_screen.dst_ptr, x, y), _chatmessage_backup, width, height);
/* And make sure it is updated next time */
_video_driver->MakeDirty(x, y, width, height);
_chatmessage_dirty = true;
}
}