mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
pass closure from js to avoid global
This commit is contained in:
parent
880bff747d
commit
b368d0b801
2 changed files with 3 additions and 3 deletions
|
@ -517,10 +517,10 @@ looper( void* closure )
|
|||
}
|
||||
|
||||
void
|
||||
button( const char* msg )
|
||||
button( void* closure, const char* msg )
|
||||
{
|
||||
XP_Bool draw = XP_FALSE;
|
||||
Globals* globals = sGlobals;
|
||||
Globals* globals = (Globals*)closure;
|
||||
BoardCtxt* board = globals->game.board;
|
||||
XP_Bool redo;
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@
|
|||
}
|
||||
|
||||
function callButton(name) {
|
||||
Module.ccall('button', null, ['string'], [name]);
|
||||
Module.ccall('button', null, ['number', 'string'], [state.closure, name]);
|
||||
}
|
||||
|
||||
function onHaveDevID(closure, devid) {
|
||||
|
|
Loading…
Reference in a new issue