mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2026-04-22 15:57:15 +08:00
all: apply go-fix for Windows and Linux
This commit is contained in:
@@ -239,7 +239,7 @@ func (g *nativeGamepadsDesktop) detectConnection(gamepads *gamepads) error {
|
||||
if g.xinput != 0 {
|
||||
const xuserMaxCount = 4
|
||||
|
||||
for i := 0; i < xuserMaxCount; i++ {
|
||||
for i := range xuserMaxCount {
|
||||
if gamepads.find(func(g *Gamepad) bool {
|
||||
n := g.native.(*nativeGamepadDesktop)
|
||||
return n.dinputDevice == nil && n.xinputIndex == i
|
||||
|
||||
@@ -377,7 +377,7 @@ func (g *nativeGamepadImpl) update(gamepad *gamepads) error {
|
||||
}
|
||||
|
||||
func (g *nativeGamepadImpl) pollAbsState() error {
|
||||
for code := 0; code < _ABS_CNT; code++ {
|
||||
for code := range _ABS_CNT {
|
||||
if g.absMap[code] < 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ func (g *graphics12) initializeMembers() (ferr error) {
|
||||
}()
|
||||
|
||||
// Create command allocators.
|
||||
for i := 0; i < frameCount; i++ {
|
||||
for i := range frameCount {
|
||||
dca, err := g.device.CreateCommandAllocator(_D3D12_COMMAND_LIST_TYPE_DIRECT)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -518,7 +518,7 @@ func (g *graphics12) initSwapChainXbox(width, height int) (ferr error) {
|
||||
return err
|
||||
}
|
||||
|
||||
for i := 0; i < frameCount; i++ {
|
||||
for i := range frameCount {
|
||||
r, err := g.device.CreateCommittedResource(&_D3D12_HEAP_PROPERTIES{
|
||||
Type: _D3D12_HEAP_TYPE_DEFAULT,
|
||||
CPUPageProperty: _D3D12_CPU_PAGE_PROPERTY_UNKNOWN,
|
||||
@@ -592,7 +592,7 @@ func (g *graphics12) createRenderTargetViewsDesktop() (ferr error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for i := 0; i < frameCount; i++ {
|
||||
for i := range frameCount {
|
||||
r, err := g.graphicsInfra.getBuffer(uint32(i), &_IID_ID3D12Resource)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -91,7 +91,7 @@ func NewGraphics() (graphicsdriver.Graphics, error) {
|
||||
env = os.Getenv("EBITEN_DIRECTX")
|
||||
}
|
||||
|
||||
for _, t := range strings.Split(env, ",") {
|
||||
for t := range strings.SplitSeq(env, ",") {
|
||||
t := strings.TrimSpace(t)
|
||||
switch {
|
||||
case t == "warp":
|
||||
|
||||
Reference in New Issue
Block a user