71 Commits

Author SHA1 Message Date
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
Fabian Greffrath
733af4072d let Autoconf set the VERSION macro
Rename MBF's own VERSION macro to MBFVERSION.
2020-01-05 20:16:29 +01:00
Fabian Greffrath
1ccfb71b7a adapt mouse movement handling from Chocolate Doom 2019-12-30 11:53:47 +01:00
Fabian Greffrath
95166ee810 fix a crash when gamemap is not initialized
This may happen when leaving a menu during the title screen when the
first demos hasn't been loaded yet.
2019-12-27 08:40:10 +01:00
Fabian Greffrath
643922d134
complete overhaul of the input system (#12)
* port most input-related code from Chocolate Doom 3.0

* implement prev/next weapon switching with the mouse wheel

 * Currently hard-wired to MB4/MB5, respectively.

* use up to 8 joystick buttons

 * Bind buttons 4 and 5 to strafe left/right, respectively. These
   correspond to the shoulder buttons of my SNES-style gamepad.

* add the ability to clear key bindings in the menu with the DEL key

* make prev/next weapon available in the kex binding menu

* actually use the prev/next weapon key bindings

* declare the new functions as static

* comments \o/
2019-12-26 14:42:38 +01:00
Fabian Greffrath
defd1037d0 save fullscreen mode across engine restarts 2019-12-23 20:42:52 +01:00
Fabian Greffrath
15131a1cc2 let the CPU sleep for 1 ms if there is no tic to proceed
This brings CPU usage down from 100% to ~18% on my system - just like
Chocolate Doom.
2019-12-23 13:12:39 +01:00
Fabian Greffrath
7af1150cb1 apply some stardard CFLAGS if compiling with GCC 2019-12-23 13:09:27 +01:00
Fabian Greffrath
62f1164cbc include unistd.h for isatty() 2019-12-22 21:33:34 +01:00
Fabian Greffrath
37111c9c66 add some common search directories to FindIWADFile() 2019-12-20 14:34:56 +01:00
Fabian Greffrath
f97f622c99 Pop up a GUI dialog box to show the error message in I_Error()
Shamelessly taken from Chocolate Doom, again.
2019-12-20 13:15:56 +01:00
Fabian Greffrath
f4acd9d6bd optional support for PNG screenshots
You need to have SDL2_Image installed and run ./configure --with-sdlimage
2019-12-20 12:36:50 +01:00
Fabian Greffrath
1b0777bd84 port rendering and input code to SDL2
* Introduce rendering window, renderer, intermediate ARGB frame
   buffer and texture.
 * Update keyboard handling to scancode-based approach from Chocolate
   Doom 3.0.
 * Other code changes adapted from Chocolate Doom 3.0:
   + mouse grabing
   + window event handling
   + fullscreen toggle
 * Adapt calls to SDL2 API changes.
 * Remove all remaining SDL1-only cruft and Source/i_stretch.c.

 * Rename "Use Page-Flipping" menu option to "Use Hardware
   Acceleration".
2019-12-20 11:08:03 +01:00
Fabian Greffrath
d318bee68b enable building on 64-bit architectures
* Include stdint.h for intptr_t types.
 * Check for more headers and data types in configure.ac.
 * Use a union of integer and string pointer to store config values, instead
   of type-punning string pointers to integers which won't work on
   64-bit systems anyway.
 * Silence some "incompatible pointer types" GCC warnings, as
   pointers to integer and union config_u are in fact
   interchangeable.
 * Fix memcpy() size parameters and pointer progression.
 * Fix BMP screenshots by changing some variables from ambigious long
   to corresponding int types.
 * Silence the last remaining "cast pointer from/to integer of
   different size" warnings.
2019-12-20 09:02:53 +01:00
Fabian Greffrath
8a9061188b avoid configure substitutions in _SOURCES variables
Automake manual says:
"You can’t put a configure substitution (e.g., ‘@FOO@’ or ‘$(FOO)’
where FOO is defined via AC_SUBST) into a _SOURCES variable. The
reason for this is a bit hard to explain, but suffice to say that it
simply won’t work. Automake will give an error if you try to do this."

Well, okay.
2019-12-20 08:47:19 +01:00
Fabian Greffrath
a42d5677e9
general improvements to the Automake build system (#2)
* Call the binary by the package name.
 * Add header files to sources.
 * Optionally build with support for helper dogs and beta emulation
   (enabled by default).
 * Build with config.h instead of passing all defines on the command line.
2019-12-19 21:32:04 +01:00
Fabian Greffrath
2cfdd6a2fe
fix "type defaults to 'int'" compiler warnings (#1)
This fixes the last remaining warnings left when compiling with GCC
9.2.1 without any additional warning compiler flags.
2019-12-19 21:26:50 +01:00
Fabian Greffrath
88d472704d convert all source files to UNIX line endings upstream 2019-12-19 21:19:02 +01:00
James Haley
3af60d718b Merge pull request #7 from fabiangreffrath/portability-linux
Fix compilation on *nix systems, e.g. Linux+GLibC+GCC
2016-08-20 17:29:00 -05:00
James Haley
139e057f53 Merge pull request #9 from chungy/gitignore
Ignore autotools-generated files
2016-08-20 17:24:11 -05:00
Mike Swanson
baa1c88082 Ignore autotools-generated files 2016-08-20 08:24:31 -07:00
James Haley
3988bce9d3 Merge pull request #8 from fabiangreffrath/config-aspect
Enable aspect ration correction by default
2016-08-20 02:19:41 -05:00
James Haley
dd1d2e9fed Merge pull request #6 from fabiangreffrath/portability-autotools
Add Autoconf/Automake build system
2016-08-20 02:17:23 -05:00
James Haley
fa913d5a25 Merge pull request #3 from fabiangreffrath/portability-mingw32
Fix compilation with non-MSCV compilers, e.g. MinGW
2016-08-20 02:14:59 -05:00
James Haley
841d8afd84 Merge pull request #2 from fabiangreffrath/security-formatstring
Fix a format string vulnerability
2016-08-20 02:13:33 -05:00
James Haley
09ce9e26d3 Merge pull request #1 from fabiangreffrath/crash-videomode
Fix a format string mismatch
2016-08-20 02:12:43 -05:00
Fabian Greffrath
dbda307492 Enable aspect ration correction by default 2016-08-19 21:43:49 +02:00
Fabian Greffrath
e010030d57 Add Autoconf/Automake build system 2016-08-19 21:41:36 +02:00
Fabian Greffrath
d858126b2c Fix compilation on *nix systems, e.g. Linux+GLibC+GCC 2016-08-19 21:39:04 +02:00