MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / mainloop

Function mainloop

source/sdl/emscripten/mainloop.cpp:53–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52extern int allocatedRamPages;
53void mainloop() {
54 isMainThread = true;
55 U32 t = KSystem::getMilliesSinceStart();
56 U32 nextTimer = getNextTimer();
57 if (nextTimer == 0) {
58 runTimers();
59 }
60
61 if (lastTitleUpdate + 5000 < t) {
62 lastTitleUpdate = t;
63 BString title;
64 if (KSystem::title.length()) {
65 title = KSystem::title;
66 } else {
67 title = B("BoxedWine " BOXEDWINE_VERSION_DISPLAY);
68 }
69
70 title.append(" ");
71 title.append(getSize(allocatedRamPages));
72 emscripten_set_window_title(title.c_str());
73 }
74 if (!KNativeSystem::getCurrentInput()->processEvents()) {
75 KNativeSystem::cleanup();
76 }
77}
78
79void waitForProcessToFinish(const std::shared_ptr<KProcess>& process, KThread* thread) {
80 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(KSystem::processesCond);

Callers

nothing calls this directly

Calls 13

getNextTimerFunction · 0.85
runTimersFunction · 0.85
BFunction · 0.85
runSliceFunction · 0.85
getMIPSFunction · 0.85
klog_fmtFunction · 0.85
processEventsMethod · 0.80
getSizeFunction · 0.70
cleanupFunction · 0.50
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected