internalising more global functions

This commit is contained in:
minjaesong
2021-12-05 10:19:43 +09:00
parent f8e6590b0a
commit a190e37f59
3 changed files with 6 additions and 6 deletions

View File

@@ -67,8 +67,8 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
private fun init() { private fun init() {
if (loaderInfo.display != null) { if (loaderInfo.display != null) {
val loadedClass = Class.forName(loaderInfo.display) val loadedClass = Class.forName(loaderInfo.display)
val loadedClassConstructor = loadedClass.getConstructor(vm::class.java) val loadedClassConstructor = loadedClass.getConstructor(String::class.java, vm::class.java)
val loadedClassInstance = loadedClassConstructor.newInstance(vm) val loadedClassInstance = loadedClassConstructor.newInstance("./assets", vm)
gpu = (loadedClassInstance as GraphicsAdapter) gpu = (loadedClassInstance as GraphicsAdapter)
vm.getIO().blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File(loaderInfo.diskPath))) vm.getIO().blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File(loaderInfo.diskPath)))

View File

@@ -212,4 +212,4 @@ class PeripheralEntry2(
vararg val args: Any vararg val args: Any
) )
fun Int.kB() = this * 1024L internal fun Int.kB() = this * 1024L

View File

@@ -1748,17 +1748,17 @@ void main() {
} }
} }
infix fun Int.fmod(other: Int): Int { internal infix fun Int.fmod(other: Int): Int {
return Math.floorMod(this, other) return Math.floorMod(this, other)
} }
fun FrameBuffer.inUse(action: () -> Unit) { internal fun FrameBuffer.inUse(action: () -> Unit) {
this.begin() this.begin()
action() action()
this.end() this.end()
} }
fun SpriteBatch.inUse(action: () -> Unit) { internal fun SpriteBatch.inUse(action: () -> Unit) {
this.begin() this.begin()
action() action()
this.end() this.end()