MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / loadTexture

Method loadTexture

src/Core/Graphics/Sprite.cpp:98–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 void Sprite::loadTexture(const std::string& path)
99 {
100 if (!path.empty() and path != m_path)
101 {
102 m_path = path;
103 if (m_resources)
104 {
105 m_texture = m_resources->getTexture(path, m_antiAliasing);
106 }
107 else
108 {
109 m_texture.reset();
110 m_texture.loadFromFile(System::Path(path).find());
111 m_texture.setAntiAliasing(m_antiAliasing);
112 }
113
114 m_sprite.setTexture(m_texture);
115 m_sprite.setTextureRect(
116 sf::IntRect(0, 0, m_texture.getSize().x, m_texture.getSize().y));
117 }
118 }
119
120 void Sprite::resetUnit(Transform::Units unit)
121 {

Callers 2

setAntiAliasingMethod · 0.95
loadMethod · 0.95

Calls 10

PathClass · 0.85
emptyMethod · 0.45
getTextureMethod · 0.45
resetMethod · 0.45
loadFromFileMethod · 0.45
findMethod · 0.45
setAntiAliasingMethod · 0.45
setTextureMethod · 0.45
setTextureRectMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected