Commit graph

249 commits

Author SHA1 Message Date
Clownacy
bcf5513495 Updated Wii U renderer
Turns out it doesn't even batch the font stuff. I'll need to add that
later.
2020-09-08 01:17:07 +01:00
Clownacy
1d9446d425 Update SDLSurface renderer for new font batcher 2020-09-07 23:44:51 +01:00
Clownacy
096fa3b578 New custom font batcher
Previously, the font batching system was very shoddy: basically,
glyph bitmaps would be cached to system memory, and uploaded
on-demand to the GPU.

The OpenGL3, OpenGLES2, and SDLTexture backends relied on
`cute_spritebatch.h` to handle batching. While nice, this library is
overkill: it's intended for managing a whole game, not just a couple
of glyphs. It also depends on C++11, which is something I'd rather be
without.

Being so complex, it appears that internally it spams the backend
when merging atlases together. According to bug reports, this causes
the game to skip a lot of frames.

Instead, I've ditched the system-memory-side caching, and made the
game maintain its own atlas. Unlike `cute_spritebatch.h`, this one
doesn't purge glyphs after they've gone unused for 30(?) seconds -
instead, glyphs are only purged when room in the atlas runs out, at
which point the oldest glyph is replaced. This method doesn't involve
creating or destroying atlases at runtime, avoiding the overhead of
whatever OpenGL/DirectX do internally when that happens.

Currently only the OpenGL3, OpenGLES2, and Software renderers have
been updated with this - the others will fail to build.

