Commit Graph

4661 Commits

Author SHA1 Message Date
corfe83
b3c567de89
Fix another ~300 allocations per frame in my test project (#1089)
This simple change brings my simple test project from 752 allocations per frame to 474 allocations per frame. It seems a shame that go's escape analysis is not smart enough to leave this variable on the stack.

GeoM is a 24-byte struct and there is a slight perf difference that we are storing it in stack, but also copying it around with this change (instead of an 8-byte pointer). This could make things faster (due to stack / CPU cache) or slower (due to copying more memory) - when I try a stress test (drawing 100K images per frame), I can't see any actual performance difference (but I do see 100K fewer allocations, and GC is no longer running almost all the time).
2020-02-22 13:40:17 +09:00
Hajime Hoshi
7ea56b2e79 keys: Refactoring: Rename a map (driverKeyNameToJSKey) 2020-02-22 03:31:10 +09:00
Hajime Hoshi
cd4cb435f2 keys: Refactoring: Rename and reverse a map (androidKeyToDriverKeyName) 2020-02-22 03:28:59 +09:00
Hajime Hoshi
6d78610645 Add Tom Lister to AUTHORS 2020-02-21 22:11:01 +09:00
Tom Lister
3eea196c09
Fix missing js build tag (#1088)
Added js to build tags as suggested by @hajimehoshi

Fixes #1087
2020-02-21 20:24:25 +09:00
corfe83
a18cddb39f
Reduce heap allocations in thread.go and input.go (#1085)
I've been doing some profiling of a very simple ebiten project, and noticed that thread.go was doing a bunch of unnecessary allocations to accomplish its work. This change seeks to reduce GC work.

Input.go was also doing some unnecessary allocations.

The thread.go change reduces the total number of allocations per frame from 1342 to 852 (~36% reduction). The input.go change reduces it further to 752 (~44% total reduction). Perf tests were done on windows.
2020-02-21 09:59:45 +09:00
Hajime Hoshi
5b7151595b mobile/ebitenmobileview: Handle keyboard keys on Android (ebitenmobile)
Updates #237
2020-02-20 01:53:51 +09:00
Hajime Hoshi
6faad68931 input: Refactoring 2020-02-20 00:18:40 +09:00
Hajime Hoshi
682f454fc2 input: Refactoring: Rename variables 2020-02-19 10:52:58 +09:00
Hajime Hoshi
db2c4dc260 mobile/ebitenmobile: Rename functions
This is a preparation for other input devices.

Updates #237
2020-02-19 01:51:05 +09:00
Hajime Hoshi
e20cbac8d8 mobile/ebitenmobileview: Rename files 2020-02-19 00:48:57 +09:00
Hajime Hoshi
dc96d25457 graphics: Fix comments on ReplacePixels 2020-02-16 22:25:32 +09:00
Hajime Hoshi
875a529708 graphics: Allow ReplacePixels on a sub-image
Fixes #980
2020-02-16 22:18:07 +09:00
Hajime Hoshi
d9bd7ab07d buffered: Remove (*Image).Set
This is a preparation for ReplacePixels of a sub-image.

Updates #980
2020-02-16 21:45:28 +09:00
Hajime Hoshi
733c1b649a buffered: Bug fix: Copying pixels failed for the delayed commands
Fixes #1082
2020-02-16 20:16:04 +09:00
Hajime Hoshi
911b36ed98 buffered: Refactoring 2020-02-16 20:03:04 +09:00
Hajime Hoshi
405ae99b32 buffered: Refactoring: Flush delayed functions without the lock 2020-02-16 19:53:17 +09:00
Hajime Hoshi
ff8689cfcd buffered: Bug fix: Set and some functions before the main loop caused wrong results
invalidatePendingPixels was not called properly.

Fixes #1081
2020-02-16 19:06:48 +09:00
Hajime Hoshi
d790c86e8a cmd/ebitenmobile: Add -trimpath
Fixes #1068
2020-02-16 17:32:00 +09:00
Hajime Hoshi
f0395bfc80 Add corfe83 to AUTHORS 2020-02-16 02:03:32 +09:00
corfe83
61c2d7cfe8
Simple optimization in IsKeyPressed (#1080)
Simple optimization on IsKeyPressed to avoid iterating through whole map of possible keys.
2020-02-16 02:02:05 +09:00
Hajime Hoshi
f396b258e2 cmd/ebitenmobile: Update gomobile version
This change also eliminates a hack for golang/go#36668
2020-02-15 14:06:02 +09:00
Zachary Burkett
bb60818e8d
Add linebreak support to text.Draw (#1075)
Closes #1074
2020-02-12 23:15:57 +09:00
Hajime Hoshi
087f30b72d ui: Remove the unused function setWindowResizable
Updates #994
2020-02-12 20:58:25 +09:00
Hajime Hoshi
883b25f257 uidriver/mobile: Refactoring 2020-02-12 00:36:34 +09:00
Hajime Hoshi
d59aea1db1 driver: Remove the return value from RunWithoutMainLoop 2020-02-11 23:56:53 +09:00
Hajime Hoshi
aef4b4ba53 uidriver/mobile: Refactoring: Give a default outside size 2020-02-11 23:29:52 +09:00
Hajime Hoshi
d0fce2a2db mobile/ebitenmobileview: Refactoring 2020-02-11 22:43:00 +09:00
Hajime Hoshi
9298b044e3 graphicsdriver/metal: Bug fix: avoid using mtl.LoadActionDontCare
Fixes #1019
2020-02-11 20:29:03 +09:00
Hajime Hoshi
38d8cbf6af cmd/ebitenmobile: Bug fix: iOS view was not shown
This enbugs that garbages are rendered outside the screen. I think
the bug in iPad is now exposed to any iOS devices.

Updates #1019
2020-02-11 20:20:20 +09:00
Hajime Hoshi
c927d33457 mobile/ebitenmobileview: Use the common uiContext for layouting
This means that the whole offscreen is cleared correctly.

This change is a little breaking change: SetScreenSize or other
functions no longer works on ebitenmobile. Use Layout instead.

Fixes #1019
2020-02-11 19:40:47 +09:00
Hajime Hoshi
1b4c9f4e4d uidriver/mobile: Remove impl.go 2020-02-11 14:50:55 +09:00
Hajime Hoshi
a303487328 uidriver/mobile: Add comments 2020-02-11 14:45:50 +09:00
Hajime Hoshi
024fc48647 Refactoring: Add init.go 2020-02-11 11:14:19 +09:00
Hajime Hoshi
099ce1b3b4 Revert "ui: Add SetInitFocused"
This reverts commit bb04fc8a29.

Reason: glfw.Focused / glfw.FocusOnShow did not work

Updates #769
2020-02-10 01:10:40 +09:00
Hajime Hoshi
bb04fc8a29 ui: Add SetInitFocused
Updates #769
2020-02-09 23:45:59 +09:00
Hajime Hoshi
90dba581e2 ui: Fix comments 2020-02-09 21:56:48 +09:00
Hajime Hoshi
6250dd9f9b buffered: Bug fix: ebiten.Run must be called from the main thread
Updates #1027
2020-02-09 04:53:26 +09:00
Hajime Hoshi
32471af18f uidriver/js: Ensure that the checking-audio loop is finished when the game is finished
After the game loop is finished, any goroutines should not exist.
Otherwise, 'Go program has already exited' error can happen on
Wasm.

This change ensures that the goroutines are finished when the game
is finished. Note that time.Sleep was required to ensure that the
(*time.Ticker) ends.

Fixes #1027
2020-02-09 03:39:08 +09:00
Hajime Hoshi
0092a05eb7 Update Go version in .travis.yml (Go 1.14) 2020-02-09 01:47:55 +09:00
Hajime Hoshi
c3f50c6893 Update Go version in .travis.yml 2020-02-09 01:43:06 +09:00
Hajime Hoshi
6b12b02a05 ui: Refactoring: Reduce global variables 2020-02-09 00:51:58 +09:00
Hajime Hoshi
4159c500bd buffered: Refactoring: Use defer
defer's performance will be much better as of Go 1.14.

https://tip.golang.org/doc/go1.14#runtime
2020-02-08 20:58:28 +09:00
Hajime Hoshi
74cb080c6f ui: Bug fix: Images were not dumped with RunGame
Fixes #1071
2020-02-06 03:32:05 +09:00
Hajime Hoshi
46601bb516 graphics: Fill the screenshot in black when the screen is not transparent
Fixes #997
2020-02-06 03:08:16 +09:00
Hajime Hoshi
67b166f732 examples/rotate: Revert resizeable window
This was accidentally introduced at 9ed8279fc8.
2020-02-06 03:05:31 +09:00
Hajime Hoshi
d6d17a7e85 uidriver/js: Implement GamepadSDLID
Fixes #1053
2020-02-05 00:00:00 +09:00
Hajime Hoshi
4be49230de Add Sam Oen to AUTHORS 2020-02-01 17:29:18 +09:00
Sam Oen
69dc54232c
examples/raycasting: fix bug, swap height and width (#1067) 2020-02-01 17:28:23 +09:00
Hajime Hoshi
ad84bf812f Add .gitattributes for GitHub Linguist
Updates #1066
2020-01-30 21:06:50 +09:00