MCPcopy Create free account
hub / github.com/ZDoom/Raze / drawImage

Method drawImage

libraries/ZWidget/src/core/canvas.cpp:306–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306void BitmapCanvas::drawImage(const std::shared_ptr<Image>& image, const Point& pos)
307{
308 auto& texture = imageTextures[image];
309 if (!texture)
310 {
311 texture = createTexture(image->GetWidth(), image->GetHeight(), image->GetData(), image->GetFormat());
312 }
313 Colorf color(1.0f, 1.0f, 1.0f);
314 drawTile(texture.get(), (float)((origin.x + pos.x) * uiscale), (float)((origin.y + pos.y) * uiscale), (float)(texture->Width * uiscale), (float)(texture->Height * uiscale), 0.0, 0.0, (float)texture->Width, (float)texture->Height, color);
315}
316
317void BitmapCanvas::line(const Point& p0, const Point& p1, const Colorf& color)
318{

Callers 2

DrawLayoutImageMethod · 0.80
OnPaintMethod · 0.80

Calls 5

GetFormatMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetDataMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected