MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / setMeshOpacity

Method setMeshOpacity

source/entities/RenderedMovableEntity.cpp:114–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void RenderedMovableEntity::setMeshOpacity(float opacity)
115{
116 if (opacity < 0.0f || opacity > 1.0f)
117 return;
118
119 mOpacity = opacity;
120
121 if(getIsOnServerMap())
122 {
123 for(Seat* seat : mSeatsWithVisionNotified)
124 {
125 if(seat->getPlayer() == nullptr)
126 continue;
127 if(!seat->getPlayer()->getIsHuman())
128 continue;
129
130 ServerNotification* serverNotification = new ServerNotification(
131 ServerNotificationType::setEntityOpacity, seat->getPlayer());
132 const std::string& name = getName();
133 serverNotification->mPacket << name << opacity;
134 ODServer::getSingleton().queueServerNotification(serverNotification);
135 }
136 return;
137 }
138
139 RenderManager::getSingleton().rrUpdateEntityOpacity(this);
140}
141
142void RenderedMovableEntity::pickup()
143{

Callers 3

processMessageMethod · 0.80
activateMethod · 0.80
deactivateMethod · 0.80

Calls 4

getIsHumanMethod · 0.80
rrUpdateEntityOpacityMethod · 0.80
getPlayerMethod · 0.45

Tested by

no test coverage detected