mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Draw sync reset actions
This commit is contained in:
parent
d779f65db4
commit
f09de70a30
3 changed files with 53 additions and 35 deletions
|
|
@ -90,6 +90,13 @@ class plugin : Plugin() {
|
|||
private var initialized = false;
|
||||
private var lastClickTime = 0L
|
||||
private var lastUIOffset = 0
|
||||
private val drawActions = mutableListOf<() -> Unit>()
|
||||
|
||||
fun registerDrawAction(action: () -> Unit) {
|
||||
synchronized(drawActions) {
|
||||
drawActions.add(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun allSpritesLoaded() : Boolean {
|
||||
|
|
@ -259,6 +266,17 @@ class plugin : Plugin() {
|
|||
accumulatedTime = 0L
|
||||
}
|
||||
|
||||
// Draw synced actions (that require to be done between glBegin and glEnd)
|
||||
if (drawActions.isNotEmpty()) {
|
||||
synchronized(drawActions) {
|
||||
val actionsCopy = drawActions.toList()
|
||||
drawActions.clear()
|
||||
for (action in actionsCopy) {
|
||||
action()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Init in the draw call so we know we are between glBegin and glEnd for HD
|
||||
if(!initialized && mainLoadState >= loginScreen) {
|
||||
initKondoUI()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue