Commit graph

167 commits

Author SHA1 Message Date
Clownacy
b3591ba3da Remove dead code 2020-04-01 21:37:45 +01:00
Clownacy
add0627f03 Restore custom cursor support 2020-04-01 21:36:46 +01:00
Clownacy
f23117bbdc Overhaul how window icon loading works
Now most of it has been moved out of the backends.
2020-04-01 21:20:26 +01:00
Clownacy
878cac3b3f Implement mouse-hiding in fullscreen 2020-04-01 21:05:05 +01:00
Clownacy
c4aa8e28bb More refactoring 2020-04-01 14:57:07 +01:00
Clownacy
5dbca99e19 Extremely horrible terrible nightmare refactoring
Working on ridding CSE2 of its hard SDL2 dependency.

For now, I have a rudimentary GLFW3 backend.
2020-03-31 21:56:10 +01:00
Clownacy
3a5a5044b1 Split SDL2 code from Main.cpp 2020-03-31 16:07:34 +01:00
Clownacy
51562f6fd8 Use standard main return values
`WinMain` has weird rules for this, and they don't match `main`.
2020-03-31 15:37:51 +01:00
Clownacy
b8de1cb5db Merge branch 'accurate' into portable 2020-03-31 14:07:21 +01:00
Clownacy
f6606b7748 Add some missing function names
These were retrieved from the Mac port (v0.0.7), which kept these
functions.

Unfortunately, this port is missing local variable names, so we can't
use it to make InitBack accurate.
2020-03-22 15:31:28 +00:00
Clownacy
76e4fb5e8a Improve MSVC6 hacks 2020-03-14 14:08:25 +00:00
Clownacy
8a3b5c1f7a Use macros instead of __stdcall
Wow Microsoft's documentation sucks: it constantly omits these,
making you think they're just plain `__cdecl`.
2020-03-14 13:22:36 +00:00
Clownacy
4e0a168533 Move the MSVC6 hacks to WindowsWrapper.h
Now the wrapper has a purpose again, and it keeps things neat.
2020-03-14 12:55:22 +00:00
Clownacy
406ff18909 Add CMakeLists.txt and Visual Studio 6 support
The CMake file allows you to compile the accurate branch with
whatever version of Visual Studio you have lying around, without
having to clumbsily convert the VS2003 project.

I've tested this with VS2019, VS2003, and VS6. VS6 is goofy - it's
missing a few types and constants, and it's not smart enough to
realise that ints and longs are the same in ILP32 data models. I've
added a few small hacks to address this. Might undo them. Who knows.

For now, I want to support VS6 because Mint compiled CSE2 with it
before, and because VS6 uses `msvcrt.dll` as its C runtime, which
apparently comes pre-installed in Windows, as opposed to all those
other annoying runtime versions that require they be installed
separately (which is why MinGW targets it specifically).

Also, VS6 *should* give us Win95-compatible builds. The internet says
MSVC2003 is Win95-compatible too, but Mint claims the vanilla EXE
doesn't run on there. I imagine it has something to do with its
static runtime library (VS2003 links the static one by default for
some reason).
2020-03-13 21:35:51 +00:00
Clownacy
bd876e9309 Change icon resource IDs
Visual Studio 2017 doesn't like them being 0 and 1: the compiled EXE
uses the small icon as the taskbar icon. Changing them to 101 and
102, like CSE2 did before the accurate-portable-split, fixes this.
2020-01-28 21:26:28 +00:00
Clownacy
ede9fa213d Fix compilation with FIX_BUGS enabled 2020-01-23 00:03:54 +00:00
Clownacy
6dac8254e2 Begin merge of Backend_Init/Backend_CreateWindow
OpenGL3+OpenGLES2 backend done so far
2020-01-22 22:19:55 +00:00
Clownacy
976e2425fc Use native window/taskbar icons on Windows
This used to be a feature before the accurate-portable split, I'm
just restoring it.

Previously, while the EXE itself had a unique icon, the window and
taskbar both used the generic 'small' icon, which the original EXE
only used for the window.

SDL2 gives us a way to assign separate icons to each, but it's a
little clunky: it's Windows-only, requires the icons be in .ico
format, and needs them to be embedded in the EXE as resource files.
Also, for some reason, SDL2 doesn't let us refer to them by name - we
have to use their numerical ID.
2020-01-21 11:27:32 +00:00
Clownacy
0c9c0115cf Whoops. Fix typo. 2020-01-17 10:54:34 +00:00
Clownacy
22622ae69a Merge branch 'accurate' into portable 2020-01-17 10:37:21 +00:00
Clownacy
6764f17ab9 Added bugfix for StartDirectDraw failure
The original code didn't account for it failing, which leads to
annoying bugs happening whenever it does fail.

