Mercurial > web
diff js/chiptune2.js @ 70:629553bdc8aa
music: fix metadata fetching in chiptune2.js
turns out the function for getting ascii strings was deprecated, and now
I have to use a custom build of libopenmpt because there's no other way to do it.
YAY!
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sat, 30 Sep 2023 02:32:41 -0400 |
parents | e6c574c6f8e0 |
children |
line wrap: on
line diff
--- a/js/chiptune2.js Sat Sep 30 00:34:22 2023 -0400 +++ b/js/chiptune2.js Sat Sep 30 02:32:41 2023 -0400 @@ -85,8 +85,8 @@ var keys = UTF8ToString(libopenmpt._openmpt_module_get_metadata_keys(this.currentPlayingNode.modulePtr)).split(';'); var keyNameBuffer = 0; for (var i = 0; i < keys.length; i++) { - keyNameBuffer = libopenmpt._malloc(keys[i].length + 1); - writeAsciiToMemory(keys[i], keyNameBuffer); + keyNameBuffer = libopenmpt._malloc(libopenmpt.lengthBytesUTF8(keys[i])+1); + libopenmpt.stringToUTF8(keys[i], keyNameBuffer, libopenmpt.lengthBytesUTF8(keys[i])+1); data[keys[i]] = UTF8ToString(libopenmpt._openmpt_module_get_metadata(this.currentPlayingNode.modulePtr, keyNameBuffer)); libopenmpt._free(keyNameBuffer); }