I know immediate-mode renderers won't benefit from this, but it
replaces the leaky old caching system, so it's still an improvement.
2020-09-07 23:11:01 +01:00
Clownacy
1582af91cf Replace more float logic with integer-only
I hate floats >:(
2020-07-09 01:09:19 +01:00
Clownacy
6e486d9226 Er, actually remove those dead includes 2020-07-08 20:00:49 +01:00
Clownacy
ab82f014ae Avoid some float logic
Also shuts up some VS2019 warnings
2020-07-08 19:33:53 +01:00
Clownacy
565c79a4ce Fix GLFW3 software renderer in VS2019
GLFW will include these headers for us properly
2020-07-08 19:33:49 +01:00
Gabriel Ravier
81edd4db52 src: Restored SDL.h includes to conform to project style of including SDL2
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-02 14:59:55 +02:00
Gabriel Ravier
187847fbcc src: Fixed not including headers that are included for detection of conflicting definitions
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-02 14:43:47 +02:00
Gabriel Ravier
32c8795ead src: Cleaned up includes to only (and always) include what we use
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-01 18:26:22 +02:00
Clownacy
a5c09b67f7 Wii U renderer cleanup 2020-06-29 22:13:03 +01:00
Clownacy
f6fe0537ed Add vertex-batching to Wii U port
Should remove the last bit of lag that port has (like the Labyrinth
fight where you team-up with Curly)
2020-06-29 21:37:05 +01:00
Clownacy
9925c16b29 Minor cleanup 2020-06-29 19:19:50 +01:00
Clownacy
93535c5501 Sync OpenGL3 renderer with Wii U renderer 2020-06-29 18:36:38 +01:00
Clownacy
1523f1d3a6 Unified the Wii U vertex buffers 2020-06-29 16:40:32 +01:00
Clownacy
c7bd79e13f Comment style tweaks 2020-06-29 15:25:01 +01:00
Clownacy
29f7c19a02 Fixed Null backend 2020-05-06 23:15:02 +01:00
Clownacy
5596c33b38 Fix stuff
Looks like the Null backend's been broken for a while though
2020-05-06 23:10:40 +01:00
Clownacy
e93ee47728 More backend rearranging
The Window stuff isn't meant for the user, so hide it a bit more
2020-05-06 23:02:08 +01:00
Clownacy
dacd34072a Fix everything after the last commit 2020-05-06 22:52:11 +01:00
Clownacy
616b9cda9e Rearrange shader files
The old way just kind of mashed two approaches together.
2020-05-06 22:40:10 +01:00
Clownacy
c5691d7570 Fix Wii U port when TV is set to 1080p
WUT's bugged. See here:
https://github.com/devkitPro/wut/issues/119

It apparently got this bug from the Decaf emulator. Maybe I should
tell those guys too.
2020-04-25 00:22:24 +01:00
Clownacy
a8d0595bcd Update other backends to current API
The only other backend besides the Wii U one to use `render_target`
is the SDLTexture one.
2020-04-23 14:38:45 +01:00
Clownacy
b841f22c6d Remember to free the glyph shader 2020-04-23 14:35:41 +01:00
Clownacy
b8dd512dc4 Free surface upon failure 2020-04-23 14:34:58 +01:00
Clownacy
d7c138f818 More error-handling 2020-04-23 14:33:59 +01:00
Clownacy
1f9247e587 Cleanup and extra error-handling 2020-04-23 14:31:19 +01:00
Clownacy
ee1d777ebb ...Actually do what the last commit said 2020-04-23 13:41:24 +01:00
Clownacy
a2cdd9ac18 Allow surfaces to be marked as not-render-targets
The Wii U has a very limited pool of memory for render targets
(32MB), so we should only use it if we have to.

This 'fixes' a bug in the enhanced branch, where if you use 2x
sprites at 854x480, the third line of the text box will be corrupted
(text will appear on the second line instead, and be black instead of
white).

The other renderers haven't been updated for the API change yet.
2020-04-23 13:23:10 +01:00
Clownacy
ebb96ad239 Cleanup 2020-04-22 01:50:31 +01:00
Clownacy
4752423ff3 Use pitch 2020-04-22 01:46:48 +01:00
Clownacy
0421a7ca54 Wii U: Glyphs don't use colour-buffers 2020-04-22 01:08:31 +01:00
Clownacy
abdd7fc771 Add missing case for Wii U screen size
My Wii U always uses this value
2020-04-21 23:53:37 +01:00
Clownacy
17fb47bce8 Correct typo 2020-04-21 22:27:13 +01:00
Clownacy
e1779248d9 Add error-prints to Wii U renderer 2020-04-21 22:22:00 +01:00
Clownacy
bc7b078df5 Make Wii U renderer support non 4:3 aspect ratios 2020-04-21 17:58:24 +01:00
Clownacy
b4d9b15a9c Add a TODO 2020-04-21 15:23:20 +01:00
Clownacy
ff9c2dc4fc Remove now-unneeded sanity checks 2020-04-21 14:57:05 +01:00
Clownacy
11b5fd88c5 Wii U: Use linear-filtering on the screen texture
Makes the font looks less terrible (on 720p TVs, anyway).
2020-04-21 13:59:47 +01:00
Clownacy
b2a0ad089f Move Wii U shaders 2020-04-21 13:02:06 +01:00
Clownacy
5b636ccc24 Cleanup 2020-04-21 13:00:34 +01:00
Clownacy
0aba8888bb Wii U: Update colour in PrepareToDrawGlyphs 2020-04-21 12:58:31 +01:00
Clownacy
90f729158a Wii U: Store glyph texture in R8 format 2020-04-21 12:56:14 +01:00
Clownacy
69e0d868a0 Added font rendering to Wii U 2020-04-21 12:45:37 +01:00
Clownacy
00792413f8 Cleanup 2020-04-21 03:34:59 +01:00
Clownacy
e687c502a9 Cleanup 2020-04-21 03:22:22 +01:00
Clownacy
4d2a227068 Add render-to-texture support to Wii U renderer 2020-04-21 03:16:37 +01:00
Clownacy
8377f011cf Add in-progress hardware Wii U renderer
*Very* incomplete. Right now, it can render textures and perform
colour-fills to the screen.
2020-04-21 00:59:12 +01:00
Clownacy
8524d1e349 Change software renderer backend API 2020-04-15 21:59:23 +01:00
Clownacy
073e62de46 Software renderer tweaks 2020-04-15 16:57:05 +01:00