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
|
void
|
||||||
button( const char* msg )
|
button( void* closure, const char* msg )
|
||||||
{
|
{
|
||||||
XP_Bool draw = XP_FALSE;
|
XP_Bool draw = XP_FALSE;
|
||||||
Globals* globals = sGlobals;
|
Globals* globals = (Globals*)closure;
|
||||||
BoardCtxt* board = globals->game.board;
|
BoardCtxt* board = globals->game.board;
|
||||||
XP_Bool redo;
|
XP_Bool redo;
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function callButton(name) {
|
function callButton(name) {
|
||||||
Module.ccall('button', null, ['string'], [name]);
|
Module.ccall('button', null, ['number', 'string'], [state.closure, name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onHaveDevID(closure, devid) {
|
function onHaveDevID(closure, devid) {
|
||||||
|
|
Loading…
Reference in a new issue