MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / UpdateFilm

Method UpdateFilm

rEFIt_UEFI/libeg/XCinema.cpp:32–63  ·  view source on GitHub ↗

object XCinema Cinema is a part of Theme object FILM* FilmC is a part or current Screen. Must be initialized from Cinema somewhere on Screen init assumed one Film per screen

Source from the content-addressed store, hash-verified

30// object FILM* FilmC is a part or current Screen. Must be initialized from Cinema somewhere on Screen init
31// assumed one Film per screen
32VOID REFIT_MENU_SCREEN::UpdateFilm()
33{
34 if (FilmC == nullptr || !FilmC->AnimeRun) {
35// DBG("no anime -> run=%d\n", FilmC->AnimeRun?1:0);
36 return;
37 }
38 // here we propose each screen has own link to a Film
39 INT64 Now = AsmReadTsc();
40
41 if (FilmC->LastDraw == 0) {
42 DBG("=== Update Film ===\n");
43 DBG("FilmX=%lld\n", FilmC->FilmX);
44 DBG("ID=%lld\n", FilmC->GetIndex());
45 DBG("RunOnce=%d\n", FilmC->RunOnce?1:0);
46 DBG("NumFrames=%lld\n", FilmC->NumFrames);
47 DBG("FrameTime=%lld\n", FilmC->FrameTime);
48 DBG("Path=%ls\n", FilmC->Path.wc_str());
49 DBG("LastFrame=%lld\n\n", FilmC->LastFrameID());
50 }
51
52 if (TimeDiff(FilmC->LastDraw, Now) < (UINTN)FilmC->FrameTime) return;
53
54 XImage Frame = FilmC->GetImage(); //take current image
55 if (!Frame.isEmpty()) {
56 Frame.DrawOnBack(FilmC->FilmPlace.XPos, FilmC->FilmPlace.YPos, ThemeX.Background);
57 }
58 FilmC->Advance(); //next frame no matter if previous was not found
59 if (FilmC->Finished()) { //first loop finished
60 FilmC->AnimeRun = !FilmC->RunOnce; //will stop anime if it set as RunOnce
61 }
62 FilmC->LastDraw = Now;
63}
64
65FILM* XCinema::GetFilm(INTN Id)
66{

Callers

nothing calls this directly

Calls 9

TimeDiffFunction · 0.85
GetIndexMethod · 0.80
LastFrameIDMethod · 0.80
DrawOnBackMethod · 0.80
AdvanceMethod · 0.80
AsmReadTscFunction · 0.50
wc_strMethod · 0.45
isEmptyMethod · 0.45
FinishedMethod · 0.45

Tested by

no test coverage detected