internal/ui: rename ResetForFrame -> ResetForTick

Resetting happens every tick, not every frame.
This commit is contained in:
Hajime Hoshi 2022-02-13 19:54:38 +09:00
parent a2cb9fda82
commit 9b2f0b6c56
8 changed files with 11 additions and 11 deletions

View File

@ -92,7 +92,7 @@ func (i *Input) AppendInputChars(runes []rune) []rune {
return append(runes, i.runeBuffer...)
}
func (i *Input) resetForFrame() {
func (i *Input) resetForTick() {
if !i.ui.isRunning() {
return
}

View File

@ -101,7 +101,7 @@ func (i *Input) AppendInputChars(runes []rune) []rune {
return append(runes, i.runeBuffer...)
}
func (i *Input) resetForFrame() {
func (i *Input) resetForTick() {
i.runeBuffer = nil
i.wheelX = 0
i.wheelY = 0

View File

@ -94,6 +94,6 @@ func (i *Input) update(keys map[Key]struct{}, runes []rune, touches []Touch) {
i.touches = append(i.touches, touches...)
}
func (i *Input) resetForFrame() {
func (i *Input) resetForTick() {
i.runes = nil
}

View File

@ -74,7 +74,7 @@ func (*UserInterface) ScreenSizeInFullscreen() (int, int) {
return 0, 0
}
func (*UserInterface) ResetForFrame() {
func (*UserInterface) ResetForTick() {
}
func (*UserInterface) CursorMode() CursorMode {

View File

@ -1349,8 +1349,8 @@ func (u *UserInterface) IsScreenTransparent() bool {
return val
}
func (u *UserInterface) ResetForFrame() {
u.input.resetForFrame()
func (u *UserInterface) ResetForTick() {
u.input.resetForTick()
u.m.Lock()
u.windowBeingClosed = false

View File

@ -636,8 +636,8 @@ func (u *UserInterface) IsScreenTransparent() bool {
return bodyStyle.Get("backgroundColor").Equal(stringTransparent)
}
func (u *UserInterface) ResetForFrame() {
u.input.resetForFrame()
func (u *UserInterface) ResetForTick() {
u.input.resetForTick()
}
func (u *UserInterface) SetInitFocused(focused bool) {

View File

@ -431,8 +431,8 @@ func (u *UserInterface) IsScreenTransparent() bool {
return false
}
func (u *UserInterface) ResetForFrame() {
u.input.resetForFrame()
func (u *UserInterface) ResetForTick() {
u.input.resetForTick()
}
func (u *UserInterface) SetInitFocused(focused bool) {

View File

@ -103,7 +103,7 @@ func (c *uiContext) UpdateFrame(updateCount int, screenScale float64, offsetX, o
if err := c.game.Update(); err != nil {
return err
}
ui.Get().ResetForFrame()
ui.Get().ResetForTick()
}
// Even though updateCount == 0, the offscreen is cleared and Draw is called.