本文整理汇总了C++中Graphic::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::copy方法的具体用法?C++ Graphic::copy怎么用?C++ Graphic::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphic
的用法示例。
在下文中一共展示了Graphic::copy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyTile
void VRAMCache::copyTile(Graphic& dst,
Box dstbox,
int tileIndex,
int flipFlags,
Graphic::TransBlitOption updateTrans) const {
const Graphic* srcgrp = &cache_;
if ((flipFlags & flipHorizontal) && (flipFlags & flipVertical)) {
srcgrp = &bothFlipCache_;
}
else if ((flipFlags & flipHorizontal)) {
srcgrp = &horizontalFlipCache_;
}
else if ((flipFlags & flipVertical)) {
srcgrp = &verticalFlipCache_;
}
dst.copy(*srcgrp,
dstbox,
Box(tileIndex * GGTile::width,
0,
GGTile::width,
GGTile::height),
updateTrans);
}
示例2: renderTiles
void VRAMEditorLayeredGraphicScene::renderTiles(
Graphic& g,
int tileIndex,
GGTileSet& tiles,
GGPalette& palette,
Graphic::TileTransferTransOption tileTransOption) {
// Render each tile and blit to Graphic
for (int j = 0; j < tiles.numTiles(); j++) {
// Render tile
Graphic tileGraphic(tiles[j],
palette,
tileTransOption);
// Calculate position in Graphic
int xPos = tileIndexToXPos(tileIndex);
int yPos = tileIndexToYPos(tileIndex);
// Blit if transparency is enabled; copy otherwise
if (tileTransOption == Graphic::tileTrans) {
g.blit(tileGraphic,
Box(xPos, yPos, 0, 0),
Graphic::noTransUpdate);
}
else {
g.copy(tileGraphic,
Box(xPos, yPos, 0, 0),
Graphic::noTransUpdate);
}
// Move to next tile position
++tileIndex;
}
}
示例3: renderTiles
void VRAMCache::renderTiles(Graphic& g,
int tileIndex,
GGTileSet& tiles,
GGPalette& palette,
Graphic::TileTransferTransOption tileTransOption) {
// Render each tile and blit to Graphic
for (int j = 0; j < tiles.numTiles(); j++) {
// Render tile
Graphic tileGraphic(tiles[j],
palette,
tileTransOption);
// Calculate position in Graphic
int xPos = tileIndex * GGTile::width;
int yPos = 0;
// Clear the tiles before writing to them to avoid leaving
// artifacts from previous contents (due to our program's
// different concept of transparency from the hardware)
g.fillRect(xPos, yPos, GGTile::width, GGTile::height,
Color(0xFF, 0xFF, 0xFF, Color::fullAlphaTransparency),
Graphic::noTransUpdate);
// Blit if transparency is enabled; copy otherwise
if (tileTransOption == Graphic::tileTrans) {
g.blit(tileGraphic,
Box(xPos, yPos, 0, 0),
Graphic::transUpdate);
}
else {
g.copy(tileGraphic,
Box(xPos, yPos, 0, 0),
Graphic::transUpdate);
}
// Move to next tile position
++tileIndex;
}
}