Commit Graph

8952 Commits

Author SHA1 Message Date
Hajime Hoshi
34b8c5483a ebitenutil: use vector's functions again but with anti-alias false
This is basically a revert for bf63d2310d.

As anti-alias options are added to the vector package's functions, we
should be able to emulate the same thing without performance penalty.

Updates #2605
Updates #2606
2023-03-18 11:09:37 +09:00
Hajime Hoshi
8bd7ce5c20 vector: add anti-alias options to the utility functions
Closes #2606
2023-03-18 11:01:48 +09:00
Hajime Hoshi
f66ed646bd ebitenutil: add comments and use ColorScale
Updates #2605
2023-03-18 10:42:44 +09:00
Hajime Hoshi
bf63d2310d ebitenutil: revert the implementation of Draw* functions
Using vector functions caused unexpected increase of draw calls.
Revert the Draw* functions to use regular DrawImage/DrawTriangles.

Closes #2605
2023-03-18 10:27:26 +09:00
Hajime Hoshi
22dfdfc418 internal/gamepad: bug fix: possible crash at iterating gamepads
Closes #2603
2023-03-17 11:40:24 +09:00
Hajime Hoshi
c77673d96d release v2.6.0-alpha 2023-03-15 12:56:27 +09:00
Hajime Hoshi
faca493fbc go generate 2023-03-15 03:18:28 +09:00
Hajime Hoshi
e4aace6c40 examples/blend: shrink the window for small displays 2023-03-14 22:21:35 +09:00
Hajime Hoshi
3951df05c8 examples/audiopanning: fix the initial panning 2023-03-14 21:30:55 +09:00
Hajime Hoshi
84a86c86e4 examples/blend: disable resizing the window 2023-03-14 21:22:27 +09:00
Hajime Hoshi
ac370d3678 update Oto
Updates hajimehoshi/oto#207
2023-03-14 20:59:49 +09:00
Hajime Hoshi
39aaf7fe37 ebiten: update comments
Updates #2601
2023-03-14 13:07:40 +09:00
Hajime Hoshi
b1048025d9 ebiten: separate graphics.go into compositemode.go and it 2023-03-14 00:45:10 +09:00
Hajime Hoshi
1656c47abf internal/ui: bug fix: hiding a window decoration at initialization doesn't work on macOS
Closes #2600
2023-03-14 00:27:57 +09:00
Hajime Hoshi
3bcac70d1c internal/graphicsdriver/metal: add comments 2023-03-13 22:21:55 +09:00
Hajime Hoshi
e93bcd9e55 internal/ui: bug fix: needed to wait for swapping buffers before entering fullscreen
Closes #2599
2023-03-13 21:40:40 +09:00
Hajime Hoshi
65fb9d56ba internal/graphicsdriver/metal: refactoring
Updates #2599
2023-03-13 21:29:42 +09:00
Hajime Hoshi
903b5ab046 examples/blend: clean up 2023-03-13 02:11:05 +09:00
Hajime Hoshi
80cbf7cbae examples: bug fix: wrong sample rate 2023-03-13 00:23:57 +09:00
Hajime Hoshi
597fe171a4 examples/additive: remove examples/additive
This is duplicated with examples/blend.
2023-03-12 23:44:53 +09:00
divVerent
10c1b56e62
cmd/ebitenmobile: fix Xbox-ish gamepad axis assignment (#2596)
This commit mirrors https://github.com/libsdl-org/SDL/pull/7405
(6f1f586086).

Note that for SDL, this code is used a lot less than for Ebitengine, as SDL
mostly migrated to HIDAPI and direct USB device access rather than using
Android's APIs. For Bluetooth devices, however, the Java APIs are used the
same way.

This was the remaining problem to be solved to automatically support standard
layout on most standard gamepads (this should cover most Xbox-ish and PS-ish
gamepads on the market).

In particular this covers gamepads with the following assignment:

- Left stick = X/Y, right stick = Z/RZ, triggers = LEFTTRIGGER/RIGHTTRIGGER
  (which basically is what Android docs say and some PS gamepads do)

- Left stick = X/Y, right stick = RX/RY, triggers = Z/RZ
  (Xbox gamepad style, apparently)

- Left stick = X/Y, right stick = RX/RY, triggers = LEFTTRIGGER/RIGHTTRIGGER
  (Not sure if this exists, but it's conceivable)

As we found on the SDL pull request discussion, gamepads that offer flight
controls (e.g. THROTTLE and RUDDER) will likely not work well, before and
after this change.

Closes #2557
2023-03-12 22:32:30 +09:00
Hajime Hoshi
36e2d0ec40 internal/graphicsdriver/metal: bug fix: a path for CoreGraphics.framework didn't work
Closes #2595
2023-03-10 23:24:06 +09:00
Hajime Hoshi
f9f1736a4b update dependencies 2023-03-10 22:37:55 +09:00
Hajime Hoshi
84146510ce internal/restorable: refactoring 2023-03-10 22:29:59 +09:00
Hajime Hoshi
46173ffec6 internal/restorable: refactoring 2023-03-10 01:57:07 +09:00
Hajime Hoshi
8f2097d55e internal/restorable: reduce more duplicated regions 2023-03-09 23:17:02 +09:00
Hajime Hoshi
f3b49e6543 internal/restorable: reduce more duplicated regions 2023-03-09 22:57:57 +09:00
Hajime Hoshi
66db13ef74 internal/restorable: add tests 2023-03-09 21:54:41 +09:00
Hajime Hoshi
694bf449c8 .github/workflows: remove unnecessary file 2023-03-09 17:47:59 +09:00
Hajime Hoshi
65460184a2 .github/workflows: update Go versions 2023-03-09 17:22:30 +09:00
Hajime Hoshi
367606f274 internal/restorable: remove duplicated regions from i.staleRegions
Updates #2375
Updates #2581
2023-03-09 17:15:56 +09:00
Hajime Hoshi
22d74e78b2 internal/restorable: reduce allocations at readPixelsFromGPU
Updates #2375
2023-03-08 16:43:43 +09:00
Hajime Hoshi
da55397420 internal/restorable: remove empty regions at appendRegionsForDrawTriangles 2023-03-08 16:32:41 +09:00
Hajime Hoshi
f298b9541b internal/restorable: use a cache for pixels at readPixelsFromGPU
Updates #2375
2023-03-08 16:27:38 +09:00
Hajime Hoshi
7f182e7814 internal/restorable: skip basePixels.Clear when the region is empty 2023-03-08 16:21:45 +09:00
Hajime Hoshi
e4fffaf963 internal/restorable: reduce allocations
Updates #2375
2023-03-08 16:07:41 +09:00
Hajime Hoshi
7f3cff5e7c internal/restorable: revive pixelsForRestore
pixelsForRestore was removed at 09e0320309
as the regions for restoring were minimized. However, this caused a
regression and increased allocations on Android.

This fix revives pixelsForRestore, but as a map with region keys and
byte slice values. pixelsForRestore no longer represents a byte slice
for an entire image.

Updates #2375
2023-03-08 14:52:44 +09:00
Hajime Hoshi
bd457da9be run: update comments at IsScreenFilterEnabled 2023-03-08 02:16:44 +09:00
Hajime Hoshi
f97d912605 ebiten: remove ColorM.ReadElements
ReadElements is a new function as of v2.5, but at the same time,
the colorm package is also added in v2.5. As ebiten.ColorM is
deprecated, ebiten's ColorM.ReadElements should not be requried.

Closes #2347
2023-03-07 00:07:08 +09:00
Hajime Hoshi
b75ed45d46 update Oto to v2.4.0-alpha.13 2023-03-06 00:21:02 +09:00
divVerent
06c141475c
internal/gamepad: native standard layout for Linux (#2587)
Implements native standard layout for Linux gamepads by using the kernel-provided button IDs, thereby expanding
support to gamepads not listed in gamecontrollerdb.txt.

Linux's docs: https://www.kernel.org/doc/Documentation/input/gamepad.txt
SDL2's source: https://fossies.org/linux/SDL2/src/joystick/linux/SDL_sysjoystick.c#l_1740

Note that I am NOT 100% convinced about the X/Y swap between Xbox and PlayStation controllers - the Xbox
compatible pad I have however does have BTN_NORTH and BTN_WEST swapped (and thus BTN_X and BTN_Y
assigned right), which confirms SDL's logic and opposes the kernel docs.

Tested with this gamepad: "20d6:2802 BDA Xbox ONE Core controller", label says "PowerA Model 1508491-02" - even
after clearing out gamecontrollerdb.txt, examples/gamepad shows a 100% correct mapping.

Closes #2052
2023-03-04 01:47:24 +09:00
Hajime Hoshi
6ccdc6382c internal/graphicsdriver/metal/mtl: bug fix: fix a vet error 2023-03-04 01:37:45 +09:00
Hajime Hoshi
36bd3329b3 internal/graphicsdriver/metal: bug fix: compile error 2023-03-04 01:25:43 +09:00
Hajime Hoshi
7998e4d31d update purego to v0.3.0-alpha
There are breaking changes between purego v0.2.0 and v0.3.0-alpha.
2023-03-04 01:22:54 +09:00
divVerent
809ad991c2
internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588)
Refactors native standard layout so standard axes and buttons can be implemented using any of axes, buttons or hats.

This is required to be able to implement a native standard layout mapping for Linux, as e.g. shoulder buttons can be
backed either by an analog or digital input.

Precedes #2587

Updates #2052
2023-03-03 23:29:04 +09:00
Hajime Hoshi
051b0c7238 internal/ui: bug fix: a big-offscreen size could be 0
Closes #2589
2023-03-03 22:34:43 +09:00
Hajime Hoshi
b278e5521f internal/gamepad: rename variables 2023-03-03 21:17:47 +09:00
Hajime Hoshi
9d1ea0a91a update Oto 2023-03-03 15:05:33 +09:00
Hajime Hoshi
27538135a7 internal/atlas: improve tests
This change fixes the test to reflect the fix for #2586.

Updates #2586
2023-03-02 20:16:26 +09:00
Hajime Hoshi
1c09ec5e44 internal/atlas: bug fix: too aggressive counting up destinationCount
Closes #2586
2023-03-02 18:58:29 +09:00