Commit graph

97 commits

Author SHA1 Message Date
638918b4df Big endian changes 2025-04-12 17:44:22 +02:00
962bb9d477 Big endian define garbage 2025-04-12 17:38:29 +02:00
21323b964c Add big endian define (hack for Sun) 2025-04-12 17:27:55 +02:00
82566dabd2 Fix bugs on Sun (hopefully) 2025-04-12 17:22:49 +02:00
022144d727 Fix RenderBackend_ColourFill for 4-byte pixel format 2025-04-07 00:16:03 +02:00
faa808e238 Remove a little more 3DS gunk 2025-04-06 22:57:11 +02:00
c7dd1520c6 Skip copying unnecessary byte during blitting 2025-04-06 22:56:12 +02:00
6ab4984350 Adjust rendering code to 4-byte pixel format with unused byte 2025-04-06 22:48:08 +02:00
33b59f8219 Remove some 3DS stuff 2025-04-06 22:41:13 +02:00
Artemis Everfree
f06884b2a3 track dkp changes - update _3DS to __3DS__ & update README 2023-04-10 23:27:11 -07:00
Clownacy
98f78716f7 Update portable branch with licence boilerplates
Also added Cameron Cawley to the licence
2020-10-23 19:18:13 +01:00
Clownacy
ffcd989cea Remove unnecessary whitespace 2020-10-13 13:21:30 +01:00
Clownacy
a77cc0a559 Optimise the 3DS port (now runs okay on Old3DSs)
This commit customises the software renderer specifically for the
3DS, taking into account its rotated framebuffer and BGR format.

With this, the game appears to run full-speed on Old3DSs. Of course,
the level transition effect still makes the console chug, but that
thing was always a bit of a bottleneck.
2020-10-12 17:32:31 +01:00
Clownacy
83e8320d84 Fix other renderers 2020-09-17 18:26:32 +01:00
Clownacy
52c2a5ceee Make software renderer a bit more foolproof
This also eliminates some comparisons with mismatching signedness
2020-09-15 20:48:18 +01:00
Clownacy
11bbad7372 Cleanup
Now RenderBackend_DrawGlyph doesn't pass an unnecessary parameter
2020-09-15 19:40:10 +01:00
Clownacy
611afe7417 Remove those annoying renderer sanity checks
Duplicate junk. If they're that important, they can go in the game,
not the backends.
2020-09-14 23:55:39 +01:00
Clownacy
2bcab6adee Change software renderer sub-backend API
No more locking
2020-09-14 23:26:55 +01:00
Clownacy
6b18ec91be Replace LockSurface with UploadSurface
The old locking/unlocking API was plain inefficient. Soon I'll move
upscaling to the backend anyway, to minimise the overhead where
possible.

Currently only the software renderer has been updated.
2020-09-14 23:03:23 +01:00
Clownacy
63e4ac9aa9 Remove RenderBackend_FlushGlyphs
No longer used for anything
2020-09-14 12:25:39 +01:00
Clownacy
daa55b1a3c Allow font atlases to be non-square
Saves a little memory in some cases. It's the backend's job to decide
if this is a problem or not, and pad it if it has to.
2020-09-14 12:08:27 +01:00
Clownacy
69f3fbcd5a Change a dumb parameter 2020-09-10 17:56:22 +01:00
Clownacy
988f1128dd Convert a bunch of ints to size_t
ints are dumb - only use them when you have to
2020-09-10 17:36:21 +01:00
Clownacy
8ad56ced43 Remove superfluous brackets 2020-09-10 16:08:53 +01:00
Clownacy
f42a0530b0 Handle the framebuffer failing to lock
Also needed by SDL2
2020-09-10 16:02:02 +01:00
Clownacy
e90b903692 Change some variables to size_t
Really need to change the whole backend API to use size_t
2020-09-10 15:50:06 +01:00
Clownacy
b6c9467151 Switch software renderer to lockable framebuffer
SDL2 surfaces may require locking
2020-09-10 15:47:27 +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
5596c33b38 Fix stuff
Looks like the Null backend's been broken for a while though
2020-05-06 23:10:40 +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
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
Clownacy
c51a074fad Big disgusting backend rework
We need to avoid `WindowsWrapper.h` in the backends whenever we can,
to avoid name collisions (the Wii U homebrew library) defines its own
BOOL/TRUE/FALSE, which really doesn't work with CSE2.
2020-04-13 18:19:39 +01:00
Clownacy
aa9e486086 Handle WindowBackend_Software_CreateWindow fail
Must have been part of that commit I reverted
2020-04-13 13:49:21 +01:00
Clownacy
4f7cc9582d Revert "Backends: Added init/de-init messages for backends"
This reverts commit 9be8b9a493.
2020-04-13 13:28:57 +01:00
Gabriel Ravier
9be8b9a493 Backends: Added init/de-init messages for backends
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-12 02:26:51 +02:00
Clownacy
1f06027403 Added GLFW3 support for the software renderer
A few things need cleaning-up
2020-04-09 19:29:45 +01:00
Clownacy
1016411fa4 Cleanup 2020-04-06 13:37:53 +01:00
Gabriel Ravier
1d9048c8a6 Merge branch 'portable' into improvePerformance2
# Conflicts:
#	src/Backends/Rendering/Software.cpp
2020-04-05 01:16:09 +02:00
Clownacy
1ae63bea96 Move window ownership to the window backend 2020-04-04 20:51:07 +01:00
Clownacy
cdd69496c4 Fixes 2020-04-04 20:34:51 +01:00
Clownacy
135035bb1a Change 'PlatformBackend' namespace to 'Backend' 2020-04-04 20:31:27 +01:00
Clownacy
4d322be866 Change render backend namespace to RenderBackend_ 2020-04-04 20:24:34 +01:00
Clownacy
87e8a75df4 Rename GLFW3.h/SDL2.h 2020-04-04 19:18:46 +01:00
Clownacy
1543521625 Fix more errors x_x 2020-04-03 18:36:48 +01:00
Clownacy
f548044464 Cleanup 2020-04-03 18:05:41 +01:00
Clownacy
8266db3372 Shut-up another warning 2020-04-03 02:08:19 +01:00
Gabriel Ravier
f68984bd58 Merge branch 'portable' into improvePerformance2
# Conflicts:
#	src/Backends/Audio/SDL2.cpp
2020-04-03 00:36:44 +02:00
Clownacy
49f7887930 More cleanup 2020-04-01 16:27:55 +01:00