Clownacy
732d3bbc5c
Split software audio mixer to its own file
...
This will be shared between the SDL2 and miniaudio backends,
eliminating all that digusting duplicate code.
2020-03-31 12:14:20 +01:00
Clownacy
4e58457e1d
Make miniaudio backend use native sample rate
...
This avoids the need for miniaudio to resample the mixer's output.
2020-03-31 10:20:20 +01:00
Gabriel Ravier
fb353fbc7e
Backends/Rendering/SDLTexture: Solve -Wnarrowing warning
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-03-18 11:54:46 +01:00
Clownacy
dd04977f29
Update miniaudio to v0.10.1
...
This newer version supports marking all of its declarations as
static, avoiding the conflict between the miniaudio audio backend,
and the copy of miniaudio embedded in clownaudio in the enhanced
branch.
2020-03-17 13:25:41 +00:00
Clownacy
9af25f7c67
Hopefully fixed miniaudio backend on Windows
...
Stupid BOOL type
2020-03-04 21:02:17 +00:00
Clownacy
af24d010a5
Clean-up miniaudio backend a little
...
Really need to figure out the best way to abstract-away the software
mixer...
2020-02-29 18:19:06 +00:00
Clownacy
8ec8a8d990
Added unfinished miniaudio audio backend
...
Currently only works with CMake
2020-02-29 18:18:59 +00:00
Gabriel Ravier
b238bcee03
Remove random lines mistakenly added by merge
2020-02-14 08:27:07 +01:00
Gabriel Ravier
5d61641415
Added ATTRIBUTE_HOT to Backend_ColourFill
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-02-13 19:55:39 +01:00
Gabriel Ravier
f43bd4f876
Removed bad omp (it doesn't actually improve anything, i did my measurements wrong)
2020-02-13 19:55:39 +01:00
Gabriel Ravier
2adfef0035
Got Backend_Blit to go from 17% CPU usage to 11% :
...
- used __builtin_expect to get a 8.5% performance improvement
- used #pragma omp for to get a 30% performance improvement
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-02-13 19:55:39 +01:00
Gabriel Ravier
e8ec6a8ffb
Optimize Backend_Blit a bit
2020-02-13 19:55:39 +01:00
Gabriel Ravier
65db12baaa
Started trying to optimize MakePixelWaveData
2020-02-13 19:55:39 +01:00
Clownacy
a767c16d83
Un-un-const a few things
2020-02-09 18:55:41 +00:00
Clownacy
f82a53d336
Prevent errors encountered by MSVC
2020-02-09 18:47:50 +00:00
Clownacy
d4004fe99a
Store glyph pixels as chars, not floats
...
Smaller memory footprint, and probably-insignificant performance
impact.
2020-02-09 13:56:45 +00:00
Clownacy
bb11cd567d
Software renderer cleanup
2020-02-09 13:44:02 +00:00
Clownacy
60d3cc2ed6
Update cute_spritebatch.h
2020-02-09 12:40:35 +00:00
Clownacy
8edca4fb2e
Style tweak
2020-02-09 12:35:38 +00:00
Clownacy
59a8c2617f
Tweak some variable naming
...
The enhanced branch calls them the 'internal *screen* width/height',
which I think is more appropriate.
2020-02-05 15:52:43 +00:00
Clownacy
d9e7ebac38
Correct a typo
2020-02-05 15:47:26 +00:00
Clownacy
2af6a043ef
Clean-up the OpenGL renderers a little
2020-02-04 16:35:42 +00:00
Clownacy
1140ab0916
Clean-up renderer backend initialisation
2020-02-04 15:51:19 +00:00
Clownacy
ba6d711d3a
Tick cute_spritebatch once per frame
...
...As opposed to once per draw call.
This change was made because multiple draw calls can be made per
frame, or a only a handful of draw calls may be made per minute.
Since draw calls are an inconsistent metric, I just switched to
frames instead.
2020-02-04 14:57:06 +00:00
Clownacy
2e5e1994c2
Enable debug console prints in non-debug builds
2020-02-03 16:44:52 +00:00
Clownacy
53c0e8470f
Add an optimisation to the OpenGL renderers
...
Since we track the currently-bound "source texture", we don't need
to poll the OpenGL driver for the same info.
2020-02-03 15:53:59 +00:00
Clownacy
dfacd62662
Fix text-flickering in the OpenGL renderers
...
This would occur in CSE2E's options menu.
It was caused by cute_spritebatch destroying a texture atlas that
was being used by the current unflushed vertex buffer. To solve
this, we now track what textures are being used by current buffer,
and flush the buffer when the texture are about to be
modified/deleted.
As you can guess, this issue doesn't affect the SDLTexture backend,
since its batching system is half-decent.
2020-02-03 15:44:09 +00:00
Clownacy
b894543f3b
Shut up a C++11 error from the enhanced branch
...
Nice one, C++. Adding yet another C-incompatibility?
2020-02-03 14:43:02 +00:00
Clownacy
4190493fd8
More documentation
2020-02-02 00:34:03 +00:00
Clownacy
514d9f8739
Document the OpenGL renderer a bit more
...
This makes it easier to find things
2020-02-02 00:21:28 +00:00
Clownacy
d84f64a5a9
Tweak cute_spritebatch settings
...
1024x1024 seems like overkill
2020-02-02 00:10:01 +00:00
Clownacy
eb6ab89b85
Fixes and improvements
...
Made texture-atlasing occur immediately, notably.
2020-02-02 00:01:45 +00:00
Clownacy
1b2d4fdb4d
Fix the other rendering backends
...
Also finished ripping-out the sub-pixel support
2020-02-01 22:57:07 +00:00
Clownacy
eeed719c16
Get the SDLTexture renderer working again
2020-02-01 22:47:13 +00:00
Clownacy
e3cd7ce353
Add glyph-batching to OpenGL renderer
...
Unfortunately, sub-pixel font rendering had to go. It wasn't portable
anyway (not every display is an LCD with R->G->B ordering).
2020-02-01 22:37:59 +00:00
Clownacy
eaf2de05b6
Add glyph-batching to the SDLTexture backend
...
Hope it will be this easy for the OpenGL backend
2020-02-01 17:49:26 +00:00
Clownacy
639039ce3a
Added Backend_PrepareToDrawGlyphs
...
This is to reduce OpenGL context changes, and help pave the way for
glyph-batching
2020-02-01 16:40:23 +00:00
Clownacy
e3db7749ba
Add verbose error-reporting to backends
...
Should fix #98
2020-02-01 12:22:44 +00:00
Clownacy
ed1ff2f275
Tweak MIN/MAX macros in software renderer
2020-01-29 23:45:22 +00:00
Clownacy
788697dc5d
Fix a possible hang in the audio mixer
...
It was likely a race condition between the game thread writing to
'organya_timer', and the audio thread reading it.
...I really need to rethink the API for this Organya-synchronisation
thing.
2020-01-29 23:21:27 +00:00
Clownacy
e4394aea1f
Whoops, forgot to remove this #include
2020-01-29 22:16:21 +00:00
Clownacy
d0defa4a7b
This cast shouldn't be necessary
2020-01-29 22:15:53 +00:00
Clownacy
638e96be11
Move and rename attrHot
...
Like the MIN and MAX macros, I'd rather keep this in the source file
than a common header.
2020-01-29 22:14:35 +00:00
Gabriel Ravier
5e6658847c
Re-add missing "(double)"
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-29 23:04:17 +01:00
Gabriel Ravier
88a8362f23
Reverted fmodf stuff and tried to make it so C++ compilers would go for the float version in appropriate circumstances (fmodf directly is unavailable due to not being in C89)
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-29 23:01:31 +01:00
Gabriel Ravier
1442299924
Made MixSounds be marked as hot
...
Signed-off-by: Gabriel Ravier <gabrielravier@gabrielAncientIBMv2>
2020-01-29 23:01:31 +01:00
Gabriel Ravier
c15ecbf728
Used fmodf instead of fmod for a 0.5% performance increase in MixSounds
...
Signed-off-by: Gabriel Ravier <gabrielravier@gabrielAncientIBMv2>
2020-01-29 23:01:31 +01:00
Clownacy
e33bd9c8f9
Fix visual artefacting on the Pi
...
I'm not sure why there was linear filtering when I was rendering at
1:1 pixel ratio, but it did happen. This fixes it by forcing
nearest-neighbour. The artefacting was caused by the linear filtering
blending with pixels outside the specified texture coordinates,
creating lines around everything.
Fun fact: the framebuffer technique CSE2 uses is demanding on the Pi
(1278x720 runs at 60 FPS when the framebuffer is forced to 852x480,
even though all the internal rendering is still 1278x720). I guess
rendering those extra 920160 pixels really takes its toll.
2020-01-25 14:26:15 +00:00
Clownacy
99a8b2bd18
Improve OpenGL performance on the Raspberry Pi
...
Apparently 2 VBOs wasn't enough. This bumped the framerate from 13FPS
to 20FPS in a stress-test (CSE2E at 1704x960 on a Raspberry Pi 3B
in X11 with the KMS OpenGL driver).
2020-01-25 14:22:50 +00:00
Clownacy
87b296c513
Converted SDLSurface renderer
2020-01-22 22:33:34 +00:00