Commit Graph

3183 Commits

Author SHA1 Message Date
Hajime Hoshi
2e5e7e6e24 restorable: Remove merging commands for code simplicity 2018-06-10 20:06:17 +09:00
Hajime Hoshi
03079ba067 restorable: Refactoring 2018-06-10 18:40:46 +09:00
Hajime Hoshi
c782380a1c restorable: Specify indices from restorable package 2018-06-10 18:17:58 +09:00
Hajime Hoshi
2853895e6b graphics: Refactoring: Rename functions 2018-06-10 17:53:57 +09:00
Hajime Hoshi
32ac3840a7 graphics: Add comments 2018-06-10 17:10:11 +09:00
Hajime Hoshi
4e21bfd005 graphics: Rename elements -> indices 2018-06-10 17:06:40 +09:00
Hajime Hoshi
8a268e871f graphics: Specify indices before commands 2018-06-10 17:04:58 +09:00
Hajime Hoshi
273093b237 audio: Skip the player in the state of starting, seeking or EOF
This is basically reland of
2fee7a6fe5.

Before this change, if a player's buffer was not enough for
reading, 0 value were used and this caused noises. The reading
size should be aligned with all the players.

However, there are some cases that the player should be skippped.
For example, just after a player just starts playing or seeking,
the buffer is empty. In this case, other players should not wait
for the player since decoding might take some time. Another case
is that the player reached EOF.

This change aligns the read buffer sizes but use zero values only
when the player just starts or seeks, or reaches EOF.
2018-06-09 22:00:11 +09:00
Hajime Hoshi
facf184548 Revert "audio: Consider the state of the player's starting and seeking"
This reverts commit 2fee7a6fe5.

Reason: This causes freezing on browsers
2018-06-09 19:28:20 +09:00
Hajime Hoshi
b62e07b9bd audio: Remove println 2018-06-09 19:05:07 +09:00
Hajime Hoshi
2fee7a6fe5 audio: Consider the state of the player's starting and seeking
Before this change, if a player's buffer was not enough for
reading, 0 value were used and this caused noises. The reading
size should be aligned with all the players.

Just after a player just starts playing or seeking, the buffer is
empty but other players should not wait for the player read since
decoding might take some time.

To summerize, this change aligns the read buffer sizes but use
zero values only when the player just starts or seeks.
2018-06-09 19:01:57 +09:00
Hajime Hoshi
91958d24ef audio: Use bigger buffers for mobiles 2018-06-09 18:14:18 +09:00
Hajime Hoshi
1d88706955 Fix .travis.yml: github.com/gopherjs/webgl is no longer used 2018-06-09 16:36:34 +09:00
Hajime Hoshi
be665a3526 ui: Better way to avoid blocking
Fixes #625
2018-06-09 13:36:35 +09:00
Hajime Hoshi
6e12f287b0 ui: Use goroutine to avoid blocking on GopherJS 2018-06-09 03:05:37 +09:00
Hajime Hoshi
3136ef5fbd graphics: More exact scaling
This is related to #622
2018-06-08 00:07:39 +09:00
Hajime Hoshi
e6d0943366 graphics: Rename color_matrix -> color_matrix_body 2018-06-06 02:46:54 +09:00
Hajime Hoshi
b86860abcc graphics: Call BindBuffer only when the program was null 2018-06-04 00:13:23 +09:00
Hajime Hoshi
fac639f9b7 graphics: Refactoring: Remove drawImageCommand.quadsNum 2018-06-03 23:58:08 +09:00
Hajime Hoshi
c9dd04d471 graphics: Refactoring: Remove command groups 2018-06-03 23:13:01 +09:00
Hajime Hoshi
9d87622a19 graphics: Set elements for every EnqueueDrawImageCommand 2018-06-03 20:42:45 +09:00
Hajime Hoshi
525ad04568 graphics: Split the notion of vertices and elements 2018-06-03 16:07:26 +09:00
Hajime Hoshi
a54b6060bd examples/windowsize: Add 0.75 scale 2018-06-03 02:32:42 +09:00
Hajime Hoshi
25f2dfc677 graphics: Refactoring 2018-06-03 01:43:10 +09:00
Hajime Hoshi
03e3f0f5f7 graphics: Call glBufferSubData for element array buffer every frame
This is a preparation for more flexible drawing commands.
2018-05-31 00:53:05 +09:00
Hajime Hoshi
f7072d7ee5 Clean up .gitignore 2018-05-30 03:13:01 +09:00
Hajime Hoshi
351c048e2f graphics: Add TestSprites 2018-05-29 02:20:50 +09:00
Hajime Hoshi
5f3a42aab9 examples/flappy: Add license comment 2018-05-28 02:38:55 +09:00
Hajime Hoshi
5e93d75ae0 graphics: Fix comments 2018-05-28 02:38:26 +09:00
Hajime Hoshi
399f965729 opengl: Add BindBuffer accepting both element-array-buffer and array-buffer
This change is a pure refactoring to clarify that array buffer is
binded before its usage.
2018-05-28 00:34:00 +09:00
Hajime Hoshi
311788dfe2 ui: Remove warnings of deadlock
Now gopherwasm fixed this problem by avoiding js.MakeFunc.

