stbhw_generate_image function

  1. @Native<Int Function(Pointer<stbhw_tileset>, Pointer<Pointer<Int>>, Pointer<ma_uint8>, Int, Int, Int)>(ffi.Pointer<stbhw_tileset>, ffi.Pointer<ffi.Pointer<ffi.Int>>, ffi.Pointer<ffi.UnsignedChar>, ffi.Int, ffi.Int, ffi.Int)>()
int stbhw_generate_image(
  1. Pointer<stbhw_tileset> ts,
  2. Pointer<Pointer<Int>> weighting,
  3. Pointer<ma_uint8> pixels,
  4. int stride_in_bytes,
  5. int w,
  6. int h,
)

generate a map that is w * h pixels (3-bytes each) returns non-zero on success, 0 on error not thread-safe (uses a global data structure to avoid memory management) weighting should be NULL, as non-NULL weighting is currently untested

Implementation

@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<stbhw_tileset>,
    ffi.Pointer<ffi.Pointer<ffi.Int>>,
    ffi.Pointer<ffi.UnsignedChar>,
    ffi.Int,
    ffi.Int,
    ffi.Int,
  )
>()
external int stbhw_generate_image(
  ffi.Pointer<stbhw_tileset> ts,
  ffi.Pointer<ffi.Pointer<ffi.Int>> weighting,
  ffi.Pointer<ffi.UnsignedChar> pixels,
  int stride_in_bytes,
  int w,
  int h,
);