Skip to content

Commit

Permalink
ebiten: Remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Jul 22, 2021
1 parent 2503323 commit 52567c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package ebiten
import "github.com/hajimehoshi/ebiten/v2/internal/driver"

// CursorModeType represents a render and coordinate mode of a mouse cursor.
type CursorModeType int
type CursorModeType = driver.CursorMode

// CursorModeTypes
const (
Expand All @@ -27,7 +27,7 @@ const (
)

// CursorShapeType represents a shape of a mouse cursor.
type CursorShapeType int
type CursorShapeType = driver.CursorShape

// CursorShapeTypes
const (
Expand Down
8 changes: 4 additions & 4 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func ScreenSizeInFullscreen() (int, int) {
//
// CursorMode is concurrent-safe.
func CursorMode() CursorModeType {
return CursorModeType(uiDriver().CursorMode())
return uiDriver().CursorMode()
}

// SetCursorMode sets the render and capture mode of the mouse cursor.
Expand All @@ -223,7 +223,7 @@ func CursorMode() CursorModeType {
//
// SetCursorMode is concurrent-safe.
func SetCursorMode(mode CursorModeType) {
uiDriver().SetCursorMode(driver.CursorMode(mode))
uiDriver().SetCursorMode(mode)
}

// CursorShape returns the current cursor shape.
Expand All @@ -232,14 +232,14 @@ func SetCursorMode(mode CursorModeType) {
//
// CursorShape is concurrent-safe.
func CursorShape() CursorShapeType {
return CursorShapeType(uiDriver().CursorShape())
return uiDriver().CursorShape()
}

// SetCursorShape sets the cursor shape.
//
// SetCursorShape is concurrent-safe.
func SetCursorShape(shape CursorShapeType) {
uiDriver().SetCursorShape(driver.CursorShape(shape))
uiDriver().SetCursorShape(shape)
}

// IsFullscreen reports whether the current mode is fullscreen or not.
Expand Down

0 comments on commit 52567c4

Please sign in to comment.