Commit Graph

693 Commits

Author SHA1 Message Date
faiface 0737b86059 speaker: improve concurrency, only lock when and what necessary 2017-07-06 22:11:03 +02:00
faiface cb4bb4c3ef reimplement speaker 2017-07-06 21:44:34 +02:00
faiface 41963b01cc Merge branch 'audio' of https://github.com/faiface/pixel into audio 2017-07-06 20:52:12 +02:00
Michal Štrba 065f4f3c90 Merge pull request #44 from alistanis/audio
initial incomplete speaker implementation
2017-07-06 20:52:02 +02:00
Christopher Cooper 8e571bfe8e addresses some review comments 2017-07-06 11:49:35 -04:00
Christopher Cooper 32ff29438d fix bounds check 2017-07-05 18:15:53 -04:00
Christopher Cooper 1a88ab2edd mremove prints 2017-07-05 18:11:26 -04:00
Christopher Cooper f9972888a2 add initial speaker implementation 2017-07-05 18:10:03 -04:00
Christopher Cooper 6ac68670bd Merge pull request #1 from faiface/audio
Audio
2017-07-05 18:05:50 -04:00
Michal Štrba 57b578bba7 Merge pull request #43 from aerth/audio
add libasound2-dev travis dependency
2017-07-05 22:04:44 +02:00
aerth cdce974e49
add libasound2-dev dependency 2017-07-05 12:24:26 -07:00
faiface d7487f1f7a fix Rect.Intersect 2017-07-05 20:36:25 +02:00
faiface 4137f87f22 clarify Rect.Intersect doc 2017-07-05 19:58:09 +02:00
faiface bee65f5833 add Rect.Intersect 2017-07-05 19:54:30 +02:00
faiface 46e79f21b9 add Rect.Area 2017-07-05 19:54:18 +02:00
faiface 2a8c17c33c add Rect.Intersect 2017-07-05 19:51:54 +02:00
faiface c49c77a116 add Rect.Area 2017-07-05 19:35:11 +02:00
faiface d640879775 add Take decorator function 2017-07-05 18:14:18 +02:00
faiface c86834b8f6 add Seq compositor 2017-07-05 17:59:43 +02:00
faiface 330e9da360 add StreamerFunc helper type 2017-07-03 19:07:30 +02:00
faiface 7f2b8b6fe9 change SampleRate to float64 2017-07-03 18:55:27 +02:00
faiface 42737212d8 fix grammar in Streamer doc 2017-07-03 17:37:55 +02:00
faiface c7bb0a1639 minor stylistic corrections in Streamer doc 2017-07-03 17:28:54 +02:00
faiface a48d07ff6b audio: add Streamer interface 2017-07-03 14:05:08 +02:00
faiface 99573a5f1e optimize ToRGBA (weird one) 2017-07-03 00:23:07 +02:00
faiface c23446fb49 improve sprite.Draw(batch) benchmark 2017-07-03 00:22:45 +02:00
faiface 578ae8fa53 fix bug in text benchmark 2017-07-02 23:26:26 +02:00
faiface 6af6195bd0 optimize Drawer (reduce map access) 2017-07-02 23:23:27 +02:00
faiface 0c28c0785e add text benchmarks 2017-07-02 19:35:56 +02:00
faiface 17f735c2d0 remove unnecessary reassign in color benchmarks 2017-07-02 19:26:43 +02:00
faiface 7629b6ef5e add imdraw benchmarks 2017-07-02 19:22:40 +02:00
faiface ae0526fda0 add ToRGBA, sprite.Draw(batch) and Matrix benchmarks 2017-07-02 19:04:20 +02:00
Michal Štrba 80cfdfcb6a Merge pull request #40 from aerth/master
Use travis-ci
2017-06-16 01:14:23 +02:00
aerth b01300dab9
move button 2017-06-15 23:05:00 +00:00
aerth c078a58652
Link to travis build 2017-06-15 22:52:47 +00:00
aerth b58d6bf5ec
add travis config 2017-06-15 22:40:37 +00:00
faiface 75ab96923c another minor code style change 2017-06-11 14:14:02 +02:00
faiface 2a9b7e5210 minor code style change 2017-06-11 14:06:45 +02:00
faiface 79c5d20194 Merge branch 'dev' 2017-06-11 01:19:57 +02:00
faiface e6484064aa one more tiny doc change 2017-06-11 01:18:23 +02:00
faiface 3fcad7503f minor doc changes 2017-06-11 01:17:37 +02:00
Michal Štrba 1545bd7af5 Merge pull request #38 from seebs/master
more performance tweaks
2017-06-11 01:12:03 +02:00
Seebs 0dc27e409b Push: Don't convert pixel.RGBA to pixel.RGBA
Because that's expensive, even in the case where the conversion
is trivial. Use type assertion first. Reduces runtime cost of
imdraw.Push from ~15.3% to 8.4%, so not-quite-50% of runtime
cost of pushing points.

If you were setting imd.Color to Color objects that aren't RGBA
every single point, not much help. But if you set it and then
draw a bunch of points, this will be a big win.
2017-06-10 17:56:15 -05:00
Seebs f2ef87f198 Improve normal calculations
Soooo. It turns out that the bunch of smallish (~4-5% of runtime)
loads associated with Len(), Unit(), Rotated(), and so on... Were
actually more like 15% or more of computational effort. I first
figured this out by creating:

	func (u Vec) Normal(v Vec) Vec

which gives you a vector normal to u->v. That consumed a lot
of CPU time, and was followed by .Unit().Scaled(imd.thickness / 2),
which consumed a bit more CPU time.

After some poking, and in the interests of avoiding UI cruft,
the final selection is
	func (u Vec) Normal() Vec

This returns the vector rotated 90 degrees, which turns out to
be the most common problem.
2017-06-10 17:55:16 -05:00
Seebs ef6a44fef8 Slightly clean up normal calculations
We never actually need the "normal" value; it's an extra calculation
we didn't need, because ijNormal is the same value early on. It's
totally possible that we could further simplify this; there's a lot
of time going into the normal computations.
2017-06-10 10:47:22 -05:00
Seebs 9a6e6066bd don't call Len() when it can't change
updateData()'s loops checking gt.Len() turns out to have been costing
significant computation, not least because each call then in turn
called gt.vs.Stride().
2017-06-10 10:47:18 -05:00
faiface 7ebbf7e9b5 switch back to OpenGL 3.3 (OS X issues) 2017-06-10 15:11:45 +02:00
faiface 31fc049ab7 optimize GLTriangles SetLen and Update 2017-06-10 01:10:59 +02:00
faiface c331fe2583 Merge branch 'master' into gl2.1 2017-06-09 19:26:14 +02:00
faiface 6b9ea45e96 minor, mostly stylistic, changes 2017-06-09 18:13:05 +02:00