MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / copyRect

Method copyRect

Engine/source/gfx/bitmap/gBitmap.cpp:253–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251//--------------------------------------------------------------------------
252
253void GBitmap::copyRect(const GBitmap *src, const RectI &srcRect, const Point2I &dstPt, const U32 srcMipLevel, const U32 dstMipLevel)
254{
255 if(src->getFormat() != getFormat())
256 return;
257 if(srcRect.extent.x + srcRect.point.x > src->getWidth(srcMipLevel) || srcRect.extent.y + srcRect.point.y > src->getHeight(srcMipLevel))
258 return;
259 if(srcRect.extent.x + dstPt.x > getWidth(dstMipLevel) || srcRect.extent.y + dstPt.y > getHeight(dstMipLevel))
260 return;
261
262 for(U32 i = 0; i < srcRect.extent.y; i++)
263 {
264 dMemcpy(getAddress(dstPt.x, dstPt.y + i, dstMipLevel),
265 src->getAddress(srcRect.point.x, srcRect.point.y + i, srcMipLevel),
266 mBytesPerPixel * srcRect.extent.x);
267 }
268}
269
270//--------------------------------------------------------------------------
271void GBitmap::allocateBitmap(const U32 in_width, const U32 in_height, const bool in_extrudeMipLevels, const GFXFormat in_format )

Callers 4

_updateMethod · 0.80
terrImport.cppFile · 0.80
exportStripMethod · 0.80
importStripMethod · 0.80

Calls 7

getWidthFunction · 0.85
getAddressMethod · 0.80
getHeightFunction · 0.50
dMemcpyFunction · 0.50
getFormatMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected