Commit graph

2474 commits

Author SHA1 Message Date
Clownacy
f9fa8ccbbf Rework PHILOSOPHY.md some more 2020-09-14 13:21:47 +01:00
Clownacy
d59b3fab89 Update PHILOSOPHY.md
This branch has shifted focus slightly, from just porting Cave Story
as-is, to porting it while also trying to recreate the original 2004
experience.
2020-09-14 12:49:46 +01:00
Clownacy
afed830366 Only mark render-target textures as lost
SDL2 only loses target textures.
2020-09-14 12:49:34 +01:00
Clownacy
05b8b607fa Correct outdated comment 2020-09-14 12:26:56 +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
17da39fa14 Rename FontObject to Font
Explicitly calling it an object just seems unnecessarily verbose,
2020-09-14 11:54:37 +01:00
Clownacy
1625d3961d Correct some awkward wording 2020-09-14 11:50:48 +01:00
Clownacy
0cdd6ad4df Rename a rect 2020-09-14 10:44:54 +01:00
Clownacy
2d5f6a547d Disable blending for the framebuffer 2020-09-14 10:42:31 +01:00
Clownacy
5e28463509 Remember to free the upscaled framebuffer 2020-09-14 10:39:16 +01:00
Clownacy
56b96ed432 Only use an upscaled framebuffer if we have to 2020-09-14 10:36:35 +01:00
Clownacy
53e96486ce Use proper texture access type 2020-09-13 19:50:47 +01:00
Clownacy
2f748810bf Disable blending for the upscaled framebuffer
I'd set it to RGB24 instead of RGBA32, but I don't know if there'd be
a performance penalty.
2020-09-13 19:41:19 +01:00
Clownacy
4517c9be9e Fix incorrect upscaled framebuffer size 2020-09-13 19:37:01 +01:00
Clownacy
c12149b96e Fix a weird old typo 2020-09-13 19:35:31 +01:00
Clownacy
7bc028f5d8 Enable window-resizing in the SDLTexture renderer
Previously, the window was a fixed size just like the original.

This change highlights a weird issue in CSE2: this doesn't exactly
match the behaviour of the original game, so why did I change it?
Simple: monitors had much lower pixel-densities back in the early
2000s, meaning that 320x240 and 640x480 weren't as laughably small as
they are today.

I like to think of CSE2's portable branch as Cave Story's equivalent
to Chocolate Doom: the point isn't to replicate the game's behaviour
100% - that's the accurate branch's job - no, the point of the
portable branch is to replicate the *experience* of the game, as it
was back in 2004. This means no commically-small windows.

This is the same reason font anti-aliasing is disabled, even in
versions of Windows later than XP.

Sidenote: the OpenGL3/OpenGLES2 renderers already had this feature,
but they used linear-filtering, causing the screen to be extremely
blurry in 320x240 mode. This renderer uses a better method, which
does apply slight blurring at the edges of pixels at resolutions
that aren't an exact multiple of 320x240/640x480, but otherwise it
resembles nearest-neighbour. This is way nicer to look at, and fits
the game's aesthetic. This feature will be ported to the other
renderers soon.
2020-09-13 18:17:58 +01:00
Clownacy
aa3cd55b43 Fix SDLTexture surface freeing 2020-09-13 12:30:56 +01:00
Clownacy
bf93334b94 Fix out-of-bounds font atlas accesses 2020-09-13 12:30:01 +01:00
Clownacy
5e7f514b6f Hopefully fix font atlas pixel bleeding 2020-09-13 12:29:50 +01:00
Clownacy
5b33d0280d Merge branch 'accurate' into portable 2020-09-12 00:30:03 +01:00
Clownacy
f47ffea577 Remove a bugfix
It can't be saved...
2020-09-12 00:01:42 +01:00
Clownacy
f54dc8ce05 Ramble about the broken font sizes 2020-09-11 23:55:25 +01:00
Clownacy
a6408b330f Fix build error 2020-09-11 23:10:47 +01:00
Clownacy
a37e1d31f2 Remove extra newline 2020-09-11 13:06:52 +01:00
Clownacy
0324d1532b Apply SurfaceID type 2020-09-10 21:29:25 +01:00
Clownacy
1f88f7ffaf Make some code uniform 2020-09-10 21:26:22 +01:00
Clownacy
84c1e00c95 Tidy-up some code 2020-09-10 19:07:46 +01:00
Clownacy
69f3fbcd5a Change a dumb parameter 2020-09-10 17:56:22 +01:00
Clownacy
0fa538732d Use PrintError instead of ShowMessageBox 2020-09-10 17:48:21 +01:00
Clownacy
b065882f24 More size_t 2020-09-10 17:42:18 +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
d80ef38af5 Lock SDL2 software renderer surface properly 2020-09-10 16:02:13 +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
0bdbb4f6bb Made some message-printing code more consistent 2020-09-10 15:39:10 +01:00
Clownacy
7c4a2b5caa Lock SDL_Surfaces 2020-09-08 18:53:06 +01:00
Clownacy
f1a85d4d2c Fix Wii U compilation 2020-09-08 12:55:19 +01:00
Clownacy
07f70200d0 Renderer cleanup 2020-09-08 12:48:25 +01:00
Clownacy
a0378dc30c Fix build errors 2020-09-08 12:48:17 +01:00
Clownacy
0a912b7f11 Change some type from int to size_t 2020-09-08 04:36:45 +01:00
Clownacy
4078182ee8 Add a bugfix for the blinking text cursor 2020-09-08 04:20:17 +01:00
Clownacy
f5828667a6 Update remaining platform backends 2020-09-08 04:04:27 +01:00
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