Commit graph

61 commits

Author SHA1 Message Date
Clownacy
c80b593a3f Some #include fixes
Finally figured out how to get include-what-you-use working
2019-06-06 18:44:28 +00:00
Clownacy
d2b5872c95 Weeded out some bool usage
Cave Story was written in C89. No bools. I've left in Sound.cpp's
though, since that's written in C++98 currently.
2019-05-24 10:07:30 +01:00
Clownacy
fcaddc6252 Added a missing #include to Draw.cpp 2019-05-20 15:03:15 +01:00
Clownacy
d5dd2c9575 Made TextScr.cpp almost ASM-accurate
TextScriptProc is all that's left, but it's being a pain, so I'm
commiting this now, and dealing with the straggler later.
2019-05-13 23:51:11 +01:00
Clownacy
9b82baeb02 Made MiniMap.cpp actually ASM-accurate 2019-05-13 17:50:09 +01:00
Clownacy
9398314af6 Shut up some MSVC2003 warnings, and comment on another one
I'm not fixing that last one, since I'd rather futureproof the code in
the event the SDL2 devs update the function to use size_t.
2019-05-13 15:45:45 +01:00
Clownacy
676ee004fe Removed the dependency on stdint.h
This doesn't exist in MSVC2003, and nothing in the Linux port's debug
symbols indicate Pixel used it.
2019-05-13 15:18:33 +01:00
Gabriel Ravier
bf4aa6b6c0 Did some formatting and grammatical/orthographic corrections
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-05-10 09:46:05 +02:00
Gabriel Ravier
3d42044917 Corrected weird half-commented-out code
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-05-07 17:52:33 +02:00
Gabriel Ravier
e8875bd051 Redid formatting for files starting with [C-E]
Also fixed potentially erroneous macro MAX_STRIP (would have problems with operation order in operations)
Btw used regex "((//|\;)[^ \t]|(for|while|if|while|do|void|int|bool)\(|(for|while|if|while|do)\ \(.*\)\;|\(\ |\ \)|//\ [a-z])" for this

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-05-07 15:39:59 +02:00
Gabriel Ravier
960fa6f456 Removed all trailing spaces and added newline at EOF (when not present)
Also changed a "linux" to "Linux"

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-05-07 11:55:42 +02:00
Clownacy
a6ac6787d3 Embed the fonts in the EXE
Now CSE2.exe should be drop-in replacement for Doukutsu.exe, with
no extra files needed.
2019-05-05 14:03:16 +01:00
Clownacy
f7c1ca86c3 Remove Resource.cpp's dependence on SDL2
This also makes its API a lot more similar to Windows'
2019-05-05 01:57:23 +01:00
Clownacy
f25df2ce07 Remove SDL2 dependency from Font.cpp 2019-04-21 21:28:18 +01:00
Clownacy
d38c96622c Remove Raspberry Pi hack that forces SDL2 to use OpenGLES2
This was only for Void and Arch ARM, but I think I'm just setting them up
wrong. Raspbian doesn't need this hack to reach 60FPS.
2019-04-18 19:58:40 +01:00
Clownacy
923cd5a6e3 Added some Raspberry Pi hacks
Also added a debug print that tells you what backend SDL2 is using
2019-03-18 20:54:03 +00:00
Clownacy
e864f7e142 Removed the alpha channel from the surfaces
It's not needed here, where we use a colour-key instead. The enhanced
branch will need it though.
2019-03-11 14:38:11 +00:00
Clownacy
923749e41e Some more fixes for errors MSVC2003 noticed
Now I've got the entire project building with MSVC2003, _and_ I can
compare its ASM with Devilution's disassembler tool.
2019-02-22 21:18:39 +00:00
Clownacy
b648268283 Changed CortBox(2) col parameter from RGB to BGR
That's how it is in the original. Look up Microsoft's COLORREF.
2019-02-21 21:01:16 +00:00
Clownacy
5ba0454bc8 Made Fade.cpp ASM-accurate 2019-02-21 19:46:52 +00:00
Clownacy
367b41bc88 Fixed another case of assuming long is 32-bit 2019-02-20 15:08:35 +00:00
Clownacy
a76b7a3a87 Fix sprite upscaling on platforms where long isn't 32-bit
That was dumb.
2019-02-19 23:35:37 +00:00
Clownacy
9203105235 Shut up some warnings 2019-02-19 22:57:00 +00:00
Clownacy
ec148c1072 Made the spriterects C++03-compatible 2019-02-19 22:30:43 +00:00
Clownacy
4d04590b28 Made the game compile as C++03
Still need to sort out the C++11-only initialiser lists that GCC allows
in C++03 mode with a warning.
2019-02-19 16:05:28 +00:00
Clownacy
fbaf46548f Made Back.cpp about as ASM-accurate as I can make it
...without removing the widescreen stuff, at least.
2019-02-19 00:50:16 +00:00
Clownacy
e1e49a4dcc Made ArmsItem.cpp ASM-accurate 2019-02-19 00:18:32 +00:00
Clownacy
0bb9760d87 Rearranged #includes 2019-02-18 21:30:22 +00:00
Clownacy
e5caff593c Removed the SDL dependency from Draw.h
Should make compiling with VC++ 2003 simpler
2019-02-18 20:40:07 +00:00
Clownacy
132d3c5110 Applied SURFACE_ID constants to everything 2019-02-18 14:36:58 +00:00
Clownacy
0403f26f66 Two fixes
Made InitBack work with .bmp backgrounds, and fixed a file not being
closed in Draw.cpp
2019-02-15 20:52:03 +00:00
Clownacy
3b395c2639 Draw.cpp fix and optimisations
For whatever reason, alpha blending is enabled by default on surfaces.
Disabling it should result in faster blits, and also follow DirectDraw's
behaviour more closely.
2019-02-14 14:18:05 +00:00
Clownacy
c844bc9f49 Avoid VLAs
'VLAs are bad because stack overflows' yeah yeah yeah except this
doesn't involve the stack at all.
2019-02-13 16:49:45 +00:00
cuckydev
08d9ca4ad8 fix??? 2019-02-12 21:28:44 -05:00
cuckydev
c387c31d04 help 2019-02-12 21:27:14 -05:00
cuckydev
c7da84bb9f accuracy? 2019-02-12 20:58:42 -05:00
Clownacy
3a08ad5006 Fixed 3x window upscaling
SDL's upscaler is stupid, and wound up being off-by one... on an
*integer-factor upscale*
2019-02-12 14:31:38 +00:00
cuckydev
5aea2ad77b Fortnite 2019-02-10 20:46:33 -05:00
Clownacy
37a6c1a7ab Merge branch 'master' of https://github.com/cuckydev/Cave-Story-Engine-2 2019-02-10 16:00:20 +00:00
Clownacy
38b846487a Fixed (C)Pixel .pbm protection on 32-bit builds 2019-02-10 15:59:48 +00:00
cuckydev
b951bf60d5 fix 2019-02-10 10:52:47 -05:00
cuckydev
ad64a0440b moved fonts to seperate folder, switched to joysticks for control 2019-02-10 10:39:45 -05:00
cuckydev
92b798610c Added some thingy 2019-02-10 09:29:51 -05:00
cuckydev
9e62a6d814 added core npc stuff 2019-02-06 22:26:42 -05:00
Clownacy
ee88e805b3 Fix some errors and prevent some GCC warnings 2019-02-05 22:51:44 +00:00
Clownacy
d52a69b0e6 Fix dumbass font problems
The 320x240 font is still one pixel too high, but honestly I don't give
a shit. It looks better anyway since the vanilla way is off-centre.
2019-02-01 13:50:32 +00:00
Clownacy
4f7db164d6 Overhauled graphics system
Along with being more accurate to the original, this fixes switching out
of fullscreen causing textures to disappear. This was caused by DirectX
destroying textures that are marked as render-targets when a device-loss
occurs. SDL2 doesn't do anything to recover them, unlike regular
textures, so my solution is just to avoid render-target textures
entirely.

On the upside, this should make drawing text to surfaces much faster,
since we're not reading back bitmaps from the GPU.
2019-01-30 21:07:47 +00:00
cuckydev
bea22e72e0 bullet 2019-01-30 16:03:10 -05:00
Clownacy
90ef30bece Added option for fonts to be loaded from Windows
This restores some compatibility with Config.dat's font settings.
2019-01-29 14:20:25 +00:00
Clownacy
cd276d94be Fix possible bug in CortBox2
Cppcheck was complaining about duplicate conditions
2019-01-29 14:20:21 +00:00