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
| 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 |
| 32 | VOID 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 | |
| 65 | FILM* XCinema::GetFilm(INTN Id) |
| 66 | { |
nothing calls this directly
no test coverage detected