99 Commits

Author SHA1 Message Date
Fabian Greffrath
6039293aca replace the useless -statcopy parameter with -statdump from Chocolate Doom
Fixes #36
2020-01-16 10:31:11 +01:00
Fabian Greffrath
51b138b026 remove length check from ExtractFileBase()
This allows us to load demos with filenames longer than 8 characters.
2020-01-16 10:30:30 +01:00
Fabian Greffrath
6be3ec2d9e make flashing disk icon a bit less aggressive
We now only draw the disk icon if more than 20kb of WAD data have been read
during a tic, thanks @fragglet for noticing.
2020-01-16 08:55:58 +01:00
Fabian Greffrath
8bdbefcff5 cast pointers instead of silencing warnings
This will fix some strange behaviour which overrides some config
variables default values when resetting from the menu.

Fixes #34, thanks @JNechaevsky.
2020-01-15 08:54:24 +01:00
Fabian Greffrath
13715cd5f9 include config.h in doomdef.h 2020-01-14 16:19:59 +01:00
Fabian Greffrath
1f41cbee4b
bring back the flashing disk icon (#35)
* bring back the flashing disk icon (Fixes #13)

* further refinements to the disk icon code

* get away with only one static variable

* add a non hires-scaling variant of V_DrawBlock()

* add a comment to the new function prototype
2020-01-14 08:57:46 +01:00
Fabian Greffrath
de664b2669 build with -DRANGECHECK 2020-01-13 23:17:32 +01:00
Fabian Greffrath
9a53d72c21 turn error message into a full sentence 2020-01-13 23:09:55 +01:00
Fabian Greffrath
6fa9663ae8 add back the documentation
This adds back most relevant documentation from the WinMBF
binary and source code releases, file names converted to
lower case. Fixes #32.
2020-01-13 15:29:26 +01:00
Fabian Greffrath
2f9ea0128b actually check for the precense of the dlopen() function
and not merely for the presence of a library containing it.
2020-01-13 12:59:38 +01:00
Fabian Greffrath
0cba0cd83b fix building if dlopen() is no t available 2020-01-13 12:14:00 +01:00
Fabian Greffrath
317202c05f bring back the original Spectre/Invisibility fuzz effect
Apply the original fix found in @fragglet's repository from Lee's
why_i_left_doom.html. Fixes #33
2020-01-13 12:08:11 +01:00
Fabian Greffrath
3cd2ffdde5 dynamically load SDL_Image at runtime for PNG screenshots
Fixes #31
2020-01-13 12:03:15 +01:00
Fabian Greffrath
37767f4858 fix TRANMAP caching
When reading a TRANMAP lump in from a file, only the first 256 bytes
of the current palette are compared to the palette for which the
TRANMAP was created. An entire palette, though, consists of 256 RGB
tripel and is thus 3*256 bytes long. Thus, only the first third of
both palettes are compared and if these happen to match, translucency
will look glitched.

Fix this by comparing and writing out the entire palette to the cache
file.
2020-01-13 08:28:17 +01:00
Fabian Greffrath
37a15253dd fix crash when attack sound is missing 2020-01-11 12:46:00 +01:00
Fabian Greffrath
f8aaa2bfab ignore too short demo lumps
not only empty ones
2020-01-11 11:34:13 +01:00
Fabian Greffrath
00e17c0e1f pad the REJECT table when the lump is too small
This reverts the previous commit which only handled the case of an
absent REJECT table. No attempts are made to simulate REJECT buffer
overflows in Vanilla Doom, because MBF is a different EXE anyway.
2020-01-10 15:36:56 +01:00
Fabian Greffrath
170b9f2a38 print map name in error message 2020-01-10 14:57:42 +01:00
Fabian Greffrath
9aede18fc1 Allow to toggle full screen using Enter on num. keyboard
Thanks @JNechaevsky
2020-01-10 14:06:41 +01:00
Fabian Greffrath
dc26f2784f add a parameter to ignore cheats in dehacked files
Fixes #20
2020-01-10 12:10:55 +01:00
Fabian Greffrath
be3672b831 fix crash when a demo lump is empty
Fixes #23
2020-01-10 12:05:36 +01:00
Fabian Greffrath
c0c9c5e9c2 include string.h for strrchr() 2020-01-10 09:30:46 +01:00
Fabian Greffrath
6768824548
Dragdrop (#30)
* add drap-n-drop support

* move D_IsIWADName() down into the block where it is needed
2020-01-10 09:24:36 +01:00
Fabian Greffrath
765394837c
Doomprefdir (#29)
* Define a user-writeable directory with a little help from SDL_GetPrefPath()

 * Save config files, translation tables and savegames into this
   directory.
 * Screenshots are still saved into the "current" directory, i.e. the
   user's $HOME on Unix.

* unconditionally create the user-writable directory

* adapt to pending inclusion of m_misc2.c
2020-01-10 09:23:21 +01:00
Fabian Greffrath
6214abb7d7
Iwad dirs (#28)
* add a dynamically growing list of IWAD search directories

This is all taken from Chocolate Doom's src/d_iwad.c.

Also, take some helper functions from Chocolate Doom's src/m_misc.c
and put them into a separate m_misc2.c file. These will be useful for
further ported code, e.g. writable user directory and drag-n-drop
support.

Fixes #6.

* add support for a build-time configurable data directory

* add some more helper functions to m_misc2.c
2020-01-10 09:22:21 +01:00
Fabian Greffrath
6d6433422b
improve joystick handling code (#26)
again, using code adapted from Chocolate Doom.

While at it, implement prev/next weapon joystick buttons.

TODO: Menu and Automap joystick buttons.
2020-01-09 21:34:30 +01:00
Fabian Greffrath
6604722371 warn about unsupported node formats and exit gracefully 2020-01-09 21:25:04 +01:00
Fabian Greffrath
5a314ae831 support "extended nodes"
This converts some variables to their unsidged types, which enables
the port to load all maps which use the regular Doom BSP nodes format.

This enables the port to load some maps that it would normally choke
upon, e.g. Nova Maps 30 and 31; Eviternity Map 15 and Sunlust Maps 16,
18, 20, 24, 28 and 31.

It does still not support DeePBSP and ZDBSP nodes, and will probably
never do.

Fixes #23.
2020-01-09 21:05:04 +01:00
Fabian Greffrath
b7b15098b0
fullscreen toggle from the video menu (#24)
This appends a "Fullscreen Mode" entry to the Video menu.

While at it, clean up the previous menu changes a bit. Added menu entries are always appended to the end of a menu. Remove the now useless sound and music card selection entries.
2020-01-09 20:56:41 +01:00
Fabian Greffrath
9792e384b1
add support for more IWADs (#22)
More specifically, add support for the FreeDoom IWADs and for the
IWADs that are shipped with the Doom Classic engine that is used for
the Doom 3: BFG Edition.

 * Add the three FreeDoom IWADs to the standard_iwads[] array.
 * Improve the gamemissions detection, because freedoom2.wad contains
   characteristic lumps of both Plutonia and TNT.
 * Fixes #4.

 * Identify the BFG Edition IWADs by their unique DMENUPIC lump.
 * The BFG Edition IWADs have a PWAD signature, so be more forgiving
   in CheckIWAD().
 * Since the BFG Edition IWADs are missing the TITLEPIC lump, use the
   DMENUPIC lump instead.
 * Since the BFG Edition IWADs have their M_SCRNSZ menu graphic lump
   read "Gamepad:", use the unused M_DISP lump instead which reads
   "Display".
 * Fixes #3.
2020-01-09 17:38:23 +01:00
Fabian Greffrath
5f5e0e7aaf fix crash when loading maps without REJECT table
Fixes #18
2020-01-09 17:36:46 +01:00
Fabian Greffrath
edff9efc98 fix crash when loading trivial single subsector maps
Fixes #17
2020-01-09 17:34:58 +01:00
Fabian Greffrath
0084c53cb9 Merge branch 'master' of https://github.com/fabiangreffrath/WinMBF 2020-01-09 17:30:26 +01:00
Fabian Greffrath
4434949868 unify some compiler-specific code
more precisely, port the packed attribute definition for structs over
from Chocolate Doom
2020-01-09 09:43:09 +01:00
Fabian Greffrath
cd4b09f195 properly restore previous window size
when returning from fullscreen or changing rendering resolution
2020-01-08 22:18:27 +01:00
Fabian Greffrath
889f1e163e allow to build reproducibly 2020-01-08 21:57:00 +01:00
Fabian Greffrath
14720f7ca1 increase some string buffers to silence some more warnings 2020-01-08 15:18:24 +01:00
Fabian Greffrath
960c30c342 and yet more warning fixes uncovered by Travis CI 2020-01-08 15:01:20 +01:00
Fabian Greffrath
229dc77170 fix more warnings emerged by Travis CI 2020-01-08 14:51:30 +01:00
Fabian Greffrath
7b413032e7 make .travis.sh executable 2020-01-08 14:22:48 +01:00
Fabian Greffrath
85120fe5c8 add Travis CI 2020-01-08 14:14:07 +01:00
Fabian Greffrath
f282b0f9d8 fix all remaining cppcheck warnings
Checked with Cppcheck 1.89
2020-01-08 11:45:59 +01:00
Fabian Greffrath
ad483777cf stdint.h based 64 bit integer types 2020-01-08 09:33:56 +01:00
Fabian Greffrath
0d5ae9b1ad fix all remaining compiler issues
Checked with GCC 9.2.0 (MinGW-W32) under MSYS2 with
-O2 -g -Wall -Wdeclaration-after-statement -Wredundant-decls
2020-01-08 08:59:21 +01:00
Fabian Greffrath
3be0782240 remove all rcsid[] occurances 2020-01-06 12:46:35 +01:00
Fabian Greffrath
a3efe335ca fix all missing-braces type warnings in m_misc.c 2020-01-06 12:38:49 +01:00
Fabian Greffrath
c69d1430e7 fix all dangling-else type warnings 2020-01-06 12:18:13 +01:00
Fabian Greffrath
33a7d4834d remove last remaining DJGPP remnants 2020-01-06 11:19:07 +01:00
Fabian Greffrath
4f08beccc6 get rid of all remaining redundant declarations
Second step towards #8.
2020-01-06 11:11:17 +01:00
Fabian Greffrath
ac5cebae6a
make header files self-consistent (#16)
* am_map.h: include m_fixed.h for the fixed_t typedef

* d_french.h: fix line continuation

* d_main.h: include doomdef.h for the skill_t typedef

* doomstat.h: remove redundant pitched_sounds declaration

* g_game.h: remove redundant G_CheckDemoStatus() declaration

remove redundant G_InitNew() declaration
remove redundant dprintf() declaration

* m_cheat.h: include doomtype.h for the ULong64 and boolean typedefs

* m_misc.h: include doomdef.h for the ss_types typedef

* p_inter.h: remove redundant god_health, idfa_armor, idfa_armor_class, idkfa_armor and idkfa_armor_class declarations

* p_pspr.h: include doomdef.h for the NUMWEAPONS definition

* p_saveg.h: include doomtype.h for the byte typedef

* p_setup.h: include doomdef.h for the skill_t typedef

* p_spec.h: remove redundant T_FireFlicker() and P_RemoveActiveCeiling() declarations

* p_tick.h: include p_mobj.h for the mobj_t typedef

* r_bsp.h: include r_defs.h for the seg_t, side_t, line_t, sector_t, etc. typedefs

* r_draw.h: remove redundant R_DrawTLColumn() declaration

* r_main.h: remove redundant viewwidth, viewheight, *fullcolormap and **colormaps declarations

* r_segs.h: include r_defs.h for the drawseg_t typedef

* r_things.h: include doomdef.h for the MAX_SCREENWIDTH definition

include m_fixed.h for the fixed_t typedef
include r_defs.h for the column_t, sector_t and vissprite_t typedefs

* s_sound.h: include p_mobj.h for the mobj_t typedef

* st_stuff.h: remove redundant ST_Responder() declaration

* wi_stuff.h: include d_player.h for the wbstartstruct_t typedef
2020-01-06 09:39:22 +01:00