Commit graph

94 commits

Author SHA1 Message Date
Clownacy
3889bd9f1d Add missing #include to Draw.cpp
Thanks to GabrielRavier for noticing.
2019-09-10 12:31:38 +00:00
Clownacy
93029e8e2c Fix incorrectly-ordered #include 2019-09-04 14:13:51 +00:00
Clownacy
dcf9921481 Move SystemTask from WindowsWrapper.h to Main.h 2019-09-04 02:23:49 +01:00
Clownacy
0faf06224f Added a bugfix for font creation
Fixes Japanese builds using the wrong charset on non-Japanese Windows
installations, and fixed the font using antialiasing, causing it to
clash with the game's colour-keying.
2019-09-01 20:30:26 +01:00
Clownacy
f956eb9264 Mostly ASM-accurate Draw.cpp
See #74
2019-08-31 17:43:45 +01:00
Clownacy
03e513365b PATH_LENGTH is actually Windows's MAX_PATH
When MAX_PATH isn't available, use FILENAME_MAX. This might be a bad
idea.
2019-08-31 01:44:53 +01:00
Clownacy
0af39741d4 Merge branch 'master' into accurate 2019-08-29 00:22:18 +01:00
Clownacy
9f81f9e080 Move MakeSurface_Generic to the correct place in Draw.cpp 2019-08-29 00:21:43 +01:00
Clownacy
e67c1e3640 Migrated to the native Windows resource file system 2019-08-27 23:59:57 +01:00
Clownacy
b6322d5e0f Make LoadBitmap take a pixel buffer instead of an SDL_RWops 2019-08-27 16:10:37 +01:00
Clownacy
64598dc2a5 Rename Surface_Ids to SurfaceID
For code style consistency (this isn't a vanilla enum name - I don't
think there even was an enum for this in the original source code)
2019-08-21 16:18:55 +00:00
Clownacy
f354b84f6a Revert "Glyphs now regenerate with the rest of the game's textures"
This reverts commit aa6174b3f2.
2019-08-14 16:26:37 +00:00
Clownacy
e708dc3a7d Make the surface_metadata struct match the original 2019-08-13 19:48:18 +01:00
Clownacy
aa6174b3f2 Glyphs now regenerate with the rest of the game's textures
God-damn this code is ugly
2019-08-13 18:32:44 +01:00
Clownacy
16b2f6a474 Added enums for the surface types 2019-08-13 04:42:29 +00:00
Clownacy
d47f683491 Ported the Windows version's surface regeneration
Has the same imperfections: if you regenerate the surfaces while a
text box is open (and while using Courier New I guess), the text will
regenerate with smaller spaces.
2019-08-13 04:36:05 +00:00
Clownacy
1b6804bbe1 Fix BackupSurface 2019-08-13 02:52:37 +00:00
Clownacy
3f8ead09d6 Renderer backend simplification part 1: Draw.cpp and Software.cpp
By emulating the DirectDraw code more closely, I can simplify the
renderer backend API.
2019-08-13 01:39:08 +00:00
Clownacy
85f58d7d39 Rendering backend API naming improvements 2019-08-10 19:50:10 +01:00
Clownacy
2b86db32a0 Backend_Blit always uses a colour key 2019-08-10 19:31:45 +01:00
Clownacy
607bbfcef8 Remove some debug prints
I prefer to only print on error
2019-07-31 23:12:06 +00:00
Clownacy
9948fa8b07 Move the SDL_Window creation to the rendering backends
Whoops, didn't mean to commit the Main.cpp edit way back when I made
the OpenGL 2.1 backend.
2019-07-24 20:20:06 +01:00
Clownacy
6d385e674f Font refactor part 1: Software
With this, font blitting is handled by the rendering backend, paving
the way for hardware-accelerated font drawing in the accelerated
backends.
2019-07-23 16:38:04 +01:00
Clownacy
a3278a60b5 A fix, some documentation, and cleanup 2019-07-19 19:19:35 +01:00
Clownacy
74c9931ebb Change the renderer backend API for uploading pixels
Also fix some blatant build errors. I must be going mad - I swear
I've fixed that typedef thing like twice already.
2019-07-19 08:45:59 +01:00
Clownacy
36fdb4596d Cleanup and an accuracy improvement 2019-07-16 13:21:21 +01:00
Clownacy
81eb438482 Fixes and tweaks 2019-07-16 00:15:20 +01:00
Clownacy
6a4f4e0df3 Added handlers for render target loss/window resize
These only really happen when you use exclusive fullscreen and
alt-tab out. Or, at least, it does on Windows with SDL2 in DirectX
mode.
2019-07-15 17:47:22 +01:00
Clownacy
15bfd00d25 Added hardware-accelerated rendering backend
Still need to add the code for surviving render target losses
2019-07-15 16:47:10 +01:00
Clownacy
21cf78b86d Split Draw.cpp into common code and backend code
Should be easy to add the new hardware renderer now
2019-07-15 13:42:49 +01:00
Clownacy
3ef9b67b1d Replaced a lot of Draw.cpp with a software renderer
Also fixed the SDL_Window not being freed. This commit's a bit of a
blob, since I made a bunch of tweaks to Draw.cpp while adding the new
renderer. Don't worry though, I'll add the hardware accelerated code
back again soon. In fact, I've got an idea on how to make it even
faster, while still being able to survive render target losses.

Hopefully this software renderer will come in handy for the Wii U
port: its SDL2 port's hardware acceleration is broken, and the
SDL_Surface API is too slow.
2019-07-15 11:41:40 +01:00
Clownacy
21d5ba34b0 Shut up some Clang warnings in the Enhanced branch
Once again SDL2 using plain ints everywhere causes issues.
2019-06-27 18:01:55 +00:00
Clownacy
44f142d8e7 Big ugly rework of WindowsWrapper.h
Okay so WindowsWrapper.h now just includes Windows.h if it wants
non-portability. This meant I had to split the custom RECT struct
back to the original RECT and unknown nameless struct (one uses
left/right, while the other uses front/back).
2019-06-20 20:06:55 +01:00
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