MCPcopy Create free account
hub / github.com/bumptop/BumpTop / requestImageUpdate

Method requestImageUpdate

trunk/win/Source/BT_LocalPhotoFrameSource.cpp:159–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void LocalPhotoFrameSource::requestImageUpdate()
160{
161 // find the next valid image
162 bool loadCurrent = !_items.empty() && _current.isValid();
163 if (_current.isValid())
164 {
165 for (int i = 0; i < _items.size(); ++i)
166 {
167 if (_items[i].equals(_current))
168 {
169 for (int j = 1; j < _items.size(); ++j)
170 {
171 int nextIndex = (i+j) % _items.size();
172 if (_items[nextIndex].isValid())
173 {
174 _current = _items[nextIndex];
175 ++_imageUpdateCount;
176 break;
177 }
178 }
179 break;
180 }
181 }
182 }
183 else if (!_items.empty())
184 {
185 _current = _items[0];
186 loadCurrent = _current.isValid();
187 ++_imageUpdateCount;
188 }
189
190 if (loadCurrent)
191 {
192 // load the image (so that it will swap)
193 if (this->_textureDetail == HiResImage)
194 texMgr->loadTexture(GLTextureObject(Load|Reload, _textureBufferId, _current.getTexturePath(), HiResImage, IdlePriority));
195 else
196 texMgr->loadTexture(GLTextureObject(Load|Compress|Reload, _textureBufferId, _current.getTexturePath(), SampledImage, IdlePriority));
197 }
198}
199
200void LocalPhotoFrameSource::onImageUpdate(const FileTransfer& transfer)
201{

Callers

nothing calls this directly

Calls 7

GLTextureObjectClass · 0.85
loadTextureMethod · 0.80
getTexturePathMethod · 0.80
emptyMethod · 0.45
isValidMethod · 0.45
sizeMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected