AssemblyScript version works

This commit is contained in:
Surma
2019-01-23 14:05:37 -05:00
parent 8f5c03e05b
commit a8265d5350
4 changed files with 10 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ export function rotate(inputWidth: i32, inputHeight: i32, rotate: i32): void {
for (let d2 = d2Start; d2 >= 0 && d2 < d2Limit; d2 += d2Advance) {
for (let d1 = d1Start; d1 >= 0 && d1 < d1Limit; d1 += d1Advance) {
let start = ((d1 * d1Multiplier) + (d2 * d2Multiplier));
store<u32>(offset + i, load<u32>(start));
store<u32>(offset + i * 4, load<u32>(start * 4));
i += 1;
}
}

Binary file not shown.

View File

@@ -1,6 +1,6 @@
{
"extends": "../node_modules/assemblyscript/std/assembly.json",
"extends": "./node_modules/assemblyscript/std/assembly.json",
"include": [
"./**/*.ts"
]
}
}

View File

@@ -3,3 +3,10 @@ export interface RotateOptions {
}
export const defaultOptions: RotateOptions = { rotate: 0 };
export interface RotateModuleInstance {
exports: {
memory: WebAssembly.Memory;
rotate(width: number, height: number, rotate: 0 | 90 | 180 | 270): void;
};
}