mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ui: Reduce arguments from newUIContext
This commit is contained in:
parent
664cf62a29
commit
6a8013ed37
@ -94,9 +94,11 @@ func (u *UserInterface) Update() {
|
||||
}
|
||||
|
||||
type UserInterface struct {
|
||||
width int
|
||||
height int
|
||||
scale float64
|
||||
// TODO: Remove these members: the driver layer should not care about the game screen size.
|
||||
width int
|
||||
height int
|
||||
scale float64
|
||||
|
||||
sizeChanged bool
|
||||
|
||||
// Used for gomobile-build
|
||||
|
4
run.go
4
run.go
@ -155,7 +155,7 @@ func Run(f func(*Image) error, width, height int, scale float64, title string) e
|
||||
height: height,
|
||||
}
|
||||
|
||||
theUIContext = newUIContext(game, width, height, scale)
|
||||
theUIContext = newUIContext(game, scale)
|
||||
if err := uiDriver().Run(width, height, scale, title, theUIContext, graphicsDriver()); err != nil {
|
||||
if err == driver.RegularTermination {
|
||||
return nil
|
||||
@ -178,7 +178,7 @@ func RunWithoutMainLoop(f func(*Image) error, width, height int, scale float64,
|
||||
height: height,
|
||||
}
|
||||
|
||||
theUIContext = newUIContext(game, width, height, scale)
|
||||
theUIContext = newUIContext(game, scale)
|
||||
return uiDriver().RunWithoutMainLoop(width, height, scale, title, theUIContext, graphicsDriver())
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ func (d *defaultGame) Layout(outsideWidth, outsideHeight int) (screenWidth, scre
|
||||
return w, h
|
||||
}
|
||||
|
||||
func newUIContext(game Game, width, height int, scaleForWindow float64) *uiContext {
|
||||
func newUIContext(game Game, scaleForWindow float64) *uiContext {
|
||||
u := &uiContext{
|
||||
game: game,
|
||||
scaleForWindow: scaleForWindow,
|
||||
|
Loading…
Reference in New Issue
Block a user