Commit graph

1534 commits

Author SHA1 Message Date
Gabriel Ravier
2911bfda5c Removed memory leak in Backend_LoadGlyph
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-06 18:26:25 +01:00
Gabriel Ravier
752b4cee3f Correct bug in which Backend_LockSurface would not initialize surface->pixels, leaving a bug in which Backend_UnlockSurface used uninitialized values in certain scenarios (such as in ScaleAndUploadSurface)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-06 18:26:25 +01:00
Gabriel Ravier
befb5f7fb5 ScaleAndUploadSurface now doesn't take ownership of the surface it is passed and frees it. This is to correct multiple occurences of use-after-free occuring from use of the passed surface after a call to ScaleAndUploadSurface using it 2020-01-06 18:26:25 +01:00
Clownacy
f36fc61de3 Made Input.cpp more ASM-accurate
There was one ASM-inaccuracy I missed last time, but now I've also
made the file's memory layout accurate (it appears that global
variable initialisation actually affects the order they reside in
memory).
2020-01-06 16:57:41 +00:00
Clownacy
5d12071f17 Make DoConfig check Config.dat's magic number
Fixes #88

The issue was caused by Config.dat reading a CSE2E Config.dat, and
preserving its altered magic number, which Cave Story would reject,
causing it to fallback on default settings.
2020-01-06 16:38:47 +00:00
Clownacy
df534bb612 Fix SDLTexture backend's linked-list
Was causing some use-after-free behaviour, according to valgrind.

Should fix #87
2020-01-06 14:48:56 +00:00
Clownacy
38484613d5 Better GUID-printing bugfix
%hhx is a C99 thing, apparently.
2020-01-05 04:44:32 +00:00
Clownacy
354f23cf3f Improved accuracy of Input.cpp
Applied some missing constants/macros, and corrected an
ASM-inaccuracy.

I always wondered why the original code only passed the first member
of the GUID struct, but it turned out it didn't: it actually passed
the whole thing.

Also, it's starting to bother me how many ASM-inaccuracies have
sneaked-through. v2.0 was *meant* to have fixed all this already.
2020-01-05 03:48:02 +00:00
Clownacy
1cc3d7fe30
Merge pull request #86 from GabrielRavier/bugFix/portableTravisCI
Fix Travis-CI build
2020-01-05 00:19:56 +00:00
Gabriel Ravier
1193ec8415 Update XCode to the most recent version
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-05 00:57:23 +01:00
Clownacy
d4f13cea8a Merge branch 'accurate' into portable 2020-01-04 21:53:06 +00:00
Clownacy
9bfaeb5390 Apply some more missing constants 2020-01-04 21:48:52 +00:00
Clownacy
bbf77f9cfd Capitalise a macro 2020-01-04 20:57:36 +00:00
Clownacy
cd589b7c1d Specify the OpenGL3 backend in the readme 2020-01-04 20:50:38 +00:00
Clownacy
2e8d3441ed Turns out I'm the stupid one 2020-01-04 19:49:43 +00:00
Clownacy
0ed19894ba Merge branch 'accurate' into portable 2020-01-04 19:46:52 +00:00
Clownacy
5b4d343df4 Apply missing constants
Yay WinAPI
2020-01-04 19:45:39 +00:00
Clownacy
0218402222 Fully-initialise the JOYSTICK_STATUS struct
This matches the vanilla behaviour.
2020-01-04 19:41:04 +00:00
Clownacy
b00e65b90b Merge branch 'accurate' into portable 2020-01-04 01:09:49 +00:00
Clownacy
deadc396bc Don't deinit SDL before calling an SDL function
Also, it's possible for SDL to initialise without 'joystick' being
set to a non-NULL value.
2020-01-04 01:09:07 +00:00
Clownacy
b35fa162e0 Remove a pair of variable declarations
Besides, these are defined in Main.cpp, not KeyControl.cpp.

Anyway, according to the Linux debug data, these two were never
declared outside of Main.cpp, showing they were never declared in a
header file.
2020-01-04 01:01:11 +00:00
Clownacy
6052a09074 Apply missing KEY_ESCAPE constant 2020-01-04 00:52:57 +00:00
Clownacy
b81023f63c Fix a bug in River.tsc that affects portability
Funny story: so, there's a bugged TSC command in this file, which
causes it to try to read a flag beyond the end of the flag array.
If the memory it reads happens to be set to true, then it will
attempt to jump to an invalid event number, causing a crash.

