MCPcopy Create free account
hub / github.com/ddnet/ddnet / RenderSelectedImage

Method RenderSelectedImage

src/game/editor/editor.cpp:4076–4098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4074}
4075
4076void CEditor::RenderSelectedImage(CUIRect View) const
4077{
4078 std::shared_ptr<CEditorImage> pSelectedImage = Map()->SelectedImage();
4079 if(pSelectedImage == nullptr)
4080 return;
4081
4082 View.Margin(10.0f, &View);
4083 if(View.h < View.w)
4084 View.w = View.h;
4085 else
4086 View.h = View.w;
4087 float Max = maximum<float>(pSelectedImage->m_Width, pSelectedImage->m_Height);
4088 View.w *= pSelectedImage->m_Width / Max;
4089 View.h *= pSelectedImage->m_Height / Max;
4090 Graphics()->TextureSet(pSelectedImage->m_Texture);
4091 Graphics()->BlendNormal();
4092 Graphics()->WrapClamp();
4093 Graphics()->QuadsBegin();
4094 IGraphics::CQuadItem QuadItem(View.x, View.y, View.w, View.h);
4095 Graphics()->QuadsDrawTL(&QuadItem, 1);
4096 Graphics()->QuadsEnd();
4097 Graphics()->WrapNormal();
4098}
4099
4100void CEditor::RenderSounds(CUIRect ToolBox)
4101{

Callers

nothing calls this directly

Calls 11

MapFunction · 0.85
GraphicsFunction · 0.85
SelectedImageMethod · 0.80
MarginMethod · 0.80
TextureSetMethod · 0.80
BlendNormalMethod · 0.80
WrapClampMethod · 0.80
QuadsBeginMethod · 0.80
QuadsDrawTLMethod · 0.80
QuadsEndMethod · 0.80
WrapNormalMethod · 0.80

Tested by

no test coverage detected