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...) return append(runes, i.runeBuffer...)
} }
func (i *Input) resetForFrame() { func (i *Input) resetForTick() {
if !i.ui.isRunning() { if !i.ui.isRunning() {
return return
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -431,8 +431,8 @@ func (u *UserInterface) IsScreenTransparent() bool {
return false return false
} }
func (u *UserInterface) ResetForFrame() { func (u *UserInterface) ResetForTick() {
u.input.resetForFrame() u.input.resetForTick()
} }
func (u *UserInterface) SetInitFocused(focused bool) { 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 { if err := c.game.Update(); err != nil {
return err return err
} }
ui.Get().ResetForFrame() ui.Get().ResetForTick()
} }
// Even though updateCount == 0, the offscreen is cleared and Draw is called. // Even though updateCount == 0, the offscreen is cleared and Draw is called.