本文整理汇总了C++中graphicsLib::clear_surface_area方法的典型用法代码示例。如果您正苦于以下问题:C++ graphicsLib::clear_surface_area方法的具体用法?C++ graphicsLib::clear_surface_area怎么用?C++ graphicsLib::clear_surface_area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphicsLib
的用法示例。
在下文中一共展示了graphicsLib::clear_surface_area方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw_dynamic_backgrounds
void classMap::draw_dynamic_backgrounds()
{
//std::cout << "classMap::draw_dynamic_backgrounds stage_number: " << stage_number << ", map_number: " << number << ", bg.r: " << game_data.stages[stage_number].maps[number].background_color.r << ", bg.g: " << game_data.stages[stage_number].maps[number].background_color.g << ", bg.b: " << game_data.stages[stage_number].maps[number].background_color.b << std::endl;
graphLib.clear_surface_area(0, 0, mapSurface.width, mapSurface.height, game_data.stages[stage_number].maps[number].background_color.r, game_data.stages[stage_number].maps[number].background_color.g, game_data.stages[stage_number].maps[number].background_color.b, graphLib.gameScreen);
if (bg1_surface.width > 0 && game_data.stages[stage_number].maps[number].backgrounds[0].speed != 0) {
int repeat_n = RES_W/bg1_surface.width+1;
if (repeat_n <= 2) {
repeat_n = 3;
}
for (int i=-1; i<repeat_n; i++) {
graphLib.copyArea(st_position(bg1_scroll+i*bg1_surface.width, game_data.stages[stage_number].maps[number].backgrounds[0].adjust_y), &bg1_surface, &graphLib.gameScreen);
}
}
if (bg2_surface.width > 0 && game_data.stages[stage_number].maps[number].backgrounds[1].speed != 0) {
int repeat_n = RES_W/bg2_surface.width+1;
if (repeat_n <= 2) {
repeat_n = 3;
}
//std::cout << "classmap::loadMap - showing bg2 as DYNAMIC - repeat_n: " << repeat_n << std::endl;
for (int i=-1; i<repeat_n; i++) {
//int pos_x = bg2_scroll+i*bg2_surface.width;
//std::cout << "classMap::draw_dynamic_backgrounds - draw bg2 YES - bg2_scroll: " << bg2_scroll << ", pos_x: " << (bg2_scroll+i*bg2_surface.width) << ", width: " << bg2_surface.width << std::endl;
graphLib.copyArea(st_position(bg2_scroll+i*bg2_surface.width, game_data.stages[stage_number].maps[number].backgrounds[1].adjust_y), &bg2_surface, &graphLib.gameScreen);
}
}
}