finish mapglyph() removal

This commit is contained in:
nhmall
2021-01-02 09:22:53 -05:00
parent 18116d4a7b
commit 1d94e65e45
26 changed files with 242 additions and 704 deletions

View File

@@ -767,38 +767,10 @@ EM_JS(void, js_helpers_init, (), {
globalThis.nethackGlobal = globalThis.nethackGlobal || {};
globalThis.nethackGlobal.helpers = globalThis.nethackGlobal.helpers || {};
installHelper(mapglyphHelper);
installHelper(displayInventory);
installHelper(getPointerValue);
installHelper(setPointerValue);
// used by print_glyph
function mapglyphHelper(glyph, x, y, mgflags) {
let ochar = _malloc(4);
let ocolor = _malloc(4);
let ospecial = _malloc(4);
_mapglyph(glyph, ochar, ocolor, ospecial, x, y, mgflags);
let ch = getValue(ochar, "i32");
let color = getValue(ocolor, "i32");
let special = getValue(ospecial, "i32");
_free (ochar);
_free (ocolor);
_free (ospecial);
return {
glyph,
ch,
color,
special,
x,
y,
mgflags
};
}
// used by update_inventory
function displayInventory() {
// Asyncify.handleAsync(async () => {