From 52567c459f7f1fd0cd7900e45695575319440e64 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 23 Jul 2021 00:57:17 +0900 Subject: [PATCH] ebiten: Remove unnecessary casts --- cursor.go | 4 ++-- run.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cursor.go b/cursor.go index ca75acbad..273fc7b6b 100644 --- a/cursor.go +++ b/cursor.go @@ -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 ( @@ -27,7 +27,7 @@ const ( ) // CursorShapeType represents a shape of a mouse cursor. -type CursorShapeType int +type CursorShapeType = driver.CursorShape // CursorShapeTypes const ( diff --git a/run.go b/run.go index ef36584d9..ce39cea01 100644 --- a/run.go +++ b/run.go @@ -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. @@ -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. @@ -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.