mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/ui: rename ResetForFrame -> ResetForTick
Resetting happens every tick, not every frame.
This commit is contained in:
parent
a2cb9fda82
commit
9b2f0b6c56
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
|
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user