Skip to content
This repository was archived by the owner on Aug 28, 2022. It is now read-only.

Commit d04bd0b

Browse files
committed
Main loop for emscripten.'
1 parent 96d6ea8 commit d04bd0b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

base/main.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ScummVM - Graphic Adventure Engine
1+
/* S cummVM - Graphic Adventure Engine
22
*
33
* ScummVM is the legal property of its developers, whose names
44
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -323,6 +323,10 @@ static void setupKeymapper(OSystem &system) {
323323

324324
}
325325

326+
#ifdef EMSCRIPTEN
327+
#include "emscripten/emscripten.h"
328+
#endif
329+
326330
typedef void (*FuncPtr)();
327331
FuncPtr mainLoopUpdateFunc = 0;
328332

@@ -332,16 +336,18 @@ void mainLoop()
332336
#ifndef EMSCRIPTEN
333337
while(mainLoopUpdateFunc)
334338
mainLoopUpdateFunc();
339+
#else
340+
emscripten_set_main_loop(mainLoopUpdateFunc, 0, 0);
335341
#endif
336342
}
337343

338344
extern "C" int scummvm_main(int argc, const char * const argv[]) {
339345
Common::String specialDebug;
340346
Common::String command;
341347

342-
// argc = 2;
348+
argc = 3;
343349
const char * const args[3] = { "scummvm", "-p/dott", "tentacle" };
344-
// argv = args;
350+
argv = args;
345351
// Verify that the backend has been initialized (i.e. g_system has been set).
346352
assert(g_system);
347353
OSystem &system = *g_system;

0 commit comments

Comments
 (0)