Commit graph

2629 commits

Author SHA1 Message Date
Clownacy
7d51a80007 Remove C++11 from GLFW3 platform backend 2020-09-08 03:56:52 +01:00
Clownacy
84d6b50bc2 Remove platform backend dependency on core engine
The backends need to have no dependency on the engine, otherwise
there'll be conflicts when we do stuff like include `window.h` in a
file that also happens to include "WindowsWrapper.h" somewhere.
2020-09-08 03:52:23 +01:00
Clownacy
bdcb1f3a3e Remove Organya dependency from platform backend 2020-09-08 03:36:11 +01:00
Clownacy
633ac64641 Go back to C++98
Now that `cute_spritebatch.h` is gone, there's only one other bit of
C++11 in the project that I can think of.
2020-09-08 03:24:55 +01:00
Clownacy
d1a9754784 Fix uninitialised memory usage 2020-09-08 03:23:36 +01:00
Clownacy
fcf1e9d0c4 Link glyph array from back to front
This way, glyphs are allocated from front to bacl, which makes the
atlas much more pleasant to look at.
2020-09-08 03:14:53 +01:00
Clownacy
80df145d3f Fix Japanese text
Sweet mercy I'm bad at FreeType2
2020-09-08 03:04:01 +01:00
Clownacy
b37e088465 Remove an empty line 2020-09-08 02:48:06 +01:00
Clownacy
f079a14b58 Update the SDLTexture renderer 2020-09-08 02:40:27 +01:00
Clownacy
0b83da1fd9 Make the Wii U batch its font rendering
Yaaaaaaaay
2020-09-08 02:12:37 +01:00
Clownacy
2eb5205dcc Remove cute_spritebatch.h 2020-09-08 01:58:51 +01:00
Clownacy
23156d38de Optimise OpenGL renderer a little 2020-09-08 01:55:57 +01:00
Clownacy
b080954a71 Wii U cleanup 2020-09-08 01:50:49 +01:00
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
1dcf3333fc Simplify some font logic 2020-09-06 20:30:47 +01:00
Clownacy
f4ffee2c99 Remove redundant font flag 2020-09-06 20:30:39 +01:00
Clownacy
34d3b8e664 Improve font rendering
This change fixes uneven glyph heights
2020-09-06 20:30:30 +01:00
Clownacy
df42d9300f Disable font anti-aliasing by default
CSE2 Portable is meant to be a purist thing - experiencing Cave Story
the way it was meant to be. The crappy font rendering was definitely
not how it was meant to be.
2020-09-06 17:10:46 +01:00
Clownacy
f908e2a064 Style tweaks 2020-09-06 15:26:57 +01:00
Clownacy
2963977cf9 Merge branch 'accurate' into portable 2020-09-04 02:36:19 +01:00
Clownacy
92d50ae187 Comment on a weird-ass Sleep call 2020-09-04 02:35:31 +01:00
Clownacy
3eced7b3e4 Implement the Sleep(100) call
Okay, seriously, why does the game do this?
2020-09-04 02:29:50 +01:00
Clownacy
bc165d0f0a Remove Organya-sleeping
Turns out that 'Sleep' call is ran on the *main* thread.

I have absolutely no idea why the game does this.
2020-09-04 02:26:31 +01:00
Clownacy
e2b5809990 Remove another explicit array size 2020-09-04 01:19:42 +01:00
Clownacy
7b1661dcf9 Merge branch 'accurate' into portable 2020-09-04 01:00:17 +01:00
Clownacy
b311888a12 Remove ccache in Travis file
This matches the portable branch
2020-09-04 00:57:00 +01:00
Clownacy
5579c57738 Remove some explicit array sizes
These are just annoying, and chances are the source code never did
this.

I might just remove *all* of these at some point.
2020-09-04 00:54:23 +01:00
Clownacy
4caa023347 Merge branch 'accurate' into portable 2020-09-04 00:49:45 +01:00
Clownacy
ed01b9d591 Update screenshot
Moves Quote to the 'New' option, to match the accurate branch's
screenshot.
2020-09-04 00:44:29 +01:00
Clownacy
c81829e99a Remove a trailing comma
IIRC C89 doesn't allow them in enums. So who knows where else they're
not allowed?
2020-09-04 00:23:07 +01:00
Clownacy
9bba04b395 Rename some background enums 2020-09-04 00:19:49 +01:00
Clownacy
d16aa4cc70 Apply background constants to stage table 2020-09-04 00:09:38 +01:00
Clownacy
fe7765c914 Change some awkward wording 2020-09-03 23:57:07 +01:00
Clownacy
d5cf991733 Make the stage table neater 2020-09-03 23:56:44 +01:00
Clownacy
8f38cf56c1 Restore the original Waterway TSC file
No need for a manual bugfix anymore.
2020-09-03 22:20:32 +01:00
Clownacy
ad27a40ba3 Tiny cleanup 2020-09-03 22:17:06 +01:00
Clownacy
d250d0de7d Overhaul bin2h
Now it just outputs big lists of numbers, instead of a proper array.
This allows Resource.cpp to control the name of these arrays, while
also making the resource system in general more transparent.
2020-09-03 22:14:13 +01:00
Clownacy
71199c7693 Merge branch 'accurate' into portable 2020-09-03 21:58:40 +01:00
Clownacy
dce5e215c8 Explain the gamepad button limit 2020-09-03 21:54:10 +01:00
Clownacy
9c63e5994b Document SelStage.cpp a little 2020-09-03 21:52:05 +01:00
Clownacy
aa396092b5 Translate error messages with FIX_BUGS 2020-09-03 21:39:36 +01:00
Clownacy
7cff891452 Remove that FRAMERATE thing 2020-09-03 21:31:49 +01:00
Clownacy
b1090cd8f9 Correct some mistakes that this branch has 2020-09-03 21:29:48 +01:00
Clownacy
a05b802904 Merge branch 'accurate' into portable 2020-09-03 21:11:16 +01:00
Clownacy
0c367cecf7 Add FIX_MAJOR_BUGS option
This one specifically fixes bugs that either invoke undefined
behaviour or cause memory leaks. Essentially, they affect stability.
Bugs that just affect gameplay will remain covered by FIX_BUGS.
2020-09-03 21:05:14 +01:00
Clownacy
e43160825e Add bugfix for the broken Waterway TSC script 2020-09-03 20:35:51 +01:00
Clownacy
987b81c946 Fix other audio backends 2020-09-03 19:59:37 +01:00
Clownacy
7abab0039b Pre-convert the Organya callback timer
Oh no, I used the naughty 'm' word :(
2020-09-03 19:19:55 +01:00