MCPcopy Create free account
hub / github.com/MyGUI/mygui / update

Method update

Plugins/Plugin_HikariWidget/FlashControl.cpp:327–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void FlashControl::update()
328{
329 if (isClean)
330 return;
331
332 if (mOwner && !mOwner->getVisible())
333 return;
334
335 // очищаем текстуру
336 if (!mIsInitialise)
337 {
338 if (mOwner)
339 {
340 MyGUI::uint8* destBuffer = static_cast<MyGUI::uint8*>(mOwner->lock());
341 memset(destBuffer, 0, mOwner->getTextureRealWidth() * mOwner->getTextureRealHeight() * 4);
342 mOwner->unlock();
343 }
344 return;
345 }
346
347 int dirtyWidth = dirtyBounds.right - dirtyBounds.left;
348 int dirtyHeight = dirtyBounds.bottom - dirtyBounds.top;
349 int dirtyBufSize = dirtyWidth * dirtyHeight * 4;
350
351 static int lastDirtyWidth = 0;
352 static int lastDirtyHeight = 0;
353
354 IViewObject* curView = nullptr;
355 flashInterface->QueryInterface(IID_IViewObject, (void**)&curView);
356
357 if (!oleObject || !curView)
358 return;
359
360 if (!mainContext || dirtyWidth != lastDirtyWidth || dirtyHeight != lastDirtyHeight)
361 {
362 if (mainContext)
363 {
364 DeleteDC(mainContext);
365 mainContext = 0;
366 }
367 if (mainBitmap)
368 {
369 DeleteObject(mainBitmap);
370 mainBitmap = 0;
371 }
372
373 lastDirtyWidth = dirtyWidth;
374 lastDirtyHeight = dirtyHeight;
375
376 HDC hdc = GetDC(0);
377 BITMAPINFOHEADER bih = {0};
378 bih.biSize = sizeof(BITMAPINFOHEADER);
379 bih.biBitCount = 32;
380 bih.biCompression = BI_RGB;
381 bih.biPlanes = 1;
382 bih.biWidth = dirtyWidth;
383 bih.biHeight = -dirtyHeight;
384 mainContext = CreateCompatibleDC(hdc);

Callers 2

notifyUpdateCanvasMethod · 0.45
notifyFrameStartMethod · 0.45

Calls 8

getTextureRealWidthMethod · 0.80
getTextureRealHeightMethod · 0.80
copyAreaMethod · 0.80
blitBGRMethod · 0.80
getVisibleMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45
QueryInterfaceMethod · 0.45

Tested by

no test coverage detected