Now, the game just closes, like it does with any other init error.
2020-01-17 10:35:43 +00:00
Clownacy
54189c598d Explicitly init SDL2's video subsystem 2020-01-16 16:36:03 +00:00
Clownacy
776f01777a Merge branch 'accurate' into portable 2020-01-15 07:28:18 +00:00
Clownacy
78a066ce75 Note some inaccurate stack frames 2020-01-09 06:58:04 +00:00
Clownacy
9cbaa0be00 Merge branch 'accurate' into portable 2020-01-08 13:16:21 +00:00
Clownacy
d83665ff2a More-accurate Main.cpp variable arrangement 2020-01-07 06:29:04 +00:00
Clownacy
58d7a45392 Empty Tags.h
There's no evidence Tags.h contained these variables (if anything, it
appears that Pixel manually declared them in every file that used
them).

gg Pixel
2020-01-06 21:20:17 +00:00
Clownacy
9498fe13be Made TextScr.cpp valid C89
See #41
2020-01-06 21:15:42 +00:00
Clownacy
0ec5d85d56 Merge branch 'accurate' into portable 2019-11-17 18:30:44 +00:00
Clownacy
6c2ca988a8 Clean-up Main.cpp
Found an ASM-inaccuracy. Yay.
2019-11-15 18:31:48 +00:00
Clownacy
6b98bffba1 Remove mutex_name
It's unused outside of the accurate branch. Maybe someday I'll port
the mutex behaviour.
2019-10-29 12:01:49 +00:00
Clownacy
785131a184 Merge branch 'accurate' into portable 2019-10-26 23:47:06 +01:00
Clownacy
9fb01161c3 Swap two function calls around
This matches the original EXE. I didn't catch it while doing the
ASM-accuracy checks because absolute addresses don't match yet.

Thanks to Gabe for noticing this.
2019-10-26 23:40:32 +01:00
Clownacy
591236398f ...And don't break the indentation
Am I rusty, or something? Jeez.
2019-10-02 15:28:21 +00:00
Clownacy
5329a6d1b7 ...goddammit I didn't save 2019-10-02 15:25:43 +00:00
Clownacy
8f6403f233 Catch another instance of Shift-JIS
Also removed the translation because it's ASM-inaccurate
2019-10-02 15:24:36 +00:00
Clownacy
217ce5437b Port the Windows version's mouse-hiding
The original Windows version would hide the mouse cursor in
fullscreen.
2019-09-08 23:59:13 +00:00
Clownacy
e216fa8e18 Remove the old colour-depth code
It's basically unused anyway
2019-09-08 23:58:48 +00:00
Clownacy
4e239c3175 Restore the rendering backend callbacks
Now the SDLSurface backend survives window resizes (also triggered by
alt-tabbing while in fullscreen), and the SDLTexture backend properly
regenerates its textures after a fullscreen alt-tab in DirectX mode.
2019-09-06 19:07:49 +00:00
Clownacy
8114f88dd1 Shut up some build warnings 2019-09-06 15:21:43 +00:00
Clownacy
12f69e3c6c Fix idling hogging 100% of a CPU core
This was me not converting the WinAPI code properly. Stupid me.
2019-09-05 21:07:30 +00:00
Clownacy
0be5e9ead8 Restored the window icon and custom cursor 2019-09-04 14:39:37 +00:00
Clownacy
5ea356a3bd Weed out a lot of the Windows dependency
Storytime: Cucky's original SDL2 port work involved using SDL2's
threading API to emulate the original WinAPI threading.

I can't be assed with that stuff, so I used the same trick Cucky did
for the Wii port, and hooked Organya up to the SDL2 audio callback.
This actually opens up the possibility for perfectly-synchronised
Organya playback. By that I mean, instead of needing a super
low-latency audio callback, I can have the callback synchronise its
audio mixing with Organya itself. I haven't done it yet, I plan to
soon.
2019-09-04 00:28:23 +01:00
Clownacy
5a9492166d Restored the new SDL2 audio system
While I was at it, I overhauled the thing and found a bunch of
optimisations,
2019-09-03 22:29:57 +01:00
Clownacy
8dce9c5aff Add some missing code to the main function
This code was previously in WindowProc, which was replaced.
2019-09-03 00:43:05 +01:00
Clownacy
c00262bcd8 Restore the SDL2 joystick code
Modified to fit the original code better
2019-09-02 23:09:26 +01:00
Clownacy
fd855ee732 Restore the new renderers 2019-09-02 22:46:36 +01:00
Clownacy
ce33ada2c8 Fix window focus event handling 2019-09-02 22:28:21 +01:00
Clownacy
86f737802e Merge branch 'accurate' into portable 2019-09-02 20:30:26 +01:00
Clownacy
bc262bd5e2 Explain some Shift-JIS 2019-09-02 20:28:41 +01:00