See also: 3fe87b73c0
2018-05-27 04:10:14 +09:00
Hajime Hoshi
8e9c3bd304 ui: Use gopherwasm 2018-05-27 02:35:17 +09:00
Hajime Hoshi
faaf391619 audio: Give up syncing audio timer and game timer (#617)
Syncing was already incomplete (e.g. decoding takes more than one
frame and delays can happen in this case). Giving up syncing audio
timer and game timer should not affect the game experience so much.
Instead, clock implementation will be much simpler.
2018-05-27 00:30:12 +09:00
Hajime Hoshi
5976e4bbbc audio: More intellegent suspending/resuming (#617)
Before this change, the audio is suspended when the game stops for
1/12[s]. However, as game often stops for more than 1/12[s]
especially on mobiles, this implemntation caused some audio
glitches.

This change fixes this problem by re-implementing suspending/
resumeing audio by detecting the window is active/focused or not.
2018-05-26 23:31:04 +09:00
Hajime Hoshi
d88d1be4ad mobile: Refactoring 2018-05-26 22:51:30 +09:00
Hajime Hoshi
bbe6926f9c Fix .travis.yml 2018-05-25 02:11:34 +09:00
Hajime Hoshi
cc748f15e4 examples/contextlost: Use gopherwasm 2018-05-25 02:08:32 +09:00
Hajime Hoshi
980055e07a devicescale: Use gopherwasm 2018-05-25 02:00:41 +09:00
Hajime Hoshi
d894a13698 web: Use gopherwasm 2018-05-25 01:59:50 +09:00
Hajime Hoshi
9b7f5f7273 ebitenutil: Use gopherwasm 2018-05-25 01:23:09 +09:00
Hajime Hoshi
2ec075004a clock: Use gopherwasm 2018-05-25 01:14:31 +09:00
Hajime Hoshi
4c5613d73c opengl: Remove unneeded casts 2018-05-23 01:29:16 +09:00
Hajime Hoshi
b84dc0585d opengl: Remove dependencies on gopherjs/webgl
This is a preparation for #528
2018-05-23 00:48:24 +09:00
Hajime Hoshi
22ca490b6e Fix comments in .travis.yml 2018-05-22 11:15:22 +09:00
Hajime Hoshi
f5a0ec320d Use gjbt on TravisCI (#615) 2018-05-22 10:43:49 +09:00
Hajime Hoshi
81a1fd4744 testflock: Use just sync.Mutex on browsers (#615) 2018-05-19 21:10:34 +09:00
Hajime Hoshi
0637a812bc web: Fix detecting mobile browsers for NodeJS 2018-05-16 22:29:19 +09:00
Hajime Hoshi
a5eb1b84ab web: Better way to detect NodeJS 2018-05-16 22:10:35 +09:00
Hajime Hoshi
c2df8326fc ui: Refactoring: Use IsNodeJS 2018-05-16 22:02:33 +09:00
Hajime Hoshi
176b80cc83 docs: Update 2018-05-14 02:09:04 +09:00