Refactor texture cache usage to shared Kotlin for iOS

This commit is contained in:
James Babcock committed 2026-09-20 15:12:13 -07:00
1 parent ccb320c66f
commit 07828db0bf
23 files changed
+552 -74

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { toData } from './kotlin-data'
declare const FaceclawKitIosTextureAtlas: any
const atlas = FaceclawKitIosTextureAtlas.new()
export function textureAtlasAvailable(): boolean { return true }
export function textureFontId(key: string): number { return atlas.fontIdKey(key) }
export function registerTextureGlyphs(buffer: ArrayBuffer, aa: boolean): void {
const data = toData(new Uint8Array(buffer))
if (aa) atlas.registerAaGlyphsData(data)
else atlas.registerGlyphsData(data)
}
export function registerFirmwareGlyphs(buffer: ArrayBuffer): void {
atlas.registerFirmwareGlyphsData(toData(new Uint8Array(buffer)))
}
export function textureImageId(key: string, width: number, height: number, pixels: Uint8Array): number {
return atlas.imageIdKeyWidthHeightData(key, width, height, toData(pixels))
}