mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Refactoring
This commit is contained in:
parent
161b1965ba
commit
54ac6bed1e
4
run.go
4
run.go
@ -165,7 +165,7 @@ func (i *imageDumperGame) Layout(outsideWidth, outsideHeight int) (screenWidth,
|
|||||||
func RunGame(game Game) error {
|
func RunGame(game Game) error {
|
||||||
defer atomic.StoreInt32(&isRunGameEnded_, 1)
|
defer atomic.StoreInt32(&isRunGameEnded_, 1)
|
||||||
|
|
||||||
fixWindowPosition(WindowSize())
|
initializeWindowPositionIfNeeded(WindowSize())
|
||||||
theUIContext.set(&imageDumperGame{
|
theUIContext.set(&imageDumperGame{
|
||||||
game: game,
|
game: game,
|
||||||
})
|
})
|
||||||
@ -190,7 +190,7 @@ func isRunGameEnded() bool {
|
|||||||
//
|
//
|
||||||
// TODO: Remove this. In order to remove this, the uiContext should be in another package.
|
// TODO: Remove this. In order to remove this, the uiContext should be in another package.
|
||||||
func RunGameWithoutMainLoop(game Game) {
|
func RunGameWithoutMainLoop(game Game) {
|
||||||
fixWindowPosition(WindowSize())
|
initializeWindowPositionIfNeeded(WindowSize())
|
||||||
theUIContext.set(&imageDumperGame{
|
theUIContext.set(&imageDumperGame{
|
||||||
game: game,
|
game: game,
|
||||||
})
|
})
|
||||||
|
@ -147,7 +147,7 @@ var (
|
|||||||
windowPositionSetExplicitly uint32
|
windowPositionSetExplicitly uint32
|
||||||
)
|
)
|
||||||
|
|
||||||
func fixWindowPosition(width, height int) {
|
func initializeWindowPositionIfNeeded(width, height int) {
|
||||||
w := uiDriver().Window()
|
w := uiDriver().Window()
|
||||||
if w == nil {
|
if w == nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user