forked from Blendman974/faceclaw
Refactor texture cache usage to shared Kotlin for iOS
This commit is contained in:
1 parent
ccb320c66f
commit
07828db0bf
23 files changed
+552
-74
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { fromData, toData, nativeArray } from './kotlin-data'
|
||||
import type { SessionTexturePlanner, TextureFrame, TexturePlan } from '../g2/texture-planner'
|
||||
declare const FaceclawKitIosTexturePlanner: any
|
||||
|
||||
export class IosTexturePlanner implements SessionTexturePlanner {
|
||||
private readonly native = FaceclawKitIosTexturePlanner.new()
|
||||
reset(): void { this.native.reset() }
|
||||
plan(previous: Uint8Array | null, next: Uint8Array, frame: TextureFrame, firstId: number): TexturePlan | null {
|
||||
const result = this.native.planPreviousNextFrameFirstId(previous ? toData(previous) : null, toData(next), frame.native, firstId)
|
||||
return result ? { payload: fromData(result.payload), uploads: nativeArray(result.uploads, fromData),
|
||||
nextFid: result.nextFid, usedBytes: result.usedBytes } : null
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user