Since I don't want to riddle CSE2's codebase with ugly compatibility
hacks, I think it's best to just fix the TSC file directly.
2019-12-21 14:53:01 +00:00
Clownacy
a0d11aee3c Makefile warning cleanup
The escape character seems to be unneeded.
2019-12-05 16:05:56 +00:00
Clownacy
cb494f8f35 Merge branch 'accurate' into portable 2019-12-05 15:54:55 +00:00
Clownacy
5cb06c9b76 Use $(info instead of echo 2019-12-05 15:53:49 +00:00
Clownacy
fc68b772a8 Merge branch 'accurate' into portable 2019-12-05 15:50:56 +00:00
Clownacy
5985fceaee Indent non-recipe Makefile lines with spaces
Apparently tabs should only be used for recipies
2019-12-05 15:46:38 +00:00
Clownacy
fdae7f89a5 Use $(shell instead of backquotes in the Makefile 2019-12-05 15:40:42 +00:00
Clownacy
b936e1dc00 Un-hardcode the DoConfig Makefile target
Now it too is affected by CXXFLAGS-overriding.

I should probably do something about fltk-config, though.
2019-12-05 15:27:22 +00:00
Clownacy
6a8017dd38 Merge branch 'accurate' into portable 2019-12-05 15:06:06 +00:00
Clownacy
20ed61a1f4 Define NDEBUG in RELEASE builds 2019-12-05 15:04:53 +00:00
Clownacy
5d562806b1 Merge branch 'accurate' into portable 2019-12-05 13:09:52 +00:00
Clownacy
b8c70473dc Make Makefile CXXFLAGS overriding safe
The new mingw-w64-make package on Arch Linux's AUR enables
cross-compiling by overriding the CC, CXXFLAGS, and LDFLAGS
variables, but previously CSE2's Makefile wasn't designed to allow
this, causing it to break. Now, it should work properly.
2019-12-05 12:51:57 +00:00
Clownacy
80e502b582 Merge branch 'accurate' into portable 2019-12-03 19:29:04 +00:00
Clownacy
0af9bcc89b Fix ASM-inaccuracy
I have no idea how that snuck through.
2019-12-03 19:27:26 +00:00
Clownacy
16b9f1f0a4 Clean-up PixTone.cpp some more 2019-11-21 19:50:20 +00:00
Clownacy
db3fb6c37b Merge branch 'accurate' into portable 2019-11-17 19:07:37 +00:00
Clownacy
0ec5d85d56 Merge branch 'accurate' into portable 2019-11-17 18:30:44 +00:00
Clownacy
4154b8c1bd Minor cleanup to IsEnableBitmap 2019-11-17 18:25:23 +00:00
Clownacy
7e2e2c1406 Add warnings to Makefile, and fix WINDRES 2019-11-17 18:04:20 +00:00
Clownacy
67c4156764 Shut up another Clang warning 2019-11-17 17:59:33 +00:00
Clownacy
87f74bcb6b Clean-up ActNpc169 2019-11-17 17:53:58 +00:00
Clownacy
dabf04f8ab Remove leftover macro 2019-11-17 17:53:50 +00:00
Clownacy
64412196f1 Shut up some clang warnings
This seems to produce the same assembly code
2019-11-17 17:14:08 +00:00
Clownacy
1a0cb626f8 Clean-up ArmsItem.cpp 2019-11-17 16:51:44 +00:00
Clownacy
5914ce01ef Clean-up Back.cpp 2019-11-17 16:31:34 +00:00
Clownacy
4e82665819 Clean-up Boss.cpp 2019-11-17 16:18:06 +00:00
Clownacy
d7033994ac Clean-up BossAlmo1.cpp 2019-11-17 16:05:42 +00:00
Clownacy
bcbab0745c Clean-up BossAlmo2.cpp
Pixel's way of converting tiles to units is inconsistent: the ASM
shows he sometimes does '* 0x200 * 0x10', other times it's
'* 0x10 * 0x200', and in this file he does '* 0x2000'.

This means TILES_TO_UNITS won't be usable for every case, so I'm not
sure if we should even have it. It's pretty clear that Pixel just
multiplied things manually, without a macro to keep things
consistent. And if we're getting rid of that, then what does that
mean for PIXELS_TO_UNITS?
2019-11-17 15:10:33 